aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_parser.cpp
diff options
context:
space:
mode:
authorKostadin Damyanov2015-08-09 12:45:21 +0300
committerKostadin Damyanov2015-08-09 12:45:21 +0300
commitcdf1ac7d58f3dc026cd316a66450771762d74432 (patch)
tree635ab608220b2940674098253efddbca7a69377a /modules/gdscript/gd_parser.cpp
parentf5bfd497aab7e24a6f4dc0315e9e9333504067a0 (diff)
parentc2e2f2e0aebf6342e6f18ae5d67b6a825590675a (diff)
downloadgodot-cdf1ac7d58f3dc026cd316a66450771762d74432.tar.gz
godot-cdf1ac7d58f3dc026cd316a66450771762d74432.tar.zst
godot-cdf1ac7d58f3dc026cd316a66450771762d74432.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'modules/gdscript/gd_parser.cpp')
-rw-r--r--modules/gdscript/gd_parser.cpp36
1 files changed, 27 insertions, 9 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp
index afe8c9aa7..f7aaaf7ee 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2315,6 +2315,17 @@ void GDParser::_parse_class(ClassNode *p_class) {
case Variant::INT: {
+ if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER && tokenizer->get_token_identifier()=="FLAGS") {
+
+ current_export.hint=PROPERTY_HINT_ALL_FLAGS;
+ tokenizer->advance();
+ if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_CLOSE) {
+ _set_error("Expected ')' in hint.");
+ return;
+ }
+ break;
+ }
+
if (tokenizer->get_token()==GDTokenizer::TK_CONSTANT && tokenizer->get_token_constant().get_type()==Variant::STRING) {
//enumeration
current_export.hint=PROPERTY_HINT_ENUM;
@@ -2542,16 +2553,23 @@ void GDParser::_parse_class(ClassNode *p_class) {
} else if (tokenizer->get_token()==GDTokenizer::TK_IDENTIFIER) {
String identifier = tokenizer->get_token_identifier();
- if (!ObjectTypeDB::is_type(identifier,"Resource")) {
-
- current_export=PropertyInfo();
- _set_error("Export hint not a type or resource.");
+ if (identifier == "flag") {
+ current_export.type=Variant::INT;
+ current_export.hint=PROPERTY_HINT_ALL_FLAGS;
+ }else if (identifier == "multiline"){
+ current_export.type=Variant::STRING;
+ current_export.hint=PROPERTY_HINT_MULTILINE_TEXT;
+ } else {
+ if (!ObjectTypeDB::is_type(identifier,"Resource")) {
+
+ current_export=PropertyInfo();
+ _set_error("Export hint not a type or resource.");
+ }
+
+ current_export.type=Variant::OBJECT;
+ current_export.hint=PROPERTY_HINT_RESOURCE_TYPE;
+ current_export.hint_string=identifier;
}
-
- current_export.type=Variant::OBJECT;
- current_export.hint=PROPERTY_HINT_RESOURCE_TYPE;
- current_export.hint_string=identifier;
-
tokenizer->advance();
}