@exercism/highlightjs-jikiscript 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jikiscript.js +1 -1
- package/package.json +6 -2
- package/src/jikiscript.ts +4 -3
package/dist/jikiscript.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function g(b){let q={scope:"string",begin:'"',end:'"'},u=b.C_LINE_COMMENT_MODE,k={controlKeyword:"repeat times repeat_until_game_over repeat_forever for each in with to return",definitionKeyword:"function set change",logicalOperator:"and or is equals not",keyword:"log do end for each if else function with set change to",literal:["false","true"]},v=Object.values(k).join(" ").split(" "),w=b.C_NUMBER_MODE,x=["true","false"],y={relevance:0,match:b.regex.either(...x),className:"bool"},z=[">=","<=","==","!=",">","<","!"],F={relevance:0,match:b.regex.either(...z),className:"operator"},J=[/\(/,/\)/],X={relevance:0,match:b.regex.either(...J),className:"paren"},Z=[/\[/,/\]/],$={relevance:0,match:b.regex.either(...Z),className:"squareBracket"},c=[/\*/,"%",/\+/,/\-/,/\//],d={relevance:0,match:b.regex.either(...c),className:"arithmeticOperator"},f={relevance:0,match:b.regex.concat("\\b(?!(?:",v.join("|"),")\\b)",/[a-zA-Z_]\w*(?:[?!]|\b)/),className:"variableName"};return{name:"JikiScript",case_insensitive:!1,keywords:k,contains:[q,u,w,F,d,X,$,y,f]}}export{g as default};
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exercism/highlightjs-jikiscript",
|
|
3
|
-
"module": "dist/jikiscript.
|
|
3
|
+
"module": "dist/jikiscript.js",
|
|
4
4
|
"main": "dist/jikiscript.js",
|
|
5
5
|
"types": "dist/jikiscript.d.ts",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"version": "1.0.
|
|
7
|
+
"version": "1.0.1",
|
|
8
8
|
"author": {
|
|
9
9
|
"name": "Jeremy Walker"
|
|
10
10
|
},
|
|
@@ -24,5 +24,9 @@
|
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"typescript": "^5.4.5"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/exercism/highlightjs-jikiscript.git"
|
|
27
31
|
}
|
|
28
32
|
}
|
package/src/jikiscript.ts
CHANGED
|
@@ -34,7 +34,8 @@ export default function (hljs: HLJSApi): Language {
|
|
|
34
34
|
className: "bool"
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
// The longer operators come first, so ">=" isn't read as ">" then "=".
|
|
38
|
+
const OPERATORS = [">=", "<=", "==", "!=", ">", "<", "!"];
|
|
38
39
|
const OPERATOR: Mode = {
|
|
39
40
|
relevance: 0,
|
|
40
41
|
match: hljs.regex.either(...OPERATORS),
|
|
@@ -64,9 +65,9 @@ export default function (hljs: HLJSApi): Language {
|
|
|
64
65
|
const VARIABLE = {
|
|
65
66
|
relevance: 0,
|
|
66
67
|
match: hljs.regex.concat(
|
|
67
|
-
"\\b(?!",
|
|
68
|
+
"\\b(?!(?:",
|
|
68
69
|
ALL_KWS.join("|"),
|
|
69
|
-
"\\b)",
|
|
70
|
+
")\\b)",
|
|
70
71
|
/[a-zA-Z_]\w*(?:[?!]|\b)/
|
|
71
72
|
),
|
|
72
73
|
className: "variableName"
|