n3 2.7.10 → 2.7.11

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/lib/N3Lexer.js CHANGED
@@ -337,11 +337,11 @@ class N3Lexer {
337
337
  case 'f':
338
338
  case 't':
339
339
  // Try to match a boolean
340
- if (match = this._boolean.exec(input)) type = 'literal', value = match[0], prefix = xsd.boolean;else inconclusive = true;
340
+ if (this._boolean.test(input)) type = 'literal', value = firstChar === 't' ? 'true' : 'false', prefix = xsd.boolean, matchLength = value.length;else inconclusive = true;
341
341
  break;
342
342
  case 'a':
343
343
  // Try to find an abbreviated predicate
344
- if (match = this._shortPredicates.exec(input)) type = 'abbreviation', value = 'a';else inconclusive = true;
344
+ if (this._shortPredicates.test(input)) type = 'abbreviation', value = 'a', matchLength = 1;else inconclusive = true;
345
345
  break;
346
346
  case 'h':
347
347
  case 'o':
@@ -350,7 +350,7 @@ class N3Lexer {
350
350
  break;
351
351
  case 'i':
352
352
  // Try to find an IRI property list identifier or N3 verb keyword
353
- if (this._n3Mode && (match = this._n3Id.exec(input))) type = 'id';else if (this._n3Mode && (match = this._matchN3Verb(input, inputFinished))) type = match[0];else inconclusive = true;
353
+ if (this._n3Mode && this._n3Id.test(input)) type = 'id', matchLength = 2;else if (this._n3Mode && (match = this._matchN3Verb(input, inputFinished))) type = match[0];else inconclusive = true;
354
354
  break;
355
355
  case '=':
356
356
  // Try to find an implication arrow or equals sign
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.7.10",
3
+ "version": "2.7.11",
4
4
  "description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
5
5
  "author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
6
6
  "keywords": [
package/src/N3Lexer.js CHANGED
@@ -336,16 +336,16 @@ export default class N3Lexer {
336
336
  case 'f':
337
337
  case 't':
338
338
  // Try to match a boolean
339
- if (match = this._boolean.exec(input))
340
- type = 'literal', value = match[0], prefix = xsd.boolean;
339
+ if (this._boolean.test(input))
340
+ type = 'literal', value = firstChar === 't' ? 'true' : 'false', prefix = xsd.boolean, matchLength = value.length;
341
341
  else
342
342
  inconclusive = true;
343
343
  break;
344
344
 
345
345
  case 'a':
346
346
  // Try to find an abbreviated predicate
347
- if (match = this._shortPredicates.exec(input))
348
- type = 'abbreviation', value = 'a';
347
+ if (this._shortPredicates.test(input))
348
+ type = 'abbreviation', value = 'a', matchLength = 1;
349
349
  else
350
350
  inconclusive = true;
351
351
  break;
@@ -361,8 +361,8 @@ export default class N3Lexer {
361
361
 
362
362
  case 'i':
363
363
  // Try to find an IRI property list identifier or N3 verb keyword
364
- if (this._n3Mode && (match = this._n3Id.exec(input)))
365
- type = 'id';
364
+ if (this._n3Mode && this._n3Id.test(input))
365
+ type = 'id', matchLength = 2;
366
366
  else if (this._n3Mode && (match = this._matchN3Verb(input, inputFinished)))
367
367
  type = match[0];
368
368
  else