Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
1c40a4bc
Commit
1c40a4bc
authored
Dec 03, 2009
by
Roberto Raggi
Browse files
Improved panic mode error recovery
parent
72ed9b5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/shared/cplusplus/Parser.cpp
View file @
1c40a4bc
...
...
@@ -163,50 +163,48 @@ bool Parser::skipUntil(int token)
return
false
;
}
bool
Parser
::
skipUntilDeclaration
()
void
Parser
::
skipUntilDeclaration
()
{
while
(
int
tk
=
LA
())
{
switch
(
tk
)
{
case
T_SEMICOLON
:
case
T_TILDE
:
case
T_COLON_COLON
:
case
T_IDENTIFIER
:
case
T_OPERATOR
:
case
T_CHAR
:
case
T_WCHAR_T
:
case
T_BOOL
:
case
T_SHORT
:
case
T_INT
:
case
T_LONG
:
case
T_SIGNED
:
case
T_UNSIGNED
:
case
T_FLOAT
:
case
T_DOUBLE
:
case
T_VOID
:
case
T_EXTERN
:
case
T_NAMESPACE
:
case
T_USING
:
case
T_TYPEDEF
:
case
T_ASM
:
case
T_TEMPLATE
:
case
T_EXPORT
:
case
T_CONST
:
case
T_VOLATILE
:
case
T_PUBLIC
:
case
T_PROTECTED
:
case
T_PRIVATE
:
case
T_CLASS
:
case
T_STRUCT
:
case
T_UNION
:
case
T_TYPENAME
:
return
true
;
for
(;
;
consumeToken
())
{
switch
(
LA
())
{
case
T_EOF_SYMBOL
:
default:
consumeToken
();
}
}
// names
case
T_IDENTIFIER
:
case
T_COLON_COLON
:
case
T_TILDE
:
case
T_OPERATOR
:
return
false
;
// empty declaration
case
T_SEMICOLON
:
// member specification
case
T_USING
:
case
T_TEMPLATE
:
case
T_PUBLIC
:
case
T_PROTECTED
:
case
T_PRIVATE
:
case
T_Q_SIGNALS
:
case
T_Q_SLOTS
:
// declarations
case
T_ENUM
:
case
T_NAMESPACE
:
case
T_ASM
:
case
T_EXPORT
:
case
T_AT_CLASS
:
case
T_AT_INTERFACE
:
case
T_AT_PROTOCOL
:
case
T_AT_IMPLEMENTATION
:
case
T_AT_END
:
return
;
default:
if
(
lookAtBuiltinTypeSpecifier
()
||
lookAtClassKey
()
||
lookAtFunctionSpecifier
()
||
lookAtStorageClassSpecifier
())
return
;
}
// switch
}
}
bool
Parser
::
skipUntilStatement
()
...
...
src/shared/cplusplus/Parser.h
View file @
1c40a4bc
...
...
@@ -251,7 +251,7 @@ public:
bool
lookAtObjCSelector
()
const
;
bool
skipUntil
(
int
token
);
bool
skipUntilDeclaration
();
void
skipUntilDeclaration
();
bool
skipUntilStatement
();
bool
skip
(
int
l
,
int
r
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment