Documentation ¶
Overview ¶
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
Index ¶
- func IsTypePrefix(input string) bool
- func Parse(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, ...) shared.AstNode
- func ParseExpression(builder shared.NodeBuilder, source compilercommon.InputSource, startIndex int, ...) (shared.AstNode, bool)
- func ParseWithCompatability(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, ...) shared.AstNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsTypePrefix ¶ added in v0.3.0
IsTypePrefix returns whether the given input string is a prefix that supports a type reference declared right after it. For example, the string `function DoSomething() ` will return `true`, as a type can be specified right after that code snippet.
func Parse ¶
func Parse(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, source compilercommon.InputSource, input string) shared.AstNode
Parse performs parsing of the given input string and returns the root AST node.
func ParseExpression ¶
func ParseExpression(builder shared.NodeBuilder, source compilercommon.InputSource, startIndex int, input string) (shared.AstNode, bool)
ParseExpression parses the given string as an expression.
func ParseWithCompatability ¶ added in v0.2.0
func ParseWithCompatability(builder shared.NodeBuilder, importReporter packageloader.ImportHandler, source compilercommon.InputSource, input string) shared.AstNode
ParseWithCompatability performs parsing of the given input string and returns the root AST node. Unlike the normal Parse, this method will try *all* parser versions, starting at the latest and working backwards, until a parse succeeds or there are no additional versions.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package shared defines types shared by all parser implementations.
|
Package shared defines types shared by all parser implementations. |
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
|
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST). |
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST).
|
Package parser defines the full Serulian language parser and lexer for translating Serulian source code into an abstract syntax tree (AST). |