A Monarch language definition

interface IMonarchLanguage {
    brackets?: IMonarchLanguageBracket[];
    defaultToken?: string;
    ignoreCase?: boolean;
    includeLF?: boolean;
    start?: string;
    tokenPostfix?: string;
    tokenizer: {
        [name: string]: IMonarchLanguageRule[];
    };
    unicode?: boolean;
    [key: string]: any;
}

Indexable

[key: string]: any

Other keys that can be referred to by the tokenizer.

Properties

for example [['{','}','delimiter.curly']]

defaultToken?: string

if no match in the tokenizer assign this token class (default 'source')

ignoreCase?: boolean

is the language case insensitive?

includeLF?: boolean

include line feeds (in the form of a \n character) at the end of lines Defaults to false

start?: string

start symbol in the tokenizer (by default the first entry is used)

tokenPostfix?: string

attach this to every token class (by default '.' + name)

tokenizer: {
    [name: string]: IMonarchLanguageRule[];
}

map from string to ILanguageRule[]

Type declaration

unicode?: boolean

is the language unicode-aware? (i.e., /\u{1D306}/)