enopy » parse
parse(input) → Section
parse(input, options) → Section
Parse a string in eno notation.
enocolor: blue
python>>> enopy.parse(input)
<class Section document length="1">
# Errors will be ...
>>> enopy.parse(input, locale='es') # In spanish - ¡hola!
>>> enopy.parse(input, reporter=eno.reporters.HTML) # HTML for e.g. web integration
>>> enopy.parse(input, reporter=eno.reporters.Terminal) # Colored for terminal output
>>> enopy.parse(input, source_label='my-file.eno') # Annotated with a label as context
>>> enopy.parse(input, zero_indexing=True) # Counting line and column numbers from 0
Parameters
inputA string containing text in eno notation.
optionslocale
A string specifying the code of the locale to use for error messages (e.g. 'de'
, 'es'
), by default 'en'
.
reporter
One of enopy.reporters.Text
, enopy.reporters.HTML
, enopy.reporters.Terminal
.
source_label
A string that labels where the input comes from (e.g. a filename), this is included with error messages to help the user located the file.
zero_indexing
True
or False
(default), set True
to display 0,1,2,..
line and column numbers in all error messages instead of the default 1,2,3,..
indexing.
Return value
A Section
representing the document.