mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 23:34:57 -04:00
egg: Fix egg lexer state not being cleaned up after error
This commit is contained in:
parent
339331c1ad
commit
152d317c8c
@ -971,6 +971,7 @@ extern "C" int eggyywrap(void); // declared below.
|
||||
|
||||
static int yyinput(void); // declared by flex.
|
||||
|
||||
int eggyylex_destroy(void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Static variables
|
||||
@ -1018,6 +1019,15 @@ egg_init_lexer(istream &in, const string &filename) {
|
||||
initial_token = START_EGG;
|
||||
}
|
||||
|
||||
void
|
||||
egg_cleanup_lexer() {
|
||||
// Reset the lexer state.
|
||||
eggyylex_destroy();
|
||||
|
||||
input_p = nullptr;
|
||||
egg_filename.clear();
|
||||
}
|
||||
|
||||
void
|
||||
egg_start_group_body() {
|
||||
/* Set the initial state to begin within a group_body context,
|
||||
|
@ -26,6 +26,7 @@ extern "C" int eggyywrap(void); // declared below.
|
||||
|
||||
static int yyinput(void); // declared by flex.
|
||||
|
||||
int eggyylex_destroy(void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Static variables
|
||||
@ -73,6 +74,15 @@ egg_init_lexer(istream &in, const string &filename) {
|
||||
initial_token = START_EGG;
|
||||
}
|
||||
|
||||
void
|
||||
egg_cleanup_lexer() {
|
||||
// Reset the lexer state.
|
||||
yylex_destroy();
|
||||
|
||||
input_p = nullptr;
|
||||
egg_filename.clear();
|
||||
}
|
||||
|
||||
void
|
||||
egg_start_group_body() {
|
||||
/* Set the initial state to begin within a group_body context,
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
|
||||
void egg_init_lexer(std::istream &in, const std::string &filename);
|
||||
void egg_cleanup_lexer();
|
||||
void egg_start_group_body();
|
||||
void egg_start_texture_body();
|
||||
void egg_start_primitive_body();
|
||||
|
@ -223,6 +223,8 @@ egg_cleanup_parser() {
|
||||
textures.clear();
|
||||
materials.clear();
|
||||
groups.clear();
|
||||
|
||||
egg_cleanup_lexer();
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,6 +153,8 @@ egg_cleanup_parser() {
|
||||
textures.clear();
|
||||
materials.clear();
|
||||
groups.clear();
|
||||
|
||||
egg_cleanup_lexer();
|
||||
}
|
||||
|
||||
%}
|
||||
|
Loading…
x
Reference in New Issue
Block a user