@o-lang/olang 1.0.20 → 1.0.21
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/package.json +1 -1
- package/src/parser.js +18 -17
package/package.json
CHANGED
package/src/parser.js
CHANGED
|
@@ -29,24 +29,25 @@ function parse(code, fileName = null) {
|
|
|
29
29
|
let line = lines[i];
|
|
30
30
|
|
|
31
31
|
// ✅ FIXED: Match both "Allow resolvers" and "Allowed resolvers"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
i++;
|
|
47
|
-
}
|
|
48
|
-
continue;
|
|
32
|
+
const allowMatch = line.match(/^Allow resolvers\s*:\s*$/i);
|
|
33
|
+
if (allowMatch) {
|
|
34
|
+
i++;
|
|
35
|
+
while (i < lines.length) {
|
|
36
|
+
const nextLine = lines[i].trim();
|
|
37
|
+
// Stop if line is empty or looks like a new top-level section
|
|
38
|
+
if (nextLine === '' || /^[A-Z][a-z]/.test(nextLine)) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
// Strip optional YAML list marker: "- name" → "name"
|
|
42
|
+
const cleanVal = nextLine.replace(/^\-\s*/, '').trim();
|
|
43
|
+
if (cleanVal) {
|
|
44
|
+
workflow.allowedResolvers.push(cleanVal);
|
|
45
|
+
workflow.resolverPolicy.declared.push(cleanVal);
|
|
49
46
|
}
|
|
47
|
+
i++;
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
50
51
|
|
|
51
52
|
// ---- Math step patterns (standalone) ----
|
|
52
53
|
let mathAdd = line.match(/^Add\s+\{(.+?)\}\s+and\s+\{(.+?)\}\s+Save as\s+(.+)$/i);
|