Skip to content

Commit

Permalink
Try to minimise diff even further
Browse files Browse the repository at this point in the history
  • Loading branch information
jiribenes committed Jul 20, 2024
1 parent 58c0700 commit 1fea08d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/effekt-syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ export const syntax = <ILanguage>{
[/[;,.]/, 'delimiter'],

// strings
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' }],
[/"([^"\\]|\\.)*$/, 'string.invalid' ], // non-teminated string
[/"/, { token: 'string.quote', bracket: '@open', next: '@string' } ],

// characters
[/'[^\\']'/, 'string'],
Expand All @@ -79,8 +79,9 @@ export const syntax = <ILanguage>{
],

definition: [
[/[a-zA-Z_$][\w$]*/, 'definition'],
[/\s*/, '', '@pop']
{ include: '@whitespace' },
[/[a-zA-Z_$][\w$?!]*/, 'definition'],
[new RegExp(""),'','@pop']
],

comment: [
Expand All @@ -91,12 +92,12 @@ export const syntax = <ILanguage>{
],

string: [
[/[^\\"$]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
[/[^\\"$]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/\$\{/, { token: 'delimiter.bracket', next: '@bracketCounting' }],
[/\$[a-z_][\w$]*/, 'variable'],
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
[/"/, { token: 'string.quote', bracket: '@close', next: '@pop' }]
],

bracketCounting: [
Expand Down

0 comments on commit 1fea08d

Please sign in to comment.