Merge pull request #48 from TiagoDanin-Forks/StringYAML

New rule for non-teminated string in yaml
This commit is contained in:
Alexandru Dima 2018-10-17 10:50:16 +02:00 committed by GitHub
commit 8d039c9816
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -145,6 +145,15 @@ testTokenization('yaml', [
}]
}],
//String
[{
line: '\'\'\'',
tokens: [
{ startIndex: 0, type: 'string.yaml' },
{ startIndex: 2, type: 'string.invalid.yaml' },
]
}],
// Block Scalar
[{
line: '>',

View file

@ -189,6 +189,8 @@ export const language = <ILanguage>{
// Start Flow Scalars (quoted strings)
flowScalars: [
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/'([^'\\]|\\.)*$/, 'string.invalid'],
[/'[^']*'/, 'string'],
[/"/, 'string', '@doubleQuotedString']
],
@ -197,7 +199,7 @@ export const language = <ILanguage>{
[/[^\\"]+/, 'string'],
[/@escapes/, 'string.escape'],
[/\\./, 'string.escape.invalid'],
[/"/, 'string', '@pop']
[/"/, 'string', '@pop']
],
// Start Block Scalar