From 5e938f000136c076f9f35b8332dc7c022687a983 Mon Sep 17 00:00:00 2001 From: Saracen Date: Mon, 6 Feb 2017 22:44:22 +0000 Subject: Inf and NaN support added to GDScript. --- modules/gdscript/gd_parser.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'modules/gdscript/gd_parser.cpp') 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(); + 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(); + constant->value = Math_NAN; + tokenizer->advance(); + expr = constant; } else if (tokenizer->get_token()==GDTokenizer::TK_PR_PRELOAD) { //constant defined by tokenizer -- cgit v1.2.3-70-g09d2