Skip to content

Commit

Permalink
Highlight character names in options and line groups
Browse files Browse the repository at this point in the history
  • Loading branch information
desplesda committed Dec 5, 2024
1 parent f52cc38 commit 2d74786
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/yarnspinner-language.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,21 @@ export const monarchLanguage = <languages.IMonarchLanguage>{
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"],

Expand All @@ -148,9 +163,6 @@ export const monarchLanguage = <languages.IMonarchLanguage>{
// Hashtag
[/#[^\s]+/, "annotation"],

// Character names
[/^\s*[^\s]+?\:/, "line.character"],

// // identifiers and keywords
// [/[a-z_$][\w$]*/, { cases: { '@typeKeywords': 'keyword',
// '@keywords': 'keyword',
Expand Down

0 comments on commit 2d74786

Please sign in to comment.