Skip to content
GitLab
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
873838fe
Commit
873838fe
authored
Jun 17, 2009
by
Roberto Raggi
Browse files
Simplified TypeOf/ResolveExpression.
parent
ddef96ec
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/libs/cplusplus/CppDocument.cpp
View file @
873838fe
...
...
@@ -329,6 +329,8 @@ void Document::check()
for
(
DeclarationAST
*
decl
=
ast
->
declarations
;
decl
;
decl
=
decl
->
next
)
{
semantic
.
check
(
decl
,
globals
);
}
}
else
if
(
ExpressionAST
*
ast
=
_translationUnit
->
ast
()
->
asExpression
())
{
semantic
.
check
(
ast
,
globals
);
}
}
...
...
src/libs/cplusplus/ResolveExpression.cpp
View file @
873838fe
...
...
@@ -259,8 +259,7 @@ bool ResolveExpression::visit(BinaryExpressionAST *ast)
bool
ResolveExpression
::
visit
(
CastExpressionAST
*
ast
)
{
Scope
dummy
;
addResult
(
sem
.
check
(
ast
->
type_id
,
&
dummy
));
addResult
(
sem
.
check
(
ast
->
type_id
,
_context
.
expressionDocument
()
->
globalSymbols
()));
return
false
;
}
...
...
@@ -278,8 +277,7 @@ bool ResolveExpression::visit(ConditionalExpressionAST *)
bool
ResolveExpression
::
visit
(
CppCastExpressionAST
*
ast
)
{
Scope
dummy
;
addResult
(
sem
.
check
(
ast
->
type_id
,
&
dummy
));
addResult
(
sem
.
check
(
ast
->
type_id
,
_context
.
expressionDocument
()
->
globalSymbols
()));
return
false
;
}
...
...
@@ -450,8 +448,7 @@ bool ResolveExpression::visit(CompoundLiteralAST *ast)
bool
ResolveExpression
::
visit
(
QualifiedNameAST
*
ast
)
{
ResolveClass
resolveClass
;
Scope
dummy
;
Name
*
name
=
sem
.
check
(
ast
,
&
dummy
);
Name
*
name
=
ast
->
name
;
QList
<
Symbol
*>
symbols
=
_context
.
resolve
(
name
);
foreach
(
Symbol
*
symbol
,
symbols
)
{
...
...
@@ -485,10 +482,7 @@ bool ResolveExpression::visit(ConversionFunctionIdAST *)
bool
ResolveExpression
::
visit
(
SimpleNameAST
*
ast
)
{
Scope
dummy
;
Name
*
name
=
sem
.
check
(
ast
,
&
dummy
);
QList
<
Symbol
*>
symbols
=
_context
.
resolve
(
name
);
QList
<
Symbol
*>
symbols
=
_context
.
resolve
(
ast
->
name
);
foreach
(
Symbol
*
symbol
,
symbols
)
addResult
(
symbol
->
type
(),
symbol
);
...
...
@@ -504,10 +498,7 @@ bool ResolveExpression::visit(DestructorNameAST *)
bool
ResolveExpression
::
visit
(
TemplateIdAST
*
ast
)
{
Scope
dummy
;
Name
*
name
=
sem
.
check
(
ast
,
&
dummy
);
QList
<
Symbol
*>
symbols
=
_context
.
resolve
(
name
);
QList
<
Symbol
*>
symbols
=
_context
.
resolve
(
ast
->
name
);
foreach
(
Symbol
*
symbol
,
symbols
)
addResult
(
symbol
->
type
(),
symbol
);
...
...
@@ -601,8 +592,9 @@ bool ResolveExpression::visit(MemberAccessAST *ast)
QList
<
Result
>
baseResults
=
_results
;
// Evaluate the expression-id that follows the access operator.
Scope
dummy
;
Name
*
memberName
=
sem
.
check
(
ast
->
member_name
,
&
dummy
);
Name
*
memberName
=
0
;
if
(
ast
->
member_name
)
memberName
=
ast
->
member_name
->
name
;
// Remember the access operator.
const
unsigned
accessOp
=
tokenKind
(
ast
->
access_token
);
...
...
src/libs/cplusplus/TypeOfExpression.cpp
View file @
873838fe
...
...
@@ -63,6 +63,7 @@ QList<TypeOfExpression::Result> TypeOfExpression::operator()(const QString &expr
if
(
mode
==
Preprocess
)
code
=
preprocessedExpression
(
expression
,
m_snapshot
,
document
);
Document
::
Ptr
expressionDoc
=
documentForExpression
(
code
);
expressionDoc
->
check
();
m_ast
=
extractExpressionAST
(
expressionDoc
);
m_lookupContext
=
LookupContext
(
lastVisibleSymbol
,
expressionDoc
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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