| 177 | } |
| 178 | |
| 179 | static void test_parser(const String &p_code, const String &p_script_path, const Vector<String> &p_lines) { |
| 180 | GDScriptParser parser; |
| 181 | Error err = parser.parse(p_code, p_script_path, false); |
| 182 | |
| 183 | if (err != OK) { |
| 184 | const List<GDScriptParser::ParserError> &errors = parser.get_errors(); |
| 185 | for (const GDScriptParser::ParserError &error : errors) { |
| 186 | print_line(vformat("%02d:%02d: %s", error.line, error.column, error.message)); |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | GDScriptAnalyzer analyzer(&parser); |
| 191 | err = analyzer.analyze(); |
| 192 | |
| 193 | if (err != OK) { |
| 194 | const List<GDScriptParser::ParserError> &errors = parser.get_errors(); |
| 195 | for (const GDScriptParser::ParserError &error : errors) { |
| 196 | print_line(vformat("%02d:%02d: %s", error.line, error.column, error.message)); |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | #ifdef TOOLS_ENABLED |
| 201 | GDScriptParser::TreePrinter printer; |
| 202 | printer.print_tree(parser); |
| 203 | #endif |
| 204 | } |
| 205 | |
| 206 | static void disassemble_function(const GDScriptFunction *p_func, const Vector<String> &p_lines) { |
| 207 | ERR_FAIL_NULL(p_func); |
no test coverage detected