Skip to content

Commit

Permalink
address some edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
yudonglin committed Sep 29, 2024
1 parent b0b2348 commit e431127
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 17 deletions.
2 changes: 1 addition & 1 deletion vns-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how
### Added
- Added syntax highlight for variables and operations.

## [2.3.0] - 2024-7-19
## [2.3.0] - 2024-9-29

### Changed
- Improve highlighting clarification and string pattern matching for specific conditions.
4 changes: 1 addition & 3 deletions vns-vscode/language-configuration.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"comments": {
// symbol used for single line comment. Remove this entry if your language does not support line comments
"lineComment": "//",
// symbols used for start and end a block comment. Remove this entry if your language does not support block comments
"blockComment": [ "/*", "*/" ]
"lineComment": "//"
},
// symbols used as brackets
"brackets": [
Expand Down
64 changes: 51 additions & 13 deletions vns-vscode/syntaxes/vns.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@
"match": "^\\s*\\-\\s+\\s*(.*?)\n"
},
"double-slash": {
"begin": "\\/\\/",
"end": "\n",
"name": "comment.line.double-slash"
"match": "//.*$",
"name": "comment.line.double-slash.vns"
},
"heading": {
"match": "(.*?):",
"match": "^\\s*(.+?):\\s*$",
"name": "markup.heading.vns"
},
"keywords": {
Expand All @@ -65,13 +64,20 @@
]
},
"number-sign": {
"begin": "\\#",
"end": "\n",
"name": "comment.line.number-sign"
"match": "#.*$",
"name": "comment.line.number-sign.vns"
},
"numbers": {
"match": "\\b\\d+\\b",
"name": "constant.numeric.integer"
"patterns": [
{
"match": "\\b\\d+\\.\\d+\\b",
"name": "constant.numeric.float.vns"
},
{
"match": "\\b\\d+\\b",
"name": "constant.numeric.integer.vns"
}
]
},
"option_prompt": {
"captures": {
Expand All @@ -82,22 +88,54 @@
"name": "string.unquoted.vns"
},
"3": {
"name": "keyword.operator.math"
"name": "keyword.operator.vns"
}
},
"match": "\\[(\\w+)\\](.*?)(->)"
"match": "\\[(.+?)\\]\\s*(.*?)\\s*(->)"
},
"strings": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.vns"
}
},
"end": "\"",
"name": "string.unquoted.vns"
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.vns"
}
},
"name": "string.quoted.double.vns",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.vns"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.vns"
}
},
"end": "'",
"name": "string.unquoted.vns"
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.vns"
}
},
"name": "string.quoted.single.vns",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.vns"
}
]
}
]
}
Expand Down

0 comments on commit e431127

Please sign in to comment.