mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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.
This commit is contained in:
parent
41564aaf77
commit
b4d0a09f15
26 changed files with 1010 additions and 119 deletions
|
@ -1336,7 +1336,7 @@ private:
|
|||
HashSet<int> unsafe_lines;
|
||||
#endif
|
||||
|
||||
GDScriptTokenizer tokenizer;
|
||||
GDScriptTokenizer *tokenizer = nullptr;
|
||||
GDScriptTokenizer::Token previous;
|
||||
GDScriptTokenizer::Token current;
|
||||
|
||||
|
@ -1540,6 +1540,7 @@ private:
|
|||
|
||||
public:
|
||||
Error parse(const String &p_source_code, const String &p_script_path, bool p_for_completion);
|
||||
Error parse_binary(const Vector<uint8_t> &p_binary, const String &p_script_path);
|
||||
ClassNode *get_tree() const { return head; }
|
||||
bool is_tool() const { return _is_tool; }
|
||||
ClassNode *find_class(const String &p_qualified_name) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue