mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Move inheritance resolution to the parser
This commit is contained in:
parent
8aab9a06d4
commit
b7a00aead0
5 changed files with 396 additions and 235 deletions
|
@ -31,12 +31,16 @@
|
|||
#ifndef GDSCRIPT_COMPILER_H
|
||||
#define GDSCRIPT_COMPILER_H
|
||||
|
||||
#include "core/set.h"
|
||||
#include "gdscript.h"
|
||||
#include "gdscript_parser.h"
|
||||
|
||||
class GDScriptCompiler {
|
||||
|
||||
const GDScriptParser *parser;
|
||||
Map<StringName, Ref<GDScript> > class_map;
|
||||
Set<StringName> parsed_classes;
|
||||
Set<StringName> parsing_classes;
|
||||
struct CodeGen {
|
||||
|
||||
GDScript *script;
|
||||
|
@ -142,7 +146,9 @@ class GDScriptCompiler {
|
|||
int _parse_expression(CodeGen &codegen, const GDScriptParser::Node *p_expression, int p_stack_level, bool p_root = false, bool p_initializer = false);
|
||||
Error _parse_block(CodeGen &codegen, const GDScriptParser::BlockNode *p_block, int p_stack_level = 0, int p_break_addr = -1, int p_continue_addr = -1);
|
||||
Error _parse_function(GDScript *p_script, const GDScriptParser::ClassNode *p_class, const GDScriptParser::FunctionNode *p_func, bool p_for_ready = false);
|
||||
Error _parse_class(GDScript *p_script, GDScript *p_owner, const GDScriptParser::ClassNode *p_class, bool p_keep_state);
|
||||
Error _parse_class_level(GDScript *p_script, GDScript *p_owner, const GDScriptParser::ClassNode *p_class, bool p_keep_state);
|
||||
Error _parse_class_blocks(GDScript *p_script, const GDScriptParser::ClassNode *p_class, bool p_keep_state);
|
||||
void _make_scripts(const GDScript *p_script, const GDScriptParser::ClassNode *p_class, bool p_keep_state);
|
||||
int err_line;
|
||||
int err_column;
|
||||
StringName source;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue