squiffy-compiler 7.0.0-beta.5 → 7.0.0-beta.7
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/README.md +10 -2
- package/dist/analyse.d.ts +6 -0
- package/dist/analyse.js +101 -11
- package/dist/compiler.d.ts +9 -2
- package/dist/compiler.js +5 -2
- package/dist/css-urls.d.ts +4 -0
- package/dist/css-urls.js +59 -0
- package/dist/emit.d.ts +13 -0
- package/dist/emit.js +45 -1
- package/dist/language-service.d.ts +1 -0
- package/dist/language-service.js +39 -13
- package/dist/node.d.ts +7 -1
- package/dist/node.js +16 -5
- package/dist/parse.d.ts +3 -0
- package/dist/parse.js +25 -2
- package/dist/project.d.ts +56 -0
- package/dist/project.js +148 -15
- package/dist/quest/aslx.d.ts +50 -0
- package/dist/quest/aslx.js +181 -0
- package/dist/quest/convert.d.ts +20 -0
- package/dist/quest/convert.js +504 -0
- package/dist/quest/script.d.ts +92 -0
- package/dist/quest/script.js +453 -0
- package/dist/quest/scripts.d.ts +24 -0
- package/dist/quest/scripts.js +505 -0
- package/dist/quest/text.d.ts +17 -0
- package/dist/quest/text.js +305 -0
- package/dist/setters.d.ts +4 -0
- package/dist/setters.js +10 -5
- package/dist/story-graph.d.ts +2 -1
- package/dist/story-graph.js +2 -0
- package/dist/syntax.d.ts +27 -2
- package/dist/text.d.ts +2 -0
- package/dist/text.js +24 -15
- package/dist/twine/audio.d.ts +21 -0
- package/dist/twine/audio.js +80 -0
- package/dist/twine/convert.d.ts +15 -1
- package/dist/twine/convert.js +217 -21
- package/dist/twine/expression.d.ts +26 -1
- package/dist/twine/expression.js +111 -6
- package/dist/twine/harlowe.d.ts +10 -0
- package/dist/twine/harlowe.js +417 -58
- package/dist/twine/sugarcube.d.ts +4 -0
- package/dist/twine/sugarcube.js +388 -86
- package/dist/v5.js +2 -1
- package/package.json +3 -2
- package/syntaxes/squiffy.tmLanguage.json +9 -4
package/dist/v5.js
CHANGED
|
@@ -132,7 +132,8 @@ function findCommands(text, section, names) {
|
|
|
132
132
|
let i = 0;
|
|
133
133
|
while (i < text.length) {
|
|
134
134
|
if (text.startsWith("{{", i)) {
|
|
135
|
-
|
|
135
|
+
// A comment ends at --}}, and can have }} in it before that
|
|
136
|
+
const closeToken = text.startsWith("{{!--", i) ? "--}}" : text.startsWith("{{{", i) ? "}}}" : "}}";
|
|
136
137
|
const close = text.indexOf(closeToken, i + 2);
|
|
137
138
|
i = close == -1 ? i + 2 : close + closeToken.length;
|
|
138
139
|
continue;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "squiffy-compiler",
|
|
3
|
-
"version": "7.0.0-beta.
|
|
3
|
+
"version": "7.0.0-beta.7",
|
|
4
4
|
"description": "A tool for creating multiple-choice interactive stories",
|
|
5
5
|
"author": "Alex Warren",
|
|
6
6
|
"contributors": [
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"vitest": "^5.1.0"
|
|
24
24
|
},
|
|
25
25
|
"scripts": {
|
|
26
|
+
"dev": "vitest",
|
|
26
27
|
"test": "vitest --run",
|
|
27
28
|
"build": "tsc",
|
|
28
29
|
"prepublishOnly": "npm run build && npm run test"
|
|
@@ -50,5 +51,5 @@
|
|
|
50
51
|
"syntaxes/squiffy.tmLanguage.json"
|
|
51
52
|
],
|
|
52
53
|
"type": "module",
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ce089d0f0d0901c10e5a148e38cb1fdbb5d5a2d2"
|
|
54
55
|
}
|
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
|
-
"match": "^\\s*(@)(title|start|import|ui)\\s+(.*?)\\s*$",
|
|
288
|
+
"match": "^\\s*(@)(title|start|import|ui|music|sound|class)\\s+(.*?)\\s*$",
|
|
289
289
|
"captures": {
|
|
290
290
|
"0": {
|
|
291
291
|
"name": "meta.directive.squiffy"
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
304
|
{
|
|
305
|
-
"match": "^\\s*(@)(clear|end)\\s*$",
|
|
305
|
+
"match": "^\\s*(@)(clear|repeat|end)\\s*$",
|
|
306
306
|
"captures": {
|
|
307
307
|
"1": {
|
|
308
308
|
"name": "punctuation.definition.directive.squiffy keyword.control.directive.squiffy"
|
|
@@ -636,7 +636,7 @@
|
|
|
636
636
|
"comment": "A setter's value. One with quotes, brackets, operators or and/or/not is an expression, as in {{#if}}. A single word is an attribute in a story with a squiffy.json, and anything else unquoted is text, as in a story without one. Of two matches at the start, the first listed wins.",
|
|
637
637
|
"patterns": [
|
|
638
638
|
{
|
|
639
|
-
"match": "(?=.*(?:[\"'()
|
|
639
|
+
"match": "(?=.*(?:[\"'()+*%<>!?]|\\s[-/]|\\b(?:and|or|not|contains)\\b)).+$",
|
|
640
640
|
"name": "meta.expression.squiffy",
|
|
641
641
|
"captures": {
|
|
642
642
|
"0": {
|
|
@@ -816,9 +816,14 @@
|
|
|
816
816
|
"name": "keyword.operator.logical.handlebars.squiffy"
|
|
817
817
|
},
|
|
818
818
|
{
|
|
819
|
-
"match": "!=|>=|<=|=(?!=)
|
|
819
|
+
"match": "!=|>=|<=|=(?!=)|>|<|\\bcontains\\b",
|
|
820
820
|
"name": "keyword.operator.comparison.handlebars.squiffy"
|
|
821
821
|
},
|
|
822
|
+
{
|
|
823
|
+
"comment": "a ? b : c. A : with no space before it is in an object, as in { hp: 10 }",
|
|
824
|
+
"match": "\\?|(?<=\\s):(?=\\s)",
|
|
825
|
+
"name": "keyword.operator.ternary.handlebars.squiffy"
|
|
826
|
+
},
|
|
822
827
|
{
|
|
823
828
|
"comment": "- and / are operators only at the start of a word: a-b is an attribute name and a/b a path",
|
|
824
829
|
"match": "[+*%]|(?<![\\w.\\]-])[-/]",
|