mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-16 14:40:23 +03:00
Spec for tree-sitter YAML
This commit is contained in:
parent
6fd1fa0b50
commit
53c0aba644
49
packages/language-yaml/spec/fixtures/highlights.yaml
vendored
Normal file
49
packages/language-yaml/spec/fixtures/highlights.yaml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
simplekey:
|
||||
somekey: somevalue
|
||||
# <- entity.name.tag
|
||||
# <- !string.other
|
||||
# ^ punctuation.separator.key-value
|
||||
# ^ !entity.name.tag
|
||||
# ^ string.other
|
||||
"otherkey": "othervalue"
|
||||
# <- punctuation.definition.string.begin
|
||||
# ^ entity.name.tag
|
||||
# ^ !string.quoted.double
|
||||
# ^ !entity.name.tag
|
||||
# ^ string.quoted.double
|
||||
# ^ punctuation.definition.string.end
|
||||
'singlequotes': 'again, single value'
|
||||
# <- punctuation.definition.string.begin
|
||||
# ^ entity.name.tag
|
||||
# ^ !string.quoted.single
|
||||
# ^ punctuation.definition.string.end
|
||||
# ^ !entity.name.tag
|
||||
# ^ string.quoted.single
|
||||
1: no
|
||||
# <- constant.numeric
|
||||
# ^ string.other
|
||||
2: yes
|
||||
# <- constant.numeric
|
||||
# ^ string.other
|
||||
3: [true, false, null, 900]
|
||||
# <- constant.numeric
|
||||
# ^ punctuation.definition.array.begin.bracket.square
|
||||
# ^ constant.language
|
||||
# ^ constant.language
|
||||
# ^ constant.language
|
||||
# ^ constant.numeric
|
||||
# ^ punctuation.definition.array.end.bracket.square
|
||||
date: 2001-12-15T02:59:43.1Z
|
||||
json: {"is": 1, "valid": true}
|
||||
# <- entity.name.tag
|
||||
# <- !string.other
|
||||
# ^ punctuation.definition.object.begin.bracket.curly
|
||||
# ^ punctuation.definition.string.begin
|
||||
# ^ !string.quoted.double
|
||||
# ^ entity.name.tag
|
||||
# ^ punctuation.definition.string.end
|
||||
# ^ punctuation.separator.key-value
|
||||
# ^ constant.numeric
|
||||
# ^ punctuation.separator.comma
|
||||
# ^ constant.language
|
||||
# ^ punctuation.definition.object.end.bracket.curly
|
15
packages/language-yaml/spec/tokens-spec.js
Normal file
15
packages/language-yaml/spec/tokens-spec.js
Normal file
@ -0,0 +1,15 @@
|
||||
/* global runGrammarTests, runFoldsTests */
|
||||
const path = require('path');
|
||||
|
||||
describe('YAML Tree-Sitter Grammar', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await atom.packages.activatePackage('language-yaml');
|
||||
atom.config.set('core.useTreeSitterParsers', true);
|
||||
atom.config.set('core.useExperimentalModernTreeSitter', true);
|
||||
});
|
||||
|
||||
it('tokenizes the editor using modern tree-sitter parser', async () => {
|
||||
await runGrammarTests(path.join(__dirname, 'fixtures', 'highlights.yaml'), /#/)
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user