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
Tobias Hunger
qt-creator
Commits
945b2555
Commit
945b2555
authored
Nov 29, 2010
by
Roberto Raggi
Browse files
Evaluate member accesses.
parent
55234b9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/glsl/glslsemantic.cpp
View file @
945b2555
...
...
@@ -248,7 +248,19 @@ bool Semantic::visit(AssignmentExpressionAST *ast)
bool
Semantic
::
visit
(
MemberAccessExpressionAST
*
ast
)
{
ExprResult
expr
=
expression
(
ast
->
expr
);
// ast->field
if
(
expr
.
type
&&
ast
->
field
)
{
if
(
const
VectorType
*
vecTy
=
expr
.
type
->
asVectorType
())
{
if
(
Symbol
*
s
=
vecTy
->
find
(
*
ast
->
field
))
{
_expr
.
type
=
s
->
type
();
}
}
else
if
(
const
Struct
*
structTy
=
expr
.
type
->
asStructType
())
{
if
(
Symbol
*
s
=
structTy
->
find
(
*
ast
->
field
))
{
_expr
.
type
=
s
->
type
();
}
}
else
{
// error(ast->lineno, QString("Requested for member `%1', in a non class or vec instance").arg(*ast->field));
}
}
return
false
;
}
...
...
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