We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a4201d7 commit e59af69Copy full SHA for e59af69
1 file changed
src/utils/sexp.ml
@@ -22,15 +22,15 @@ let num =
22
let num = String.of_seq chars |> int_of_string in
23
Int num
24
25
-let atom = ident <|> num <|> operator <?> "atom"
+let atom = token (ident <|> num <|> operator) <?> "atom"
26
27
let parens p = surround (token (char '(')) (token (char ')')) p <?> "parentheses"
28
29
let sexp =
30
let call sexp = let+ vals = many sexp in Cons vals in
31
- fix (fun sexp -> parens (call sexp) <|> atom <?> "fix") <?> "sexp"
+ fix (fun sexp -> (parens (call sexp) <|> atom) <?> "fix") <?> "sexp"
32
33
-let parser = many sexp <* eof
+let parser = many sexp
34
35
let of_string s = parse_string parser s
36
0 commit comments