diff options
Diffstat (limited to 'spec/parser.bnf')
| -rw-r--r-- | spec/parser.bnf | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/spec/parser.bnf b/spec/parser.bnf index caa24f3..338dc10 100644 --- a/spec/parser.bnf +++ b/spec/parser.bnf @@ -17,11 +17,11 @@ skip_line : ( ~LF )* LF? ; one_datum : bare_string | clad_datum ; -bare_string : ( '.' | '+' | '-' | DIGIT ) ( bare_str_elt | '.' )* - | bare_str_elt+ +bare_string : ( '.' | '+' | '-' | DIGIT ) ( bare_char | '.' )* + | bare_char+ ; -clad_datum : '\' bare_esc_str +clad_datum : '\' bare_string | '|' pipe_str_elt* '|' | '"' quot_str_elt* '"' | '#' hash_expr @@ -32,16 +32,20 @@ clad_datum : '\' bare_esc_str ; -bare_str_elt : bare_char | '\' bare_esc ; +bare_char : ALPHA | DIGIT | bare_punct ; +bare_punct : '!' | '$' | '%' | '&' | '*' | '+' | '-' | '/' + | '<' | '=' | '>' | '?' | '@' | '^' | '_' | '~' + ; -bare_esc_str : bare_esc bare_str_elt* ; pipe_str_elt : ~( '|' | '\' ) | '\' pipe_esc ; quot_str_elt : ~( '"' | '\' ) | '\' quot_esc ; hash_expr : rune clad_datum? + | rune '\' bare_string + | '\' bare_string | '%' label ( '%' | '=' datum ) | clad_datum ; @@ -51,15 +55,6 @@ list : unit* ( '.' unit )? blank* ; quote_expr : ( "'" | "`" | "," ) datum ; -bare_char : ALPHA | DIGIT | bare_punct ; - -bare_punct : '!' | '$' | '%' | '&' | '*' | '+' | '-' | '/' - | '<' | '=' | '>' | '?' | '@' | '^' | '_' | '~' - ; - -bare_esc : 33...126 ; - - pipe_esc : string_esc | '|' ; quot_esc : string_esc | '"' ; |
