Permalink
Browse files

treat , like whitespace in the same way clojure does

  • Loading branch information...
1 parent 10d0223 commit 2be6f3169cef5b068a9b9b982967d136d270ae7d @ericbmerritt ericbmerritt committed Dec 29, 2011
Showing with 5 additions and 12 deletions.
  1. +2 −1 src/jxa_parser.erl
  2. +3 −11 test/jxat_parser_proper.erl
View
@@ -408,6 +408,7 @@ comment(Input, Index) ->
ignorable(Input, Index) ->
p(Input, Index, ignorable,
p_optional(p_zero_or_more(p_choose([fun space/2,
+ p_string(","),
fun comment/2]))),
fun(_, _Idx) ->
[]
@@ -453,7 +454,7 @@ ident(Input, Index) ->
p_choose([p_string("/"),
p_one_or_more(
p_and([p_not(
- p_charclass(<<"[ ;><{}/\t\n\s\r\\(\\)\\[\\]\"]">>)),
+ p_charclass(<<"[ ;~,><{}/\t\n\s\r\\(\\)\\[\\]\"]">>)),
p_anything()]))]),
fun(Node, Idx) ->
@@ -89,25 +89,17 @@ internal_string() ->
?LET(S, list([string_character()]),
erlang:binary_to_list(unicode:characters_to_binary(S))).
-ident_initial() ->
- union([33,
- integer(35, 38),
- integer(42, 46),
- integer(63, 90),
- integer(94, 95),
- integer(97, 122),
- integer(126, 127)]).
-
ident_character() ->
union([33,
integer(35, 38),
- integer(42, 46),
+ integer(42, 43),
+ integer(45, 46),
integer(63, 90),
integer(94, 122)]).
ident_string() ->
?LET({S1, S2},
- {ident_initial(),
+ {ident_character(),
list([ident_character()])},
[S1 | erlang:binary_to_list(unicode:characters_to_binary(S2))]).

0 comments on commit 2be6f31

Please sign in to comment.