Skip to content

Commit ff47c42

Browse files
authored
Merge pull request #150 from daypack-dev/dev
Added check for language fragments
2 parents de36792 + 7bd4935 commit ff47c42

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/time_expr.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,9 @@ module Of_string = struct
996996

997997
let of_string ?(enabled_fragments = all_lang_fragments) (s : string) :
998998
(Time_expr_ast.t, string) result =
999-
parse_string (time_expr ~enabled_fragments <* skip_space <* eoi) s
999+
match enabled_fragments with
1000+
| [] -> Error "No language fragments are enabled"
1001+
| _ -> parse_string (time_expr ~enabled_fragments <* skip_space <* eoi) s
10001002
end
10011003

10021004
let of_string = Of_string.of_string

0 commit comments

Comments
 (0)