HLDS: change :: to double space and require it
Require double space before tags and price, like in the plain text accounting format of ledger. This makes it easier to differentiate between prices mentioned in descriptions and the price for the dish.
This commit is contained in:
parent
00cdc587b0
commit
58d270e582
4 changed files with 14 additions and 15 deletions
|
@ -29,10 +29,12 @@ location = >location_header items:{ block } ;
|
||||||
|
|
||||||
|
|
||||||
attributes =
|
attributes =
|
||||||
name:/[^\n#]*?(?= +-- | +:: | +€ | *\n| *#)/
|
name:/[^\n#]*?(?= +-- | | *\n| *#)/
|
||||||
[ s '--' ~ s description:/[^\n#]*?(?= +:: | +€ | *\n| *#)/ ]
|
[ s '--' ~ s description:/[^\n#]*?(?= | *\n| *#)/ ]
|
||||||
[ s '::' {s ('{' tags+:identifier '}')} ]
|
[ / {2,}/ ~
|
||||||
[ [ s '::' ~ ] s price:price ]
|
[ {[ s ] ('{' tags+:identifier '}')} / +|$/ ]
|
||||||
|
[ price:price ]
|
||||||
|
]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +75,7 @@ indent_choice_block =
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
s = / +/ ;
|
s = / +/ ;
|
||||||
n = '\n' {{'\t'} '\n'} ;
|
n = '\n' {{'\t'} '\n'} ;
|
||||||
|
|
||||||
@name
|
@name
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
setlocal noexpandtab
|
setlocal noexpandtab
|
||||||
|
setlocal softtabstop=0
|
||||||
|
|
|
@ -25,8 +25,9 @@ syn keyword hldsChoiceType single_choice multi_choice nextgroup=hldsBlockIdAf
|
||||||
syn match hldsBlockId "^[a-z0-9_-]\+: "
|
syn match hldsBlockId "^[a-z0-9_-]\+: "
|
||||||
syn match hldsBlockIdAftrKywrd "[a-z0-9_-]\+: " contained
|
syn match hldsBlockIdAftrKywrd "[a-z0-9_-]\+: " contained
|
||||||
|
|
||||||
syn match hldsTag " {[a-z0-9_-]\+}"
|
syn match _doubleSpace " \+" nextgroup=hldsTag,hldsPrice
|
||||||
syn match hldsPrice "€ *[0-9]\+\(\.[0-9]\+\|\)"
|
syn match hldsTag "{[a-z0-9_-]\+}\( \|$\)" contained nextgroup=hldsTag,hldsPrice
|
||||||
|
syn match hldsPrice "€ *[0-9]\+\(\.[0-9]\+\|\)\( \|$\)" contained
|
||||||
|
|
||||||
syn match hldsComment "#.*$" contains=hldsTodo,@Spell
|
syn match hldsComment "#.*$" contains=hldsTodo,@Spell
|
||||||
syn keyword hldsTodo FIXME NOTE NOTES TODO XXX contained
|
syn keyword hldsTodo FIXME NOTE NOTES TODO XXX contained
|
||||||
|
|
|
@ -33,13 +33,8 @@
|
||||||
"tags": {
|
"tags": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "(::)\\s*({[a-zA-Z-_]*}\\s*)*",
|
"match": " +( +{[a-zA-Z-_]*})*",
|
||||||
"name": "markup.italic",
|
"name": "markup.italic"
|
||||||
"captures": {
|
|
||||||
"1": {
|
|
||||||
"name": "markup.bold"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue