-
Notifications
You must be signed in to change notification settings - Fork 0
Example Use
walter-weinmann edited this page May 23, 2016
·
1 revision
1> jpparse:parsetree_with_tokens("a:b").
{ok,{{':',<<"b">>,<<"a">>},
[{'STRING',1,"a"},{':',1},{'STRING',1,"b"}]}}
2> jpparse:parsetree("a:b{1-2").
{parse_error,{1,"syntax error before: '-'",
[{'STRING',1,"a"},
{':',1},
{'STRING',1,"b"},
{'{',1},
{'STRING',1,"1"},
{'-',1},
{'STRING',1,"2"}]}}
3> jpparse:parsetree("a:b[1-2").
{parse_error,{1,"syntax error before: '-'",
[{'STRING',1,"a"},
{':',1},
{'STRING',1,"b"},
{'[',1},
{'STRING',1,"1"},
{'-',1},
{'STRING',1,"2"}]}}
4> jpparse:parsetree_with_tokens("a:b[1,2]").
{ok,{{'[]',{':',<<"b">>,<<"a">>},[1,2]},
[{'STRING',1,"a"},
{':',1},
{'STRING',1,"b"},
{'[',1},
{'STRING',1,"1"},
{',',1},
{'STRING',1,"2"},
{']',1}]}}
5> jpparse:parsetree_with_tokens("a:b{x,y}").
{ok,{{'{}',{':',<<"b">>,<<"a">>},[<<"x">>,<<"y">>]},
[{'STRING',1,"a"},
{':',1},
{'STRING',1,"b"},
{'{',1},
{'STRING',1,"x"},
{',',1},
{'STRING',1,"y"},
{'}',1}]}}