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
a1a68a3fd6
commit
d0699b3716
4 changed files with 14 additions and 15 deletions
|
@ -29,10 +29,12 @@ location = >location_header items:{ block } ;
|
|||
|
||||
|
||||
attributes =
|
||||
name:/[^\n#]*?(?= +-- | +:: | +€ | *\n| *#)/
|
||||
[ s '--' ~ s description:/[^\n#]*?(?= +:: | +€ | *\n| *#)/ ]
|
||||
[ s '::' {s ('{' tags+:identifier '}')} ]
|
||||
[ [ s '::' ~ ] s price:price ]
|
||||
name:/[^\n#]*?(?= +-- | | *\n| *#)/
|
||||
[ s '--' ~ s description:/[^\n#]*?(?= | *\n| *#)/ ]
|
||||
[ / {2,}/ ~
|
||||
[ {[ s ] ('{' tags+:identifier '}')} / +|$/ ]
|
||||
[ price:price ]
|
||||
]
|
||||
;
|
||||
|
||||
|
||||
|
@ -73,7 +75,7 @@ indent_choice_block =
|
|||
;
|
||||
|
||||
|
||||
s = / +/ ;
|
||||
s = / +/ ;
|
||||
n = '\n' {{'\t'} '\n'} ;
|
||||
|
||||
@name
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
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 hldsBlockIdAftrKywrd "[a-z0-9_-]\+: " contained
|
||||
|
||||
syn match hldsTag " {[a-z0-9_-]\+}"
|
||||
syn match hldsPrice "€ *[0-9]\+\(\.[0-9]\+\|\)"
|
||||
syn match _doubleSpace " \+" nextgroup=hldsTag,hldsPrice
|
||||
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 keyword hldsTodo FIXME NOTE NOTES TODO XXX contained
|
||||
|
|
|
@ -33,13 +33,8 @@
|
|||
"tags": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(::)\\s*({[a-zA-Z-_]*}\\s*)*",
|
||||
"name": "markup.italic",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "markup.bold"
|
||||
}
|
||||
}
|
||||
"match": " +( +{[a-zA-Z-_]*})*",
|
||||
"name": "markup.italic"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -94,4 +89,4 @@
|
|||
}
|
||||
},
|
||||
"scopeName": "source.hlds"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue