diff options
Diffstat (limited to 'servers/visual/shader_language.cpp')
| -rw-r--r-- | servers/visual/shader_language.cpp | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 834505df9a..29c27eee85 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -5,8 +5,8 @@  /*                           GODOT ENGINE                                */  /*                      https://godotengine.org                          */  /*************************************************************************/ -/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur.                 */ -/* Copyright (c) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)    */ +/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur.                 */ +/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md)    */  /*                                                                       */  /* Permission is hereby granted, free of charge, to any person obtaining */  /* a copy of this software and associated documentation files (the       */ @@ -27,6 +27,7 @@  /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */  /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */  /*************************************************************************/ +  #include "shader_language.h"  #include "os/os.h"  #include "print_string.h" @@ -334,6 +335,7 @@ ShaderLanguage::Token ShaderLanguage::_get_token() {  						while (true) {  							if (GETCHAR(0) == '\n') { +								tk_line++;  								char_idx++;  								break;  							} @@ -3208,8 +3210,6 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui  				var.precision = precision;  				var.line = tk_line; -				p_block->variables[name] = var; -  				VariableDeclarationNode::Declaration decl;  				decl.name = name; @@ -3218,7 +3218,7 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui  				tk = _get_token();  				if (tk.type == TK_OP_ASSIGN) { -					//variable creted with assignment! must parse an expression +					//variable created with assignment! must parse an expression  					Node *n = _parse_and_reduce_expression(p_block, p_builtin_types);  					if (!n)  						return ERR_PARSE_ERROR; @@ -3232,6 +3232,8 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui  					tk = _get_token();  				} +				p_block->variables[name] = var; +  				vardecl->declarations.push_back(decl);  				if (tk.type == TK_COMMA) { |