xnl-core 0.1.1 → 0.1.2
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/index.cjs +12 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -375,8 +375,15 @@ function parseWordLiteral(state) {
|
|
|
375
375
|
return { kind: "Word", namespace: parts, name };
|
|
376
376
|
}
|
|
377
377
|
function readOptionalMarker(state) {
|
|
378
|
-
if (!
|
|
379
|
-
return
|
|
378
|
+
if (!isMarkerStart(peek(state))) return void 0;
|
|
379
|
+
return readMarker(state);
|
|
380
|
+
}
|
|
381
|
+
function readMarker(state) {
|
|
382
|
+
const start = state.pos;
|
|
383
|
+
while (!eof(state) && isIdentifierChar(state.input[state.pos])) {
|
|
384
|
+
state.pos++;
|
|
385
|
+
}
|
|
386
|
+
return state.input.slice(start, state.pos);
|
|
380
387
|
}
|
|
381
388
|
function readKey(state, message) {
|
|
382
389
|
const ch = peek(state);
|
|
@@ -491,6 +498,9 @@ function isIdentifierChar(ch) {
|
|
|
491
498
|
if (!ch) return false;
|
|
492
499
|
return /[A-Za-z0-9_-]/.test(ch);
|
|
493
500
|
}
|
|
501
|
+
function isMarkerStart(ch) {
|
|
502
|
+
return isIdentifierStart(ch) || isDigit(ch);
|
|
503
|
+
}
|
|
494
504
|
function isWhitespace(ch) {
|
|
495
505
|
return ch === " " || ch === " " || ch === "\n" || ch === "\r";
|
|
496
506
|
}
|