Skip to content
This repository has been archived by the owner on Nov 5, 2021. It is now read-only.

Commit

Permalink
New rule for non-teminated string in yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoDanin committed Oct 3, 2018
1 parent 66b5497 commit c59dd6a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/yaml/yaml.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ testTokenization('yaml', [
}]
}],

//String
[{
line: '\'\'\'',
tokens: [
{ startIndex: 0, type: 'string.yaml' },
{ startIndex: 2, type: 'string.invalid.yaml' },
]
}],

// Block Scalar
[{
line: '>',
Expand Down
2 changes: 2 additions & 0 deletions src/yaml/yaml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export const language = <ILanguage>{

// Start Flow Scalars (quoted strings)
flowScalars: [
[/"([^"\\]|\\.)*$/, 'string.invalid'],
[/'([^'\\]|\\.)*$/, 'string.invalid'],
[/"/, 'string', '@string."'],
[/'/, 'string', '@string.\'']
],
Expand Down

0 comments on commit c59dd6a

Please sign in to comment.