Documentation
¶
Overview ¶
Package parser defines a Papyrus parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option defines an option to configure how parsing is performed.
func WithComments ¶
WithComments controls block and line (i.e. loose) comment processing.
If enabled, loose comments will be attached to the appropriate nodes and/or appear as ast.CommentStatement nodes. This is only required when the nodes may need to be written back out as source, e.g. when formatting.
func WithRecovery ¶
WithRecovery controls parsing should attempt error recovery and potentially include ast.Error nodes in the resulting AST.
If enabled, the parser will attempt error recovery if an issue is found and instead of immediately failing, it will try to emit an error node instead. It is the responsibility of the caller to check for the presensce of ast.Error nodes.
Enabling this does not guarantee that parsing will never fail with an [Error].