Comparing version 0.1.0 to 0.1.1
// **N3Lexer** tokenizes N3 documents. | ||
// ## Regular expressions | ||
var patterns = { | ||
_explicituri: /^<((?:[^> \\]|\\[uU])*)>/, | ||
_explicituri: /^<((?:[^\x00-\x20<>\\"\{\}\|\^\`]|\\[uU])*)>/, | ||
_string: /^"[^"\\]*(?:\\.[^"\\]*)*"(?=[^"\\])|^'[^'\\]*(?:\\.[^'\\]*)*'(?=[^'\\])/, | ||
_tripleQuotedString: /^""("[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*")""|^''('[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*')''/, | ||
_langcode: /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i, | ||
_prefix: /^((?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽ\u037f-\u1fff\u200c-\u200d⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff])(?:[\.\-0-9A-Z_a-z·À-ÖØ-öø-ͽ\u037f-\u1fff\u200c-\u200d‿-⁀⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=\s)/, | ||
_qname: /^((?:[A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽ\u037f-\u1fff\u200c-\u200d⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff])(?:[\.\-0-9A-Z_a-z·À-ÖØ-öø-ͽ\u037f-\u1fff\u200c-\u200d‿-⁀⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z·À-ÖØ-öø-ͽ\u037f-\u1fff\u200c-\u200d‿-⁀⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z·À-ÖØ-öø-ͽ\u037f-\u1fff\u200c-\u200d‿-⁀⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z·À-ÖØ-öø-ͽ\u037f-\u1fff\u200c-\u200d‿-⁀⁰-\u218fⰀ-\u2fef、-\ud7ff豈-\ufdcfﷰ-�]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?=[\s\.;,)])/, | ||
_prefix: /^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\.\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=\s)/, | ||
_qname: /^((?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\.\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?=[\s\.;,)])/, | ||
_number: /^[\-+]?(?:\d+\.?\d*([eE](?:[\-\+])?\d+)|\d+\.\d+|\.\d+|\d+)(?=\s*[\s\.;,)])/, | ||
@@ -30,2 +30,3 @@ _boolean: /^(?:true|false)(?=\s+)/, | ||
'/': '/', '?': '?', '#': '#', '@': '@', '%': '%' }; | ||
var illegalUrlChars = /[\x00-\x20<>\\"\{\}\|\^\`]/; | ||
@@ -103,3 +104,3 @@ // Different punctuation types. | ||
unescaped = this._unescape(match[1]); | ||
if (unescaped === null) | ||
if (unescaped === null || illegalUrlChars.test(unescaped)) | ||
return reportSyntaxError(this); | ||
@@ -148,3 +149,3 @@ token.type = 'explicituri'; | ||
token.value = '"' + match[0] + '"^^<http://www.w3.org/2001/XMLSchema#' + | ||
(match[1] ? 'double>' : (/^[+-]?\d+$/.test(match[0]) ? 'integer>' : 'decimal>')); | ||
(match[1] ? 'double>' : (/^[+\-]?\d+$/.test(match[0]) ? 'integer>' : 'decimal>')); | ||
} | ||
@@ -151,0 +152,0 @@ // Try to match a boolean. |
@@ -423,3 +423,3 @@ // **N3Parser** parses N3 documents. | ||
// ### `_readDeclarationPunctuation` reads the punctiation of a declaration. | ||
// ### `_readDeclarationPunctuation` reads the punctuation of a declaration. | ||
_readDeclarationPunctuation: function (token) { | ||
@@ -431,3 +431,3 @@ // SPARQL-style declarations don't have punctuation. | ||
if (token.type !== 'dot') | ||
return this._error('Expected declaration of to end with a dot', token); | ||
return this._error('Expected declaration to end with a dot', token); | ||
return this._readInTopContext; | ||
@@ -434,0 +434,0 @@ }, |
{ | ||
"name": "n3", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.", | ||
"author": "Ruben Verborgh <ruben.verborgh@gmail.com>", | ||
"keywords": ["turtle", "rdf", "n3", "streaming", "asynchronous"], | ||
"license": "MIT", | ||
"main": "./n3.js", | ||
@@ -8,0 +9,0 @@ "engines": { |
@@ -186,3 +186,3 @@ #!/usr/bin/env node | ||
// Negative tests are successful if an error occurred | ||
var negativeTest = (test.type === prefixes.rdft + 'TestTurtleNegativeSyntax'); | ||
var negativeTest = /TestTurtleNegative/.test(test.type); | ||
if (negativeTest) { | ||
@@ -308,3 +308,3 @@ displayResult(null, !!test.error); | ||
value = value.replace(/"/g, '\\"'); | ||
return '"""' + value + '"""'; | ||
return '"' + value + '"'; | ||
} | ||
@@ -334,10 +334,2 @@ | ||
writeln('<> a earl:Software, doap:Project;'); | ||
writeln(' doap:name "Turtle";'); | ||
writeln(' dc:bibliographicCitation "[[TURTLE]]";'); | ||
writeln(' earl:generatedBy <' , application , '>;'); | ||
writeln(' earl:testSubjects (<' , application , '>);'); | ||
writeln(' mf:entries (<', testPath, manifest, '>).'); | ||
writeln(); | ||
writeln('<', application, '> a earl:Software, earl:TestSubject, doap:Project;'); | ||
@@ -366,9 +358,2 @@ writeln(' doap:name "node-n3";'); | ||
writeln('<', testPath, manifest, '> a earl:Report, mf:Manifest;'); | ||
writeln(' dc:title "Turtle tests";'); | ||
writeln(' mf:name "Turtle tests";'); | ||
writeln(' mf:entries ('); | ||
tests.forEach(function (test) { writeln(' manifest:', test.id); }); | ||
writeln(' ).'); | ||
tests.forEach(function (test) { | ||
@@ -375,0 +360,0 @@ writeln(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
102705
17
2183