Skip to content

Commit

Permalink
fix namespace statement highlight
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeny Metelkin committed Dec 22, 2023
1 parent 1b873b0 commit bf86790
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# TODO list

## Errors

- highlight `block @Species begin end`

## Updates

- hot keys for InfoPage
- nice css styles
- support of smartphones
Expand All @@ -11,7 +17,3 @@
? Matlab highliting support
? console at the bottom
? file content manager

## Errors

- highlight namespace
9 changes: 7 additions & 2 deletions src/heta-colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ monaco.languages.register({id: 'heta'});
monaco.languages.setMonarchTokensProvider('heta', {
defaultToken: 'invalid',
keywords: ['abstract', 'concrete', 'namespace', 'include', 'type', 'with', 'begin', 'end', 'true', 'false', 'Inf', 'NaN'],
//tokenPostfix: ".yaml",
//tokenPostfix: ".heta",
brackets: [
{ token: "delimiter.bracket", open: "{", close: "}" },
{ token: "delimiter.square", open: "[", close: "]" },
Expand All @@ -27,7 +27,10 @@ monaco.languages.setMonarchTokensProvider('heta', {
{ include: '@multilineCommentStart' },
{ include: "@whitespace" },
[/(?=include )/, 'keyword', '@includeStatement'],
[/((?:abstract[ \t]+|concrete[ \t]+)?namespace[ \t]+)(@idProp)/, ['keyword', 'string'], '@namespaceBlock'],
[
/((?:abstract[ \t]+|concrete[ \t]+)?namespace)([ \t]+@idProp)/,
['keyword', {token: 'string', next: '@namespaceBlock'}]
],
[/block /, 'keyword', '@defaultBlock'],
{ include: "@actionStatement" },
//[/@numberInteger(?![ \t]*\S+)/, "number"],
Expand Down Expand Up @@ -59,6 +62,8 @@ monaco.languages.setMonarchTokensProvider('heta', {
['', 'invalid', '@pop'],
],
namespaceBlock: [
{ include: "@whitespace" },
[/;/, 'delimiter', '@pop'],
[/begin/, 'keyword', '@block']
],
defaultBlock: [
Expand Down

0 comments on commit bf86790

Please sign in to comment.