Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkSL::Parser::AutoDepth Class Reference

Public Member Functions

 AutoDepth (Parser *p)
 
 ~AutoDepth ()
 
bool increase ()
 

Detailed Description

Definition at line 103 of file SkSLParser.cpp.

Constructor & Destructor Documentation

◆ AutoDepth()

SkSL::Parser::AutoDepth::AutoDepth ( Parser p)
inline

Definition at line 105 of file SkSLParser.cpp.

105: fParser(p), fDepth(0) {}

◆ ~AutoDepth()

SkSL::Parser::AutoDepth::~AutoDepth ( )
inline

Definition at line 107 of file SkSLParser.cpp.

107 {
108 fParser->fDepth -= fDepth;
109 }

Member Function Documentation

◆ increase()

bool SkSL::Parser::AutoDepth::increase ( )
inline

Definition at line 111 of file SkSLParser.cpp.

111 {
112 ++fDepth;
113 ++fParser->fDepth;
114 if (fParser->fDepth > kMaxParseDepth) {
115 fParser->error(fParser->peek(), "exceeded max parse depth");
116 fParser->fEncounteredFatalError = true;
117 return false;
118 }
119 return true;
120 }
static constexpr int kMaxParseDepth

The documentation for this class was generated from the following file: