jsonc-parser
Advanced tools
Comparing version 0.3.1 to 0.4.0
@@ -8,2 +8,3 @@ export declare enum ScanError { | ||
InvalidEscapeCharacter = 5, | ||
InvalidCharacter = 6, | ||
} | ||
@@ -10,0 +11,0 @@ export declare enum SyntaxKind { |
@@ -25,2 +25,3 @@ (function (factory) { | ||
ScanError[ScanError["InvalidEscapeCharacter"] = 5] = "InvalidEscapeCharacter"; | ||
ScanError[ScanError["InvalidCharacter"] = 6] = "InvalidCharacter"; | ||
})(ScanError = exports.ScanError || (exports.ScanError = {})); | ||
@@ -191,6 +192,11 @@ var SyntaxKind; | ||
} | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
if (ch >= 0 && ch <= 0x1f) { | ||
if (isLineBreak(ch)) { | ||
result += text.substring(start, pos); | ||
scanError = ScanError.UnexpectedEndOfString; | ||
break; | ||
} | ||
else { | ||
scanError = ScanError.InvalidCharacter; | ||
} | ||
} | ||
@@ -479,3 +485,3 @@ pos++; | ||
isAtPropertyKey = position > offset; | ||
segments.push(''); // push a placeholder (will be replaced or removed) | ||
segments.push(''); // push a placeholder (will be replaced) | ||
}, | ||
@@ -550,5 +556,2 @@ onObjectProperty: function (name, offset, length) { | ||
} | ||
if (segments[segments.length - 1] === '') { | ||
segments.pop(); | ||
} | ||
return { | ||
@@ -555,0 +558,0 @@ path: segments, |
{ | ||
"name": "jsonc-parser", | ||
"version": "0.3.1", | ||
"version": "0.4.0", | ||
"description": "Scanner and parser for JSON with comments.", | ||
@@ -16,17 +16,17 @@ "main": "./lib/main.js", | ||
}, | ||
"devDependencies": { | ||
"mocha": "^2.4.5", | ||
"typescript": "^2.1.5", | ||
"devDependencies": { | ||
"mocha": "^2.4.5", | ||
"typescript": "^2.1.5", | ||
"@types/node": "^6.0.46", | ||
"@types/mocha": "^2.2.32" | ||
}, | ||
"dependencies": { | ||
"vscode-nls": "^2.0.2" | ||
}, | ||
"scripts": { | ||
"prepublish": "tsc -p ./src", | ||
"compile": "tsc -p ./src", | ||
"watch": "tsc -w -p ./src", | ||
}, | ||
"dependencies": { | ||
"vscode-nls": "^2.0.2" | ||
}, | ||
"scripts": { | ||
"prepublish": "tsc -p ./src", | ||
"compile": "tsc -p ./src", | ||
"watch": "tsc -w -p ./src", | ||
"test": "tsc -p ./src && mocha" | ||
} | ||
} | ||
} |
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
57172
1112