mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
committed by
Rémi Verschelde
parent
830947feaf
commit
424a104666
@@ -776,7 +776,7 @@ int GDCompiler::_parse_expression(CodeGen& codegen,const GDParser::Node *p_expre
|
||||
|
||||
if (named) {
|
||||
|
||||
key_idx = codegen.get_name_map_pos(static_cast<const GDParser::IdentifierNode*>(E->get()->arguments[1])->name);
|
||||
key_idx = codegen.get_name_map_pos(static_cast<const GDParser::IdentifierNode*>(E->get()->arguments[1])->name);
|
||||
//printf("named key %x\n",key_idx);
|
||||
|
||||
} else {
|
||||
@@ -1567,7 +1567,7 @@ Error GDCompiler::_parse_class(GDScript *p_script,GDScript *p_owner,const GDPars
|
||||
GDScript::MemberInfo minfo;
|
||||
minfo.index = p_script->member_indices.size();
|
||||
minfo.setter = p_class->variables[i].setter;
|
||||
minfo.getter = p_class->variables[i].getter;
|
||||
minfo.getter = p_class->variables[i].getter;
|
||||
p_script->member_indices[name]=minfo;
|
||||
p_script->members.insert(name);
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class GDCompiler {
|
||||
|
||||
List< Map<StringName,int> > stack_id_stack;
|
||||
Map<StringName,int> stack_identifiers;
|
||||
|
||||
|
||||
List<GDFunction::StackDebug> stack_debug;
|
||||
List< Map<StringName,int> > block_identifier_stack;
|
||||
Map<StringName,int> block_identifiers;
|
||||
@@ -65,7 +65,7 @@ class GDCompiler {
|
||||
void push_stack_identifiers() {
|
||||
stack_id_stack.push_back( stack_identifiers );
|
||||
if (debug_stack) {
|
||||
|
||||
|
||||
block_identifier_stack.push_back(block_identifiers);
|
||||
block_identifiers.clear();
|
||||
}
|
||||
@@ -74,10 +74,10 @@ class GDCompiler {
|
||||
void pop_stack_identifiers() {
|
||||
stack_identifiers = stack_id_stack.back()->get();
|
||||
stack_id_stack.pop_back();
|
||||
|
||||
|
||||
if (debug_stack) {
|
||||
for (Map<StringName,int>::Element *E=block_identifiers.front();E;E=E->next()) {
|
||||
|
||||
|
||||
GDFunction::StackDebug sd;
|
||||
sd.added=false;
|
||||
sd.identifier=E->key();
|
||||
|
||||
@@ -912,7 +912,7 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
|
||||
default: valid=false; break;
|
||||
}
|
||||
|
||||
if (valid) {
|
||||
if (valid) {
|
||||
e.is_op=true;
|
||||
e.op=op;
|
||||
expression.push_back(e);
|
||||
|
||||
@@ -1510,7 +1510,7 @@ Variant GDScript::_new(const Variant** p_args,int p_argcount,Variant::CallError&
|
||||
return Variant();
|
||||
}
|
||||
|
||||
if (ref.is_valid()) {
|
||||
if (ref.is_valid()) {
|
||||
return ref;
|
||||
} else {
|
||||
return owner;
|
||||
@@ -2008,7 +2008,7 @@ void GDScript::_get_property_list(List<PropertyInfo> *p_properties) const {
|
||||
|
||||
void GDScript::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo("new"));
|
||||
ObjectTypeDB::bind_native_method(METHOD_FLAGS_DEFAULT,"new",&GDScript::_new,MethodInfo("new"));
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_as_byte_code"),&GDScript::get_as_byte_code);
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ friend class GDScriptLanguage;
|
||||
Map<StringName,Variant> constants;
|
||||
Map<StringName,GDFunction> member_functions;
|
||||
Map<StringName,MemberInfo> member_indices; //members are just indices to the instanced script.
|
||||
Map<StringName,Ref<GDScript> > subclasses;
|
||||
Map<StringName,Ref<GDScript> > subclasses;
|
||||
Map<StringName,Vector<StringName> > _signals;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
@@ -541,14 +541,14 @@ void GDTokenizerText::_advance() {
|
||||
}
|
||||
INCPOS(1);
|
||||
is_node_path=true;
|
||||
|
||||
|
||||
case '\'':
|
||||
case '"': {
|
||||
|
||||
|
||||
if (GETCHAR(0)=='\'')
|
||||
string_mode=STRING_SINGLE_QUOTE;
|
||||
|
||||
|
||||
|
||||
|
||||
int i=1;
|
||||
if (string_mode==STRING_DOUBLE_QUOTE && GETCHAR(i)=='"' && GETCHAR(i+1)=='"') {
|
||||
i+=2;
|
||||
@@ -1054,7 +1054,7 @@ Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
|
||||
const uint8_t *buf=p_buffer.ptr();
|
||||
int total_len=p_buffer.size();
|
||||
ERR_FAIL_COND_V( p_buffer.size()<24 || p_buffer[0]!='G' || p_buffer[1]!='D' || p_buffer[2]!='S' || p_buffer[3]!='C',ERR_INVALID_DATA);
|
||||
|
||||
|
||||
int version = decode_uint32(&buf[4]);
|
||||
if (version>BYTECODE_VERSION) {
|
||||
ERR_EXPLAIN("Bytecode is too New! Please use a newer engine version.");
|
||||
@@ -1066,13 +1066,13 @@ Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
|
||||
int token_count = decode_uint32(&buf[20]);
|
||||
|
||||
const uint8_t *b=buf;
|
||||
|
||||
|
||||
b=&buf[24];
|
||||
total_len-=24;
|
||||
|
||||
|
||||
identifiers.resize(identifier_count);
|
||||
for(int i=0;i<identifier_count;i++) {
|
||||
|
||||
|
||||
int len = decode_uint32(b);
|
||||
ERR_FAIL_COND_V(len>total_len,ERR_INVALID_DATA);
|
||||
b+=4;
|
||||
@@ -1089,7 +1089,7 @@ Error GDTokenizerBuffer::set_code_buffer(const Vector<uint8_t> & p_buffer) {
|
||||
total_len-=len+4;
|
||||
identifiers[i]=s;
|
||||
}
|
||||
|
||||
|
||||
constants.resize(constant_count);
|
||||
for(int i=0;i<constant_count;i++) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user