From b4d0a09f15c60c88bbf516d2f6dcdb451dcad9c7 Mon Sep 17 00:00:00 2001 From: George Marques Date: Mon, 22 Jan 2024 11:31:55 -0300 Subject: GDScript: Reintroduce binary tokenization on export This adds back a function available in 3.x: exporting the GDScript files in a binary form by converting the tokens recognized by the tokenizer into a data format. It is enabled by default on export but can be manually disabled. The format helps with loading times since, the tokens are easily reconstructed, and with hiding the source code, since recovering it would require a specialized tool. Code comments are not stored in this format. The `--test` command can also include a `--use-binary-tokens` flag which will run the GDScript tests with the binary format instead of the regular source code by converting them in-memory before the test runs. --- modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd | 3 --- modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out | 2 -- .../tests/scripts/parser/errors/mixing_tabs_spaces.textonly.gd | 3 +++ .../tests/scripts/parser/errors/mixing_tabs_spaces.textonly.out | 2 ++ modules/gdscript/tests/scripts/parser/features/multiline_if.gd | 1 + 5 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd delete mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out create mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.gd create mode 100644 modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.out (limited to 'modules/gdscript/tests/scripts') diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd deleted file mode 100644 index 9ad77f1432..0000000000 --- a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.gd +++ /dev/null @@ -1,3 +0,0 @@ -func test(): - print("Using spaces") - print("Using tabs") diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out deleted file mode 100644 index 31bed2dbc7..0000000000 --- a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.out +++ /dev/null @@ -1,2 +0,0 @@ -GDTEST_PARSER_ERROR -Used tab character for indentation instead of space as used before in the file. diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.gd b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.gd new file mode 100644 index 0000000000..9ad77f1432 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.gd @@ -0,0 +1,3 @@ +func test(): + print("Using spaces") + print("Using tabs") diff --git a/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.out b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.out new file mode 100644 index 0000000000..31bed2dbc7 --- /dev/null +++ b/modules/gdscript/tests/scripts/parser/errors/mixing_tabs_spaces.textonly.out @@ -0,0 +1,2 @@ +GDTEST_PARSER_ERROR +Used tab character for indentation instead of space as used before in the file. diff --git a/modules/gdscript/tests/scripts/parser/features/multiline_if.gd b/modules/gdscript/tests/scripts/parser/features/multiline_if.gd index 86152f4543..7b82d9b1da 100644 --- a/modules/gdscript/tests/scripts/parser/features/multiline_if.gd +++ b/modules/gdscript/tests/scripts/parser/features/multiline_if.gd @@ -9,6 +9,7 @@ func test(): # Alternatively, backslashes can be used. if 1 == 1 \ + \ and 2 == 2 and \ 3 == 3: pass -- cgit v1.2.3