diff options
| author | Danil Alexeev <danil@alexeev.xyz> | 2023-02-13 09:46:31 +0300 |
|---|---|---|
| committer | Danil Alexeev <danil@alexeev.xyz> | 2023-06-14 21:47:12 +0300 |
| commit | fba8cbe6dbf17399e06ac9141a862734187dfb65 (patch) | |
| tree | 7a48d44a48059c7b5d9bfa3e575b32637f3870cc /modules/gdscript/tests/scripts/parser/errors | |
| parent | 33957aee69683cf1f542a8622e5a9efd23070f1c (diff) | |
| download | redot-engine-fba8cbe6dbf17399e06ac9141a862734187dfb65.tar.gz | |
GDScript: Fix repeated `_` are allowed after decimal point
Diffstat (limited to 'modules/gdscript/tests/scripts/parser/errors')
4 files changed, 7 insertions, 2 deletions
diff --git a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.gd b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.gd index 71a03fbc0d..f322783776 100644 --- a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.gd +++ b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.gd @@ -1,3 +1,3 @@ func test(): # Number separators may not be placed right next to each other. - var __ = 1__23 + var _num = 1__23 diff --git a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.out b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.out index 71a3c2fd6a..b308994ae2 100644 --- a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.out +++ b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators.out @@ -1,2 +1,2 @@ GDTEST_PARSER_ERROR -Only one underscore can be used as a numeric separator. +Multiple underscores cannot be adjacent in a numeric literal. diff --git a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.gd b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.gd new file mode 100644 index 0000000000..3140999aa9 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.gd @@ -0,0 +1,3 @@ +func test(): + # Number separators may not be placed right next to each other. + var _num = 123.45__67 diff --git a/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.out b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.out new file mode 100644 index 0000000000..b308994ae2 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/multiple_number_separators_after_decimal.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Multiple underscores cannot be adjacent in a numeric literal. |
