diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-08-08 15:06:46 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-08-08 15:06:46 -0700 |
commit | 8e07e55c1f928ed8a0da6360e00b2b8139594a63 (patch) | |
tree | 2d1496cd9a416bf8e5a29d8b85c092109d651421 /parse_productions.cpp | |
parent | 6a6593335d2311432ca5d05d2081cb30c4fec34f (diff) |
More work on new parser
Diffstat (limited to 'parse_productions.cpp')
-rw-r--r-- | parse_productions.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/parse_productions.cpp b/parse_productions.cpp index 61f7636d..b5efa11c 100644 --- a/parse_productions.cpp +++ b/parse_productions.cpp @@ -135,14 +135,12 @@ RESOLVE(statement) return 2; case parse_keyword_else: - //symbol_stack_pop(); return NO_PRODUCTION; case parse_keyword_switch: return 3; case parse_keyword_end: - PARSER_DIE(); //todo return NO_PRODUCTION; // 'in' is only special within a for_header @@ -378,7 +376,7 @@ RESOLVE(arguments_or_redirections_list) PRODUCTIONS(argument_or_redirection) = { - {parse_token_type_string}, + {symbol_argument}, {parse_token_type_redirection} }; RESOLVE(argument_or_redirection) @@ -394,6 +392,18 @@ RESOLVE(argument_or_redirection) } } +PRODUCTIONS(argument) = +{ + {parse_token_type_string} +}; +RESOLVE_ONLY(argument) + +PRODUCTIONS(redirection) = +{ + {parse_token_type_redirection} +}; +RESOLVE_ONLY(redirection) + PRODUCTIONS(optional_background) = { {}, @@ -449,6 +459,8 @@ const production_t *parse_productions::production_for_token(parse_token_type_t n TEST(plain_statement) TEST(arguments_or_redirections_list) TEST(argument_or_redirection) + TEST(argument) + TEST(redirection) TEST(optional_background) case parse_token_type_string: @@ -461,6 +473,14 @@ const production_t *parse_productions::production_for_token(parse_token_type_t n PARSER_DIE(); break; + case parse_special_type_parse_error: + case parse_special_type_tokenizer_error: + case parse_special_type_comment: + fprintf(stderr, "Special type %ls passed to %s\n", token_type_description(node_type).c_str(), __FUNCTION__); + PARSER_DIE(); + break; + + case token_type_invalid: fprintf(stderr, "token_type_invalid passed to %s\n", __FUNCTION__); PARSER_DIE(); |