titus.prettypfa.jsonNode

titus.prettypfa.jsonNode(text, lineNumbers=True, check=True, version=None, subs={}, **subs2)[source]

Parse PrettyPFA and return the result as PFA in Pythonized JSON form.

Parameters:
  • text (string) – PrettyPFA to parse
  • lineNumbers (bool) – if True include locator marks to trace back to PrettyPFA line numbers
  • check (bool) – if True, check the result for PFA semantic errors (default True); Note: if the PrettyPFA contains any unresolved substitutions (in <<French quotes>>), it will not be checked
  • version (string or None) – version of the PFA language to use while interpreting (None defaults to titus.version.defaultPFAVersion)
  • subs (dict from substitution names to substitutions) – replacement values as PFA titus.pfaast.Ast, PrettyPFA strings, or PFA Pythonized JSON
  • subs2 (dict from substitution names to substitutions) – added to subs (a more convenient way to pass them)
Return type:

Pythonized JSON

Returns:

PFA in Pythonized JSON