Stop parsing names at comment marker

This commit is contained in:
Midgard 2020-02-29 22:26:17 +01:00
parent a860998858
commit c52ba3b6d9
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -29,8 +29,8 @@ 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 '}')} ] [ s '::' {s ('{' tags+:identifier '}')} ]
[ [ s '::' ~ ] s price:price ] [ [ s '::' ~ ] s price:price ]
; ;
@ -78,7 +78,7 @@ n = '\n' {{'\t'} '\n'} ;
@name @name
identifier = /[a-z0-9_-]+/ ; identifier = /[a-z0-9_-]+/ ;
string = /[^\n]+/ ; string = /[^\n#]+/ ;
choice_type = 'single_choice' | 'multi_choice' ; choice_type = 'single_choice' | 'multi_choice' ;
int = /[0-9]+/ ; int = /[0-9]+/ ;