diff options
| author | Karroffel | 2016-10-16 13:20:28 +0200 |
|---|---|---|
| committer | karroffel | 2017-01-11 04:40:28 +0100 |
| commit | e781a7e07ec7388deccd372899ecbea8af7b67f4 (patch) | |
| tree | d3a999554c027d8b443a91c7d9fcc6960228a134 /modules/gdscript/gd_parser.h | |
| parent | d445f0639fa9eccc44f1f9c153108f9e90981077 (diff) | |
| download | godot-e781a7e07ec7388deccd372899ecbea8af7b67f4.tar.gz godot-e781a7e07ec7388deccd372899ecbea8af7b67f4.tar.zst godot-e781a7e07ec7388deccd372899ecbea8af7b67f4.zip | |
Diffstat (limited to 'modules/gdscript/gd_parser.h')
| -rw-r--r-- | modules/gdscript/gd_parser.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/gdscript/gd_parser.h b/modules/gdscript/gd_parser.h index 6ee55b433..d547593a3 100644 --- a/modules/gdscript/gd_parser.h +++ b/modules/gdscript/gd_parser.h @@ -280,7 +280,7 @@ public: }; struct PatternBranchNode : public Node { - PatternNode *pattern; + Vector<PatternNode*> patterns; BlockNode *body; }; @@ -288,7 +288,12 @@ public: Node *val_to_match; Vector<PatternBranchNode*> branches; - BlockNode *compiled_block; + struct CompiledPatternBranch { + Node *compiled_pattern; + BlockNode *body; + }; + + Vector<CompiledPatternBranch> compiled_pattern_branches; }; struct ControlFlowNode : public Node { @@ -487,19 +492,13 @@ private: Node* _parse_and_reduce_expression(Node *p_parent,bool p_static,bool p_reduce_const=false,bool p_allow_assign=false); - // TODO - void _parse_pattern_block(BlockNode *p_block, Vector<PatternBranchNode*> &p_branches, bool p_static); + PatternNode *_parse_pattern(bool p_static); + void _parse_pattern_block(BlockNode *p_block, Vector<PatternBranchNode*> &p_branches, bool p_static); void _transform_match_statment(BlockNode *p_block, MatchNode *p_match_statement); - void _generate_pattern(PatternNode *p_pattern, Node *p_node_to_match, Node *&p_resulting_node, Map<StringName, Node*> &p_bindings); - void _generate_array_pattern(PatternNode *p_array_pattern, Node *p_value_to_match, Node *&p_resulting_node, Map<StringName, Node*> &p_bindings); - void _generate_bind_pattern(PatternNode *p_bind_pattern, Node *p_value_to_match, Map<StringName, Node*> &p_bindings); - void _generate_constant_pattern(PatternNode *p_constant_pattern, Node *p_value_to_match, Node *&p_resulting_node); - void _generate_dict_pattern(PatternNode *p_dict_pattern, Node *p_value_to_match, Node *&p_resulting_node, Map<StringName, Node*> &p_bindings); - void _parse_block(BlockNode *p_block,bool p_static); void _parse_extends(ClassNode *p_class); |
