@pieceful/ravel-noweb 0.2.0 → 0.3.0
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 +2 -2
- package/src/index.js +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pieceful/ravel-noweb",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lossless noweb and noweb-plus source adapter for Ravel.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"LICENSE"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@pieceful/ravel-core": "0.
|
|
38
|
+
"@pieceful/ravel-core": "0.3.0"
|
|
39
39
|
}
|
|
40
40
|
}
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { parseDefinitionPipeline } from "@pieceful/ravel-core";
|
|
1
|
+
import { nowebReferenceAt, parseDefinitionPipeline } from "@pieceful/ravel-core";
|
|
2
2
|
|
|
3
3
|
const componentPattern = /^[a-z][a-z0-9-]*$/;
|
|
4
4
|
const dialects = new Set(["noweb", "noweb-plus"]);
|
|
@@ -168,9 +168,12 @@ const referencesFrom = (body, source, extended) => {
|
|
|
168
168
|
while (index < body.length) {
|
|
169
169
|
const start = body.indexOf("<<", index);
|
|
170
170
|
if (start === -1) break;
|
|
171
|
-
const
|
|
172
|
-
if (
|
|
173
|
-
|
|
171
|
+
const reference = start > 0 && body[start - 1] === "@" ? null : nowebReferenceAt(body, start);
|
|
172
|
+
if (!reference) {
|
|
173
|
+
index = start + 2;
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const { end, authored } = reference;
|
|
174
177
|
const split = splitNamePipeline(authored, extended);
|
|
175
178
|
references.push({
|
|
176
179
|
authored,
|