Permalink
Browse files

Exclude semicolon character from 'normal' characters

  • Loading branch information...
1 parent fd6635a commit 672f8487e826c279e6702aafa4488785b3eeaa66 Shunichi Shinohara committed Aug 9, 2011
Showing with 27 additions and 1 deletion.
  1. +2 −1 src/eini_lexer.xrl
  2. +25 −0 test/eini_tests.erl
View
@@ -23,10 +23,11 @@ Definitions.
K = [a-zA-Z0-9_\.]+
%% Characters for values, printable except =, [ and ]
+%% \x3b : $;
%% \x3d : $=
%% \x5b : $[
%% \x5d : $]
-V = [\x21-\x3c\x3e-\x5a\x5c\x5e-\x7e]+
+V = [\x21-\x3a\x3c\x3e-\x5a\x5c\x5e-\x7e]+
%% spaces and breaks
S = [\s\t]
View
@@ -26,6 +26,23 @@ one_section_title_only_test_() ->
fun setup/0,
fun teardown/1,
[
+ %% comment only
+ ?_assertEqual({ok, []},
+ parse(
+ ";"
+ )),
+ ?_assertEqual({ok, []},
+ parse(
+ "; "
+ )),
+ ?_assertEqual({ok, []},
+ parse(
+ "; comment"
+ )),
+ ?_assertEqual({ok, []},
+ parse(
+ "; comment in Japanese 日本語"
+ )),
%% Title only
?_assertEqual({ok, [
{title, []}
@@ -238,6 +255,14 @@ one_section_title_and_one_prop_test_() ->
"[title] \n"
"key1=va[lu]e1\n"
)),
+ %% value has < and > chars
+ ?_assertEqual({ok, [
+ {title, [{key1, <<"va<lu>e1">>}]}
+ ]},
+ parse(
+ "[title] \n"
+ "key1=va<lu>e1\n"
+ )),
%% value has ; char
?_assertEqual({ok, [
{title, [{key1, <<"value1;continue">>}]}

0 comments on commit 672f848

Please sign in to comment.