How to use the jsonc-parser.ParseErrorCode function in jsonc-parser

To help you get started, we’ve selected a few jsonc-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
return 'close bracket expected'
        case jsonParser.ParseErrorCode.ColonExpected:
            return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
            return 'unexpected end of number'
        case jsonParser.ParseErrorCode.UnexpectedEndOfString:
            return 'unexpected end of string'
        case jsonParser.ParseErrorCode.ValueExpected:
            return 'value expected'
        // By omitting the default case, we force the compiler to yell at us
        // if any enum members are added/removed/changed.
    }
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
            return 'unexpected end of number'
        case jsonParser.ParseErrorCode.UnexpectedEndOfString:
            return 'unexpected end of string'
        case jsonParser.ParseErrorCode.ValueExpected:
            return 'value expected'
        // By omitting the default case, we force the compiler to yell at us
        // if any enum members are added/removed/changed.
    }
}
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
            return 'unexpected end of number'
        case jsonParser.ParseErrorCode.UnexpectedEndOfString:
            return 'unexpected end of string'
        case jsonParser.ParseErrorCode.ValueExpected:
            return 'value expected'
        // By omitting the default case, we force the compiler to yell at us
        // if any enum members are added/removed/changed.
    }
}
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
            return 'unexpected end of number'
        case jsonParser.ParseErrorCode.UnexpectedEndOfString:
            return 'unexpected end of string'
        case jsonParser.ParseErrorCode.ValueExpected:
            return 'value expected'
        // By omitting the default case, we force the compiler to yell at us
        // if any enum members are added/removed/changed.
    }
}
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
function getParseErrorDescription(code: jsonParser.ParseErrorCode): string {
    switch (code) {
        case jsonParser.ParseErrorCode.CloseBraceExpected:
            return 'close brace expected'
        case jsonParser.ParseErrorCode.CloseBracketExpected:
            return 'close bracket expected'
        case jsonParser.ParseErrorCode.ColonExpected:
            return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
function getParseErrorDescription(code: jsonParser.ParseErrorCode): string {
    switch (code) {
        case jsonParser.ParseErrorCode.CloseBraceExpected:
            return 'close brace expected'
        case jsonParser.ParseErrorCode.CloseBracketExpected:
            return 'close bracket expected'
        case jsonParser.ParseErrorCode.ColonExpected:
            return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
function getParseErrorDescription(code: jsonParser.ParseErrorCode): string {
    switch (code) {
        case jsonParser.ParseErrorCode.CloseBraceExpected:
            return 'close brace expected'
        case jsonParser.ParseErrorCode.CloseBracketExpected:
            return 'close bracket expected'
        case jsonParser.ParseErrorCode.ColonExpected:
            return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
github aws / aws-toolkit-vscode / src / lambda / config / templates.ts View on Github external
switch (code) {
        case jsonParser.ParseErrorCode.CloseBraceExpected:
            return 'close brace expected'
        case jsonParser.ParseErrorCode.CloseBracketExpected:
            return 'close bracket expected'
        case jsonParser.ParseErrorCode.ColonExpected:
            return 'colon expected'
        case jsonParser.ParseErrorCode.CommaExpected:
            return 'command expected'
        case jsonParser.ParseErrorCode.EndOfFileExpected:
            return 'end of file expected'
        case jsonParser.ParseErrorCode.InvalidCharacter:
            return 'invalid character'
        case jsonParser.ParseErrorCode.InvalidCommentToken:
            return 'invalid comment token'
        case jsonParser.ParseErrorCode.InvalidEscapeCharacter:
            return 'invalid escape character'
        case jsonParser.ParseErrorCode.InvalidNumberFormat:
            return 'invalid number format'
        case jsonParser.ParseErrorCode.InvalidSymbol:
            return 'invalid symbol'
        case jsonParser.ParseErrorCode.InvalidUnicode:
            return 'invalid unicode'
        case jsonParser.ParseErrorCode.PropertyNameExpected:
            return 'property name expected'
        case jsonParser.ParseErrorCode.UnexpectedEndOfComment:
            return 'unexpected end of comment'
        case jsonParser.ParseErrorCode.UnexpectedEndOfNumber:
            return 'unexpected end of number'
        case jsonParser.ParseErrorCode.UnexpectedEndOfString:
            return 'unexpected end of string'
        case jsonParser.ParseErrorCode.ValueExpected:
github threadheap / serverless-ide-vscode / packages / language-server / src / language-service / services / jsonSchema / index.ts View on Github external
return localize("error.valueExpected", "Value expected")
		case Json.ParseErrorCode.ColonExpected:
			return localize("error.colonExpected", "Colon expected")
		case Json.ParseErrorCode.CommaExpected:
			return localize("error.commaExpected", "Comma expected")
		case Json.ParseErrorCode.CloseBraceExpected:
			return localize(
				"error.closeBraceExpected",
				"Closing brace expected"
			)
		case Json.ParseErrorCode.CloseBracketExpected:
			return localize(
				"error.closeBracketExpected",
				"Closing bracket expected"
			)
		case Json.ParseErrorCode.EndOfFileExpected:
			return localize("error.endOfFileExpected", "End of file expected")
		default:
			return ""
	}
}
github eclipse-theia / theia / packages / keymaps / src / browser / keymaps-parser.ts View on Github external
protected printParseErrorCode(code: number | undefined) {
        switch (code) {
            case parser.ParseErrorCode.InvalidSymbol: return 'InvalidSymbol';
            case parser.ParseErrorCode.InvalidNumberFormat: return 'InvalidNumberFormat';
            case parser.ParseErrorCode.PropertyNameExpected: return 'PropertyNameExpected';
            case parser.ParseErrorCode.ValueExpected: return 'ValueExpected';
            case parser.ParseErrorCode.ColonExpected: return 'ColonExpected';
            case parser.ParseErrorCode.CommaExpected: return 'CommaExpected';
            case parser.ParseErrorCode.CloseBraceExpected: return 'CloseBraceExpected';
            case parser.ParseErrorCode.CloseBracketExpected: return 'CloseBracketExpected';
            case parser.ParseErrorCode.EndOfFileExpected: return 'EndOfFileExpected';
            case parser.ParseErrorCode.InvalidCommentToken: return 'InvalidCommentToken';
            case parser.ParseErrorCode.UnexpectedEndOfComment: return 'UnexpectedEndOfComment';
            case parser.ParseErrorCode.UnexpectedEndOfString: return 'UnexpectedEndOfString';
            case parser.ParseErrorCode.UnexpectedEndOfNumber: return 'UnexpectedEndOfNumber';
            case parser.ParseErrorCode.InvalidUnicode: return 'InvalidUnicode';
            case parser.ParseErrorCode.InvalidEscapeCharacter: return 'InvalidEscapeCharacter';
            case parser.ParseErrorCode.InvalidCharacter: return 'InvalidCharacter';
        }
        return '';
    }