-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improved TextMate grammar (#623)
### Summary of Changes Various improvements to the auto-generated TextMate grammar: * Categorization of keywords into correct groups * Description of number literals * Treatment of keywords that are enclosed in backticks as names * Test markers are no longer treated as comments
- Loading branch information
1 parent
608e470
commit d7ff0e2
Showing
3 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"name": "safe-ds", | ||
"scopeName": "source.safe-ds", | ||
"fileTypes": [ | ||
".sdspipe", | ||
".sdsstub", | ||
".sdstest" | ||
], | ||
"patterns": [ | ||
{ | ||
"include": "#comments" | ||
}, | ||
{ | ||
"name": "constant.numeric.safe-ds", | ||
"match": "\\b([0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?)\\b" | ||
}, | ||
{ | ||
"name": "constant.language.safe-ds", | ||
"match": "\\b(false|null|true)\\b" | ||
}, | ||
{ | ||
"name": "storage.type.safe-ds", | ||
"match": "\\b(annotation|attr|class|enum|fun|package|pipeline|schema|segment|val)\\b" | ||
}, | ||
{ | ||
"name": "storage.modifier.safe-ds", | ||
"match": "\\b(const|in|internal|out|private|static)\\b" | ||
}, | ||
{ | ||
"name": "keyword.operator.safe-ds", | ||
"match": "\\b(and|not|or|sub|super)\\b" | ||
}, | ||
{ | ||
"name": "keyword.other.safe-ds", | ||
"match": "\\b(as|from|import|literal|union|where|yield)\\b" | ||
}, | ||
{ | ||
"name": "entity.name.safe-ds", | ||
"begin": "\\`", | ||
"end": "\\`" | ||
}, | ||
{ | ||
"name": "string.quoted.double.safe-ds", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"include": "#string-character-escape" | ||
} | ||
] | ||
} | ||
], | ||
"repository": { | ||
"comments": { | ||
"patterns": [ | ||
{ | ||
"name": "comment.line.double-slash.safe-ds", | ||
"begin": "//", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "punctuation.whitespace.comment.leading.safe-ds" | ||
} | ||
}, | ||
"end": "(?=$)" | ||
}, | ||
{ | ||
"name": "comment.block.safe-ds", | ||
"begin": "/\\*", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.comment.safe-ds" | ||
} | ||
}, | ||
"end": "\\*/", | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.comment.safe-ds" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"string-character-escape": { | ||
"name": "constant.character.escape.safe-ds", | ||
"match": "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\\{[0-9A-Fa-f]+\\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)" | ||
} | ||
} | ||
} |