SyntaxRules
@Js
@Serializable
const class SyntaxRules : Obj
SyntaxRules defines the syntax rules used to parse a specific programming language.
Default constructor with it-block
Start tokens for single line comments to end of line (list of strings)
List of the keywords
String and character literal styles
Can block comments be nested (default is false)
Start token for multi-line block comments
End token for multi-line block comments
Bracket characters defaults to "()[]{}"
Load syntax rules for given file
Load syntax rules for given file extension using "etc/syntax/ext.props"
const Str? : blockCommentEnd
End token for multi-line block comments
const Str? : blockCommentStart
Start token for multi-line block comments
const Bool : blockCommentsNest
Can block comments be nested (default is false).
const Str : brackets
Bracket characters defaults to "()[]{}".
const Str[]? : comments
Start tokens for single line comments to end of line (list of strings).
const Str[]? : keywords
List of the keywords.
static SyntaxRules? loadForExt(Str ext)
Load syntax rules for given file extension using "etc/syntax/ext.props". If no rules defined for extension return null.
static SyntaxRules? loadForFile(File file, Str? firstLine)
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.
new make(|This|? f)
Default constructor with it-block
const SyntaxStr[]? : strs
String and character literal styles