aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_parser.cpp
diff options
context:
space:
mode:
authorSaracen2017-02-06 22:44:22 +0000
committerSaracen2017-02-28 21:52:33 +0000
commit5e938f000136c076f9f35b8332dc7c022687a983 (patch)
treea8e79b3f4a557ce4097791f5622728c69d22764f /modules/gdscript/gd_parser.cpp
parent0f8c6dd3822c38b8145f08265abb9eba479f4d15 (diff)
downloadgodot-5e938f000136c076f9f35b8332dc7c022687a983.tar.gz
godot-5e938f000136c076f9f35b8332dc7c022687a983.tar.zst
godot-5e938f000136c076f9f35b8332dc7c022687a983.zip
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r--modules/gdscript/gd_parser.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index 350f596f7..5147ccd63 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -375,6 +375,22 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
constant->value=Math_PI;
tokenizer->advance();
expr=constant;
+ }
+ else if (tokenizer->get_token() == GDTokenizer::TK_CONST_INF) {
+
+ //constant defined by tokenizer
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value = Math_INF;
+ tokenizer->advance();
+ expr = constant;
+ }
+ else if (tokenizer->get_token() == GDTokenizer::TK_CONST_NAN) {
+
+ //constant defined by tokenizer
+ ConstantNode *constant = alloc_node<ConstantNode>();
+ constant->value = Math_NAN;
+ tokenizer->advance();
+ expr = constant;
} else if (tokenizer->get_token()==GDTokenizer::TK_PR_PRELOAD) {
//constant defined by tokenizer