Skip to content

Commit 453c189

Browse files
committed
feat: update version to 0.4.2 in package.json; refine regex patterns in syntax definitions for better matching
1 parent f98ed44 commit 453c189

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

vscode-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "noshift-vscode",
33
"displayName": "NoShift.js",
44
"description": "Syntax highlighting + auto-complete for NoShift.js (.nsjs) files",
5-
"version": "0.4.1",
5+
"version": "0.4.2",
66
"publisher": "otoneko1102",
77
"engines": {
88
"vscode": "^1.70.0"

vscode-extension/syntaxes/noshift.tmLanguage.json

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@
112112

113113
"ns-operators": {
114114
"patterns": [
115-
{
116-
"comment": "^3 capitalize modifier - highlights ^3 + next char + rest of identifier",
117-
"name": "keyword.operator.capitalize.noshift",
118-
"match": "\\^3.[a-zA-Z0-9_$]*"
119-
},
120115
{
121116
"comment": "NoShift sequences for shift-required symbols (excludes string/bracket delimiters: ^2 ^7 ^@ ^8 ^9 ^[ ^])",
122117
"name": "keyword.operator.noshift",
@@ -271,14 +266,14 @@
271266
"patterns": [
272267
{
273268
"name": "meta.function-call.noshift",
274-
"match": "(?:\\b|(?<=\\^\\d))([a-zA-Z_$][a-zA-Z0-9_$]*)(?=\\s*\\^8)",
269+
"match": "(?:\\b|(?<=\\^\\d)|(?=\\^3))((?:\\^3)?[a-zA-Z_$](?:(?:\\^3)?[a-zA-Z0-9_$])*)(?=\\s*\\^8)",
275270
"captures": {
276271
"1": { "name": "entity.name.function.noshift" }
277272
}
278273
},
279274
{
280-
"comment": "Function/method definition: function name or method name followed by ^8",
281-
"match": "(?<=\\bfunction\\s)([a-zA-Z_$][a-zA-Z0-9_$]*)",
275+
"comment": "Function/method definition: function name followed by space",
276+
"match": "(?<=\\bfunction\\s)((?:\\^3)?[a-zA-Z_$](?:(?:\\^3)?[a-zA-Z0-9_$])*)",
282277
"captures": {
283278
"1": { "name": "entity.name.function.definition.noshift" }
284279
}
@@ -297,12 +292,13 @@
297292
"match": "(?:\\b|(?<=\\^\\d))[A-Z][A-Z0-9_]{2,}\\b"
298293
},
299294
{
295+
"comment": "PascalCase: starts with ^3 (= uppercase first letter) or raw [A-Z]",
300296
"name": "entity.name.type.noshift",
301-
"match": "(?:\\b|(?<=\\^\\d))[A-Z][a-zA-Z0-9_$]*\\b"
297+
"match": "(?:\\b|(?<=\\^\\d)|(?=\\^3))(?:\\^3[a-zA-Z](?:(?:\\^3)?[a-zA-Z0-9_$])*|[A-Z][a-zA-Z0-9_$]*)"
302298
},
303299
{
304300
"name": "variable.other.noshift",
305-
"match": "(?:\\b|(?<=\\^\\d))[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
301+
"match": "(?:\\b|(?<=\\^\\d))[a-zA-Z_$](?:(?:\\^3)?[a-zA-Z0-9_$])*"
306302
}
307303
]
308304
}

0 commit comments

Comments
 (0)