New rule for non-teminated string in yaml

This commit is contained in:
TiagoDanin 2018-10-03 14:11:22 -03:00
parent 66b5497f3c
commit c59dd6a01e
No known key found for this signature in database
GPG key ID: D6EA04D1246CFE9B
2 changed files with 11 additions and 0 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

@ -202,6 +202,8 @@ export const language = <ILanguage>{
// Start Flow Scalars (quoted strings)
flowScalars: [
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/'([^'\\]|\\.)*$/, 'string.invalid'],
[/"/, 'string', '@string."'],
[/'/, 'string', '@string.\'']
],