Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (12 sloc) 424 Bytes
-module(zucchini).
-export([parse_string/1, parse_file/1]).
parse_string(String) when is_binary(String) ->
parse_string(binary_to_list(String));
parse_string(String) when is_list(String) ->
{ok, Tokens, _} = zucchini_lexer:string(String),
zucchini_parser:parse(Tokens).
parse_file(Filename) ->
case file:read_file(Filename) of
{ok, Binary} -> parse_string(Binary);
Error -> Error
end.
Something went wrong with that request. Please try again.