mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle empty parser state stack
This commit is contained in:
parent
7fdd6bb3e4
commit
c8b5289a34
@ -276,7 +276,7 @@ class Build(Command):
|
|||||||
parser.add_option('--debug', default=False, action='store_true',
|
parser.add_option('--debug', default=False, action='store_true',
|
||||||
help='Build in debug mode')
|
help='Build in debug mode')
|
||||||
parser.add_option('--sanitize', default=False, action='store_true',
|
parser.add_option('--sanitize', default=False, action='store_true',
|
||||||
help='Build with sanitization support. Run with LD_PREFLOAD=$(gcc -print-file-name=libasan.so)')
|
help='Build with sanitization support. Run with LD_PRELOAD=$(gcc -print-file-name=libasan.so)')
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
from setup.parallel_build import parallel_build, create_job
|
from setup.parallel_build import parallel_build, create_job
|
||||||
|
@ -737,7 +737,6 @@ class TokenQueue {
|
|||||||
class Parser {
|
class Parser {
|
||||||
private:
|
private:
|
||||||
enum class ParseState : unsigned {
|
enum class ParseState : unsigned {
|
||||||
normal,
|
|
||||||
escape,
|
escape,
|
||||||
comment,
|
comment,
|
||||||
string,
|
string,
|
||||||
@ -1147,6 +1146,7 @@ class Parser {
|
|||||||
|
|
||||||
void dispatch_current_char() {
|
void dispatch_current_char() {
|
||||||
write_to_output(ch);
|
write_to_output(ch);
|
||||||
|
if (!states.size()) { handle_normal(); return; }
|
||||||
switch (states.top()) {
|
switch (states.top()) {
|
||||||
case ParseState::comment:
|
case ParseState::comment:
|
||||||
handle_comment(); break;
|
handle_comment(); break;
|
||||||
@ -1174,8 +1174,6 @@ class Parser {
|
|||||||
handle_url_after_string(); break;
|
handle_url_after_string(); break;
|
||||||
case ParseState::at_keyword:
|
case ParseState::at_keyword:
|
||||||
handle_at_keyword(); break;
|
handle_at_keyword(); break;
|
||||||
case ParseState::normal:
|
|
||||||
handle_normal(); break;
|
|
||||||
}
|
}
|
||||||
prev_ch = ch;
|
prev_ch = ch;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user