const class syntax::SyntaxRules

sys::Obj
  syntax::SyntaxRules

@Serializable

Source

SyntaxRules defines the syntax rules used to parse a specific programming language.

blockCommentEnd

const Str? blockCommentEnd

Source

End token for multi-line block comments

blockCommentStart

const Str? blockCommentStart

Source

Start token for multi-line block comments

blockCommentsNest

const Bool blockCommentsNest := false

Source

Can block comments be nested (default is false).

brackets

const Str brackets := "(){}[]"

Source

Bracket characters defaults to "()[]{}".

comments

const Str[]? comments

Source

Start tokens for single line comments to end of line (list of strings).

keywords

const Str[]? keywords

Source

List of the keywords.

loadForExt

static SyntaxRules? loadForExt(Str ext)

Source

Load syntax rules for given file extension using "etc/syntax/ext.props". If no rules defined for extension return null.

loadForFile

static SyntaxRules? loadForFile(File file, Str? firstLine := null)

Source

Load syntax rules for given file. If the file has already been parse then pass the first line to avoid re-reading the file to check the "#!" shebang. First we attempt to map the file extension to rules. If that fails, then we check the first line to see if defines a "#!" shebang. Return null if no rules can be determined.

make

new make(|This|? f := null)

Source

Default constructor with it-block

strs

const SyntaxStr[]? strs

Source

String and character literal styles