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