Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
sksl
ir
SkSLExpression.cpp
Go to the documentation of this file.
1
/*
2
* Copyright 2021 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#include "
src/sksl/ir/SkSLExpression.h
"
9
10
#include "
src/sksl/SkSLContext.h
"
11
#include "
src/sksl/SkSLDefines.h
"
12
#include "
src/sksl/SkSLErrorReporter.h
"
13
#include "
src/sksl/SkSLOperator.h
"
14
15
namespace
SkSL
{
16
17
std::string
Expression::description
()
const
{
18
return
this->
description
(
OperatorPrecedence::kExpression
);
19
}
20
21
bool
Expression::isIncomplete
(
const
Context
& context)
const
{
22
switch
(this->
kind
()) {
23
case
Kind::kFunctionReference:
24
context.
fErrors
->
error
(
fPosition
.
after
(),
"expected '(' to begin function call"
);
25
return
true
;
26
27
case
Kind::kMethodReference:
28
context.
fErrors
->
error
(
fPosition
.
after
(),
"expected '(' to begin method call"
);
29
return
true
;
30
31
case
Kind::kTypeReference:
32
context.
fErrors
->
error
(
fPosition
.
after
(),
33
"expected '(' to begin constructor invocation"
);
34
return
true
;
35
36
default
:
37
return
false
;
38
}
39
}
40
41
ExpressionArray
ExpressionArray::clone
()
const
{
42
ExpressionArray
cloned;
43
cloned.
reserve_exact
(this->
size
());
44
for
(
const
std::unique_ptr<Expression>& expr : *
this
) {
45
cloned.
push_back
(expr ? expr->clone() :
nullptr
);
46
}
47
return
cloned;
48
}
49
50
}
// namespace SkSL
SkSLContext.h
SkSLDefines.h
SkSLErrorReporter.h
SkSLExpression.h
SkSLOperator.h
SkAlignedSTStorage::size
size_t size() const
Definition
SkAlignedStorage.h:26
SkSL::Context
Definition
SkSLContext.h:24
SkSL::Context::fErrors
ErrorReporter * fErrors
Definition
SkSLContext.h:36
SkSL::ErrorReporter::error
void error(Position position, std::string_view msg)
Definition
SkSLErrorReporter.cpp:16
SkSL::ExpressionArray
Definition
SkSLDefines.h:26
SkSL::ExpressionArray::clone
ExpressionArray clone() const
Definition
SkSLExpression.cpp:41
SkSL::Expression::kind
Kind kind() const
Definition
SkSLExpression.h:40
SkSL::Expression::isIncomplete
bool isIncomplete(const Context &context) const
Definition
SkSLExpression.cpp:21
SkSL::Expression::description
std::string description() const final
Definition
SkSLExpression.cpp:17
SkSL::IRNode::fPosition
Position fPosition
Definition
SkSLIRNode.h:109
SkSL::Position::after
Position after() const
Definition
SkSLPosition.h:62
skia_private::TArray::reserve_exact
void reserve_exact(int n)
Definition
SkTArray.h:176
skia_private::TArray::push_back
T & push_back()
Definition
SkTArray.h:200
SkSL
Definition
SkCapabilities.h:15
SkSL::OperatorPrecedence::kExpression
@ kExpression
Generated on Fri Apr 26 2024 06:17:31 for Flutter Engine by
1.9.8