Comparing version 0.7.3 to 0.8.0
@@ -140,2 +140,3 @@ ;(function (clarinet) { | ||
parser.unicodeS = null; | ||
parser.depth = 0; | ||
emit(parser, "onready"); | ||
@@ -307,3 +308,5 @@ } | ||
function end(parser) { | ||
if (parser.state !== S.VALUE) error(parser, "Unexpected end"); | ||
if (parser.state !== S.VALUE || parser.depth !== 0) | ||
error(parser, "Unexpected end"); | ||
closeValue(parser); | ||
@@ -359,3 +362,5 @@ parser.c = ""; | ||
emit(parser, 'onopenobject'); | ||
this.depth++; | ||
emit(parser, 'oncloseobject'); | ||
this.depth--; | ||
parser.state = parser.stack.pop() || S.VALUE; | ||
@@ -377,6 +382,8 @@ continue; | ||
closeValue(parser, 'onopenobject'); | ||
this.depth++; | ||
} else closeValue(parser, 'onkey'); | ||
parser.state = S.VALUE; | ||
} else if (c==='}') { | ||
emitNode(parser, 'oncloseobject'); | ||
emitNode(parser, 'oncloseobject'); | ||
this.depth--; | ||
parser.state = parser.stack.pop() || S.VALUE; | ||
@@ -396,5 +403,7 @@ } else if(c===',') { | ||
emit(parser, 'onopenarray'); | ||
this.depth++; | ||
parser.state = S.VALUE; | ||
if(c === ']') { | ||
emit(parser, 'onclosearray'); | ||
this.depth--; | ||
parser.state = parser.stack.pop() || S.VALUE; | ||
@@ -430,2 +439,3 @@ continue; | ||
emitNode(parser, 'onclosearray'); | ||
this.depth--; | ||
parser.state = parser.stack.pop() || S.VALUE; | ||
@@ -432,0 +442,0 @@ } else if (c === '\r' || c === '\n' || c === ' ' || c === '\t') |
@@ -1,33 +0,45 @@ | ||
{ "name" : "clarinet" | ||
, "description" : | ||
"SAX based evented streaming JSON parser in JavaScript (browser and node)" | ||
, "author" : "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com/)" | ||
, "contributors": | ||
[ "Jann Horn (https://github.com/thejh)" | ||
, "Justin Makeig <jmpublic+github@makeig.com> (http://www.audiblepop.com)" | ||
, "Roly Fentanes (http://about.me/roly)" | ||
, "John Lancaster (http://jlank.com)" | ||
] | ||
, "version" : "0.7.3" | ||
, "main" : "./clarinet.js" | ||
, "homepage" : "https://github.com/dscape/clarinet" | ||
, "repository" : | ||
{ "type" : "git" | ||
, "url" : "http://github.com/dscape/clarinet.git" | ||
{ | ||
"name": "clarinet", | ||
"description": "SAX based evented streaming JSON parser in JavaScript (browser and node)", | ||
"author": "Nuno Job <nunojobpinto@gmail.com> (http://nunojob.com/)", | ||
"contributors": [ | ||
"Jann Horn (https://github.com/thejh)", | ||
"Justin Makeig <jmpublic+github@makeig.com> (http://www.audiblepop.com)", | ||
"Roly Fentanes (http://about.me/roly)", | ||
"John Lancaster (http://jlank.com)" | ||
], | ||
"version": "0.8.0", | ||
"main": "./clarinet.js", | ||
"homepage": "https://github.com/dscape/clarinet", | ||
"repository": { | ||
"type": "git", | ||
"url": "http://github.com/dscape/clarinet.git" | ||
}, | ||
"bugs": "http://github.com/dscape/clarinet/issues", | ||
"keywords": [ | ||
"sax", | ||
"json", | ||
"parser", | ||
"stream", | ||
"streaming", | ||
"event", | ||
"events", | ||
"emitter", | ||
"async", | ||
"streamer", | ||
"browser" | ||
], | ||
"devDependencies": { | ||
"mocha": "1.3.x", | ||
"should": "1.0.x", | ||
"underscore": "1.2.3" | ||
}, | ||
"scripts": { | ||
"test": "./node_modules/mocha/bin/mocha -r should -t 10000 -s 2000 test/clarinet.js test/npm.js" | ||
}, | ||
"engines": { | ||
"node": ">=0.3.6", | ||
"firefox": ">=0.8.0", | ||
"chrome": ">=16.0.912" | ||
} | ||
, "bugs" : "http://github.com/dscape/clarinet/issues" | ||
, "keywords" : | ||
["sax", "json", "parser", "stream", "streaming", "event" | ||
, "events", "emitter", "async", "streamer", "browser"] | ||
, "devDependencies" : | ||
{ "mocha": "1.3.x", "should": "1.0.x", "underscore": "1.2.3" } | ||
, "scripts" : | ||
{ "test" : | ||
"./node_modules/mocha/bin/mocha -r should -t 10000 -s 2000 test/clarinet.js test/npm.js" | ||
} | ||
, "engines" : | ||
{ "node" : ">=0.3.6" | ||
, "firefox" : ">=0.8.0" | ||
, "chrome" : ">=16.0.912" | ||
} | ||
} |
@@ -633,2 +633,28 @@ if (!clarinet) { // node | ||
} | ||
, incomplete_json_terminates_ending_in_number : | ||
{ text : '[[1,2,3],[4,5' | ||
, events : | ||
[ ["openarray" , undefined] | ||
, ["openarray" , undefined] | ||
, ["value" , 1] | ||
, ["value" , 2] | ||
, ["value" , 3] | ||
, ["closearray" , undefined] | ||
, ["openarray" , undefined] | ||
, ["value" , 4] | ||
, ["error" , undefined] | ||
] | ||
} | ||
, incomplete_json_terminates_ending_in_comma : | ||
{ text : '[[1,2,3],' | ||
, events : | ||
[ ["openarray" , undefined] | ||
, ["openarray" , undefined] | ||
, ["value" , 1] | ||
, ["value" , 2] | ||
, ["value" , 3] | ||
, ["closearray" , undefined] | ||
, ["error" , undefined] | ||
] | ||
} | ||
, json_org : | ||
@@ -635,0 +661,0 @@ { text : |
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
39446069
7749