Parsing¶
-
class
fluent.syntax.parser.FluentParser(with_spans=True)[source]¶ This class is used to parse Fluent source content.
with_spansenables source information in the form ofast.Spanobjects for eachast.SyntaxNode.-
parse(source)[source]¶ Create a
ast.Resourcefrom a Fluent source.
-
parse_entry(source)[source]¶ Parse the first
ast.Entryin source.Skip all encountered comments and start parsing at the first
ast.Messageorast.Termstart. Returnast.Junkif the parsing is not successful.Preceding comments are ignored unless they contain syntax errors themselves, in which case
ast.Junkfor the invalid comment is returned.
-