fix parser
This commit is contained in:
parent
39f05e2796
commit
737cc9fbab
@ -20,13 +20,11 @@
|
|||||||
parse(Input) when is_binary(Input) ->
|
parse(Input) when is_binary(Input) ->
|
||||||
Tokens = lexer(Input),
|
Tokens = lexer(Input),
|
||||||
{ok, AST} = parser(Tokens),
|
{ok, AST} = parser(Tokens),
|
||||||
lists:foreach(fun(E) ->
|
try validate(AST) of
|
||||||
lager:debug("block: ~p", [E])
|
ok ->
|
||||||
end, parse_ast(AST)),
|
{ok, AST}
|
||||||
|
catch throw:Reason ->
|
||||||
case validate(AST) of
|
{error, Reason}
|
||||||
ok -> {ok, AST};
|
|
||||||
{error, Reason} -> {error, Reason}
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
parse_file(Filename) ->
|
parse_file(Filename) ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user