diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_tokenizer.cpp | 1 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/parser/features/vector_inf.gd | 6 | ||||
-rw-r--r-- | modules/gdscript/tests/scripts/parser/features/vector_inf.out | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_tokenizer.cpp b/modules/gdscript/gdscript_tokenizer.cpp index 04612c6793..e17a804003 100644 --- a/modules/gdscript/gdscript_tokenizer.cpp +++ b/modules/gdscript/gdscript_tokenizer.cpp @@ -164,6 +164,7 @@ bool GDScriptTokenizer::Token::is_identifier() const { switch (type) { case IDENTIFIER: case MATCH: // Used in String.match(). + case CONST_INF: // Used in Vector{2,3,4}.INF return true; default: return false; diff --git a/modules/gdscript/tests/scripts/parser/features/vector_inf.gd b/modules/gdscript/tests/scripts/parser/features/vector_inf.gd new file mode 100644 index 0000000000..039d51d9ed --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/vector_inf.gd @@ -0,0 +1,6 @@ +func test(): + var vec2: = Vector2.INF + var vec3: = Vector3.INF + + print(vec2.x == INF) + print(vec3.z == INF) diff --git a/modules/gdscript/tests/scripts/parser/features/vector_inf.out b/modules/gdscript/tests/scripts/parser/features/vector_inf.out new file mode 100644 index 0000000000..9d111a8322 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/features/vector_inf.out @@ -0,0 +1,3 @@ +GDTEST_OK +true +true |