Skip to content

Commit

Permalink
New GDScript tokenizer and parser
Browse files Browse the repository at this point in the history
Sometimes to fix something you have to break it first.

This get GDScript mostly working with the new tokenizer and parser but
a lot of things isn't working yet. It compiles and it's usable, and that
should be enough for now.

Don't worry: other huge commits will come after this.
  • Loading branch information
vnen committed Jul 20, 2020
1 parent 818bfbc commit 5d6e853
Show file tree
Hide file tree
Showing 29 changed files with 7,293 additions and 15,883 deletions.
982 changes: 67 additions & 915 deletions main/tests/test_gdscript.cpp

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions modules/gdscript/editor/gdscript_highlighter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line)

if (str[k] == '(') {
in_function_name = true;
} else if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::TK_PR_VAR)) {
} else if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::Token::VAR)) {
in_variable_declaration = true;
}
}
Expand Down Expand Up @@ -357,7 +357,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line)
} else if (in_function_name) {
next_type = FUNCTION;

if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::TK_PR_FUNCTION)) {
if (previous_text == GDScriptTokenizer::get_token_name(GDScriptTokenizer::Token::FUNC)) {
color = function_definition_color;
} else {
color = function_color;
Expand Down
Loading

0 comments on commit 5d6e853

Please sign in to comment.