grammar doesn't need the option() construct

This commit is contained in:
Andrew Kelley
2015-11-23 19:19:38 -07:00
parent 4236b85c72
commit 5b663ddbb2
3 changed files with 17 additions and 17 deletions

View File

@@ -141,10 +141,6 @@ struct RuleMany {
RuleNode *child;
};
struct RuleOption {
RuleNode *child;
};
struct RuleOr {
Buf name;
Buf union_field_name;
@@ -171,7 +167,6 @@ enum RuleNodeType {
RuleNodeTypeTuple,
RuleNodeTypeMany,
RuleNodeTypeList,
RuleNodeTypeOption,
RuleNodeTypeOr,
RuleNodeTypeToken,
RuleNodeTypeSubRule,
@@ -185,7 +180,6 @@ struct RuleNode {
RuleTuple tuple;
RuleMany many;
RuleList list;
RuleOption option;
RuleOr _or;
RuleToken token;
RuleSubRule sub_rule;
@@ -403,9 +397,6 @@ static void gen(Gen *g, RuleNode *node, Buf *out_field_name, ParserState *cur_st
case RuleNodeTypeList:
zig_panic("TODO");
break;
case RuleNodeTypeOption:
zig_panic("TODO");
break;
case RuleNodeTypeOr:
{
buf_init_from_buf(out_field_name, &node->_or.union_field_name);