Comparing version 0.1.2 to 0.1.3
@@ -11,3 +11,3 @@ // **N3Lexer** tokenizes N3 documents. | ||
_number: /^[\-+]?(?:\d+\.?\d*([eE](?:[\-\+])?\d+)|\d+\.\d+|\.\d+|\d+)(?=\s*[\s\.;,)#])/, | ||
_boolean: /^(?:true|false)(?=[\s#])/, | ||
_boolean: /^(?:true|false)(?=[\s#,;.])/, | ||
_punctuation: /^\.(?!\d)|^;|^,|^\[|^\]|^\(|^\)/, // If a digit follows a dot, it is a number, not punctuation. | ||
@@ -135,3 +135,3 @@ _fastString: /^"[^"\\]+"(?=[^"\\])/, | ||
else if (match = this._tripleQuotedString.exec(this._input)) { | ||
unescaped = match[1] || match[2]; | ||
unescaped = match[1] || match[2]; | ||
// Count the newlines and advance line counter. | ||
@@ -173,3 +173,3 @@ this._line += unescaped.split(/\r\n|\r|\n/).length - 1; | ||
// Try to find a prefix. | ||
else if ((this._prevTokenType === '@prefix' || this._prevTokenType === 'PREFIX') && | ||
else if ((this._prevTokenType === '@prefix' || this._prevTokenType === 'PREFIX') && | ||
(match = this._prefix.exec(this._input))) { | ||
@@ -185,3 +185,3 @@ token.type = 'prefix'; | ||
token.type = 'qname'; | ||
token.prefix = match[1] || ''; | ||
token.prefix = match[1] || ''; | ||
token.value = unescaped; | ||
@@ -188,0 +188,0 @@ } |
{ | ||
"name": "n3", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.", | ||
@@ -18,5 +18,5 @@ "author": "Ruben Verborgh <ruben.verborgh@gmail.com>", | ||
"docco": "~0.3.0", | ||
"jshint": "1.1.x", | ||
"request": "~2.9.203", | ||
"vows": "~0.6.0" | ||
"jshint": "~1.1.0", | ||
"request": "~2.22.0", | ||
"vows": ">=0.7.0" | ||
}, | ||
@@ -23,0 +23,0 @@ "scripts": { |
@@ -140,3 +140,3 @@ #!/usr/bin/env node | ||
request.get(testPath + testFile, | ||
function (error, response, body) { callback(error, body || ""); }) | ||
function (error, response, body) { callback(error, body); }) | ||
.pipe(fs.createWriteStream(localFile)); | ||
@@ -143,0 +143,0 @@ }); |
@@ -57,2 +57,14 @@ var N3Parser = require('../lib/n3parser.js'); | ||
'should parse a triple with an integer literal': | ||
shouldParse('<a> <b> 3.', | ||
['a', 'b', '"3"^^<http://www.w3.org/2001/XMLSchema#integer>']), | ||
'should parse a triple with a floating point literal': | ||
shouldParse('<a> <b> 1.3e2.', | ||
['a', 'b', '"1.3e2"^^<http://www.w3.org/2001/XMLSchema#double>']), | ||
'should parse a triple with a boolean literal': | ||
shouldParse('<a> <b> true.', | ||
['a', 'b', '"true"^^<http://www.w3.org/2001/XMLSchema#boolean>']), | ||
'should parse a triple with a literal and a language code': | ||
@@ -59,0 +71,0 @@ shouldParse('<a> <b> "string"@en.', |
103999
2206