diff --git a/src/yarnspinner-language.ts b/src/yarnspinner-language.ts index d992b5a..fc5e5ff 100644 --- a/src/yarnspinner-language.ts +++ b/src/yarnspinner-language.ts @@ -136,6 +136,21 @@ export const monarchLanguage = { node: [ ["===", "keyword.other", "@pop"], + // Character names on lines + [/^\s*[^\s]+?\:/, "line.character"], + + // Character names in options + [ + /^(\s*)(->)(\s*)([^\s]+?\:)/, + ["line", "keyword.other", "line", "line.character"], + ], + + // Character names in line groups + [ + /^(\s*)(=>)(\s*)([^\s]+?\:)/, + ["line", "keyword.other", "line", "line.character"], + ], + // Commands ["<<", "keyword.other", "@command"], @@ -148,9 +163,6 @@ export const monarchLanguage = { // Hashtag [/#[^\s]+/, "annotation"], - // Character names - [/^\s*[^\s]+?\:/, "line.character"], - // // identifiers and keywords // [/[a-z_$][\w$]*/, { cases: { '@typeKeywords': 'keyword', // '@keywords': 'keyword',