ExC v0.4.2 Filter View Source
Filters the outputs of Lexer.tokenize/1 and Parser.parse/2.
Link to this section Summary
Link to this section Functions
Link to this function
filter_lexer_output(arg, source_code_path, raw_source_code_string, verbose)
View SourceSpecs
Given the output of the Lexer, it prints any lexing errors or continues with the compilation if there are none.
{error_token, :error} is a tuple that contains the following elements:
- error_token: list of all the tokens found in the source code.
Refer to
Structs.Tokenfor more information. - :error: atom indicating if there was an invalid token in the source code.
source_code_path is the path to the file to be compiled.
verbose a boolean value indicating if the compiler should output all of its steps.
Specs
Given the output of the Parser, it prints any parsing errors or continues
with the compilation if there are none.
{:token_missing_error, _, token_list, error_cause, otl}
is a tuple that contains the following elements:
- :token_missing_error: atom indicating if there was an invalid token in the source code.
- output_abstract_syntax_tree: Abstract Syntax Tree (OAST) generated given Output Token List (OTL).
- token_list: list of all the bad tokens found in the source code
- error_cause: tuple containing the cause of the bad tokens.
source_code_path is the path to the file to be compiled.
verbose a boolean value indicating if the compiler should output all of its steps.