Skip to content

Commit

Permalink
Exclude semicolon character from 'normal' characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Shunichi Shinohara committed Aug 9, 2011
1 parent fd6635a commit 672f848
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/eini_lexer.xrl
Expand Up @@ -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]
Expand Down
25 changes: 25 additions & 0 deletions test/eini_tests.erl
Expand Up @@ -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, []}
Expand Down Expand Up @@ -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">>}]}
Expand Down

0 comments on commit 672f848

Please sign in to comment.