MCPcopy Create free account
hub / github.com/GDRETools/gdsdecomp / GDScriptV2TokenizerCompatText

Class GDScriptV2TokenizerCompatText

bytecode/gdscript_v2_tokenizer_compat.h:75–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73};
74
75class GDScriptV2TokenizerCompatText : public GDScriptV2TokenizerCompat {
76 GDSOFTCLASS(GDScriptV2TokenizerCompatText, GDScriptV2TokenizerCompat);
77 String source;
78 const char32_t *_source = nullptr;
79 const char32_t *_current = nullptr;
80 int line = -1, column = -1;
81 int cursor_line = -1, cursor_column = -1;
82 int tab_size = 4;
83
84 // Keep track of multichar tokens.
85 const char32_t *_start = nullptr;
86 int start_line = 0, start_column = 0;
87 int leftmost_column = 0, rightmost_column = 0;
88
89 // Info cache.
90 bool line_continuation = false; // Whether this line is a continuation of the previous, like when using '\'.
91 bool multiline_mode = false;
92 List<Token> error_stack;
93 bool pending_newline = false;
94 Token last_token;
95 Token last_newline;
96 int pending_indents = 0;
97 List<int> indent_stack;
98 List<List<int>> indent_stack_stack; // For lambdas, which require manipulating the indentation point.
99 List<char32_t> paren_stack;
100 char32_t indent_char = '\0';
101 int position = 0;
102 int length = 0;
103 Vector<int> continuation_lines;
104#ifdef DEBUG_ENABLED
105 Vector<String> keyword_list;
106#endif // DEBUG_ENABLED
107
108#ifdef TOOLS_ENABLED
109 HashMap<int, CommentData> comments;
110#endif // TOOLS_ENABLED
111
112 const GDScriptDecomp *decomp;
113 Ref<GodotVer> engine_ver;
114
115 bool has_abstract = false;
116
117 _FORCE_INLINE_ bool _is_at_end() { return position >= length; }
118 _FORCE_INLINE_ char32_t _peek(int p_offset = 0) { return position + p_offset >= 0 && position + p_offset < length ? _current[p_offset] : '\0'; }
119 int indent_level() const { return indent_stack.size(); }
120 bool has_error() const { return !error_stack.is_empty(); }
121 Token pop_error();
122 char32_t _advance();
123 String _get_indent_char_name(char32_t ch);
124 void _skip_whitespace();
125 void check_indent();
126
127#ifdef DEBUG_ENABLED
128 void make_keyword_list();
129#endif // DEBUG_ENABLED
130
131 Token make_error(const String &p_message);
132 void push_error(const String &p_message);

Callers 1

create_text_tokenizerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected