MCPcopy Create free account
hub / github.com/alecazam/kram / ParseComment

Method ParseComment

hlslparser/src/HLSLParser.cpp:2260–2282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2258}
2259
2260bool HLSLParser::ParseComment(HLSLStatement*& statement)
2261{
2262 if (m_tokenizer.GetToken() != HLSLToken_Comment)
2263 return false;
2264
2265 const char* textName = m_tree->AddString(m_tokenizer.GetComment());
2266
2267 // This has already parsed the next comment before have had a chance to
2268 // grab the string from the previous comment, if they were sequenential comments.
2269 // So grabbing a copy of comment before this parses the next comment.
2270 if (!Accept(HLSLToken_Comment))
2271 return false;
2272
2273 const char* fileName = GetFileName();
2274 int line = GetLineNumber();
2275
2276 HLSLComment* comment = m_tree->AddNode<HLSLComment>(fileName, line);
2277 comment->text = textName;
2278
2279 // pass it back
2280 statement = comment;
2281 return true;
2282}
2283
2284bool HLSLParser::ParseBlock(HLSLStatement*& firstStatement, const HLSLType& returnType)
2285{

Callers

nothing calls this directly

Calls 3

GetTokenMethod · 0.80
GetCommentMethod · 0.80
AddStringMethod · 0.45

Tested by

no test coverage detected