diff options
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 9 | ||||
-rw-r--r-- | modules/gdscript/gdscript_compiler.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 5 | ||||
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 2 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 1 | ||||
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 7 |
6 files changed, 26 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index d42fdb1e04..1d26e2148e 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -321,9 +321,11 @@ bool GDScript::instance_has(const Object *p_this) const { bool GDScript::has_source_code() const { return source != ""; } + String GDScript::get_source_code() const { return source; } + void GDScript::set_source_code(const String &p_code) { if (source == p_code) return; @@ -708,6 +710,7 @@ bool GDScript::_get(const StringName &p_name, Variant &r_ret) const { return false; } + bool GDScript::_set(const StringName &p_name, const Variant &p_value) { if (p_name == GDScriptLanguage::get_singleton()->strings._script_source) { set_source_code(p_value); @@ -884,6 +887,7 @@ bool GDScript::has_script_signal(const StringName &p_signal) const { #endif return false; } + void GDScript::get_script_signal_list(List<MethodInfo> *r_signals) const { for (const Map<StringName, Vector<StringName>>::Element *E = _signals.front(); E; E = E->next()) { MethodInfo mi; @@ -1242,6 +1246,7 @@ bool GDScriptInstance::has_method(const StringName &p_method) const { return false; } + Variant GDScriptInstance::call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { GDScript *sptr = script.ptr(); while (sptr) { @@ -1493,13 +1498,16 @@ void GDScriptLanguage::init() { String GDScriptLanguage::get_type() const { return "GDScript"; } + String GDScriptLanguage::get_extension() const { return "gd"; } + Error GDScriptLanguage::execute_file(const String &p_path) { // ?? return OK; } + void GDScriptLanguage::finish() { } @@ -2275,6 +2283,7 @@ void ResourceFormatSaverGDScript::get_recognized_extensions(const RES &p_resourc p_extensions->push_back("gd"); } } + bool ResourceFormatSaverGDScript::recognize(const RES &p_resource) const { return Object::cast_to<GDScript>(*p_resource) != nullptr; } diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index c227d4098c..deb725ea81 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -2115,9 +2115,11 @@ Error GDScriptCompiler::compile(const GDScriptParser *p_parser, GDScript *p_scri String GDScriptCompiler::get_error() const { return error; } + int GDScriptCompiler::get_error_line() const { return err_line; } + int GDScriptCompiler::get_error_column() const { return err_column; } diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index fc6f9b5419..8aa7809347 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -237,6 +237,7 @@ int GDScriptLanguage::debug_get_stack_level_count() const { return _debug_call_stack_pos; } + int GDScriptLanguage::debug_get_stack_level_line(int p_level) const { if (_debug_parse_err_line >= 0) return _debug_parse_err_line; @@ -247,6 +248,7 @@ int GDScriptLanguage::debug_get_stack_level_line(int p_level) const { return *(_call_stack[l].line); } + String GDScriptLanguage::debug_get_stack_level_function(int p_level) const { if (_debug_parse_err_line >= 0) return ""; @@ -255,6 +257,7 @@ String GDScriptLanguage::debug_get_stack_level_function(int p_level) const { int l = _debug_call_stack_pos - p_level - 1; return _call_stack[l].function->get_name(); } + String GDScriptLanguage::debug_get_stack_level_source(int p_level) const { if (_debug_parse_err_line >= 0) return _debug_parse_err_file; @@ -263,6 +266,7 @@ String GDScriptLanguage::debug_get_stack_level_source(int p_level) const { int l = _debug_call_stack_pos - p_level - 1; return _call_stack[l].function->get_source(); } + void GDScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p_locals, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { if (_debug_parse_err_line >= 0) return; @@ -280,6 +284,7 @@ void GDScriptLanguage::debug_get_stack_level_locals(int p_level, List<String> *p p_values->push_back(_call_stack[l].stack[E->get().second]); } } + void GDScriptLanguage::debug_get_stack_level_members(int p_level, List<String> *p_members, List<Variant> *p_values, int p_max_subitems, int p_max_depth) { if (_debug_parse_err_line >= 0) return; diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 5ad8c2d367..aa2ea149f5 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -1566,6 +1566,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a const int *GDScriptFunction::get_code() const { return _code_ptr; } + int GDScriptFunction::get_code_size() const { return _code_size; } @@ -1583,6 +1584,7 @@ StringName GDScriptFunction::get_global_name(int p_idx) const { int GDScriptFunction::get_default_argument_count() const { return _default_arg_count; } + int GDScriptFunction::get_default_argument_addr(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, default_arguments.size(), -1); return default_arguments[p_idx]; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 1c07efaa3a..09f5b13e22 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -8466,6 +8466,7 @@ String GDScriptParser::get_error() const { int GDScriptParser::get_error_line() const { return error_line; } + int GDScriptParser::get_error_column() const { return error_column; } diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index f532a6b797..9854b8d185 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -387,6 +387,7 @@ void GDScriptTokenizerText::_make_token(Token p_type) { tk_rb_pos = (tk_rb_pos + 1) % TK_RB_SIZE; } + void GDScriptTokenizerText::_make_identifier(const StringName &p_identifier) { TokenData &tk = tk_rb[tk_rb_pos]; @@ -408,6 +409,7 @@ void GDScriptTokenizerText::_make_built_in_func(GDScriptFunctions::Function p_fu tk_rb_pos = (tk_rb_pos + 1) % TK_RB_SIZE; } + void GDScriptTokenizerText::_make_constant(const Variant &p_constant) { TokenData &tk = tk_rb[tk_rb_pos]; @@ -1445,6 +1447,7 @@ int GDScriptTokenizerBuffer::get_token_line(int p_offset) const { uint32_t l = lines.getv(pos); return l & TOKEN_LINE_MASK; } + int GDScriptTokenizerBuffer::get_token_column(int p_offset) const { int offset = token + p_offset; int pos = lines.find_nearest(offset); @@ -1456,11 +1459,13 @@ int GDScriptTokenizerBuffer::get_token_column(int p_offset) const { uint32_t l = lines.getv(pos); return l >> TOKEN_LINE_BITS; } + int GDScriptTokenizerBuffer::get_token_line_indent(int p_offset) const { int offset = token + p_offset; ERR_FAIL_INDEX_V(offset, tokens.size(), 0); return tokens[offset] >> TOKEN_BITS; } + const Variant &GDScriptTokenizerBuffer::get_token_constant(int p_offset) const { int offset = token + p_offset; ERR_FAIL_INDEX_V(offset, tokens.size(), nil); @@ -1468,6 +1473,7 @@ const Variant &GDScriptTokenizerBuffer::get_token_constant(int p_offset) const { ERR_FAIL_UNSIGNED_INDEX_V(constant, (uint32_t)constants.size(), nil); return constants[constant]; } + String GDScriptTokenizerBuffer::get_token_error(int p_offset) const { ERR_FAIL_V(String()); } @@ -1476,6 +1482,7 @@ void GDScriptTokenizerBuffer::advance(int p_amount) { ERR_FAIL_INDEX(p_amount + token, tokens.size()); token += p_amount; } + GDScriptTokenizerBuffer::GDScriptTokenizerBuffer() { token = 0; } |