Skip to content

Commit

Permalink
fix: multi word descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrossinek committed Nov 9, 2021
1 parent 20538ef commit ab7f37f
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 180 deletions.
16 changes: 2 additions & 14 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@ module.exports = grammar({

keyword: $ => /[^\s:]+/,

description: $ => seq(
$._word,
optional(
repeat(
seq(
$._space,
$._word
)
)
)
),
description: $ => /[^\n]+/,

_separator: $ => ":",

_space: $ => /\s+/,

_word: $ => /\S+/
_space: $ => /\s+/

}
});
37 changes: 2 additions & 35 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,8 @@
"value": "[^\\s:]+"
},
"description": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_word"
},
{
"type": "CHOICE",
"members": [
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "_space"
},
{
"type": "SYMBOL",
"name": "_word"
}
]
}
},
{
"type": "BLANK"
}
]
}
]
"type": "PATTERN",
"value": "[^\\n]+"
},
"_separator": {
"type": "STRING",
Expand All @@ -73,10 +44,6 @@
"_space": {
"type": "PATTERN",
"value": "\\s+"
},
"_word": {
"type": "PATTERN",
"value": "\\S+"
}
},
"extras": [
Expand Down
9 changes: 4 additions & 5 deletions src/node-types.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[
{
"type": "description",
"named": true,
"fields": {}
},
{
"type": "metadata",
"named": true,
Expand Down Expand Up @@ -38,6 +33,10 @@
]
}
},
{
"type": "description",
"named": true
},
{
"type": "keyword",
"named": true
Expand Down
Loading

0 comments on commit ab7f37f

Please sign in to comment.