Skip to content

Commit

Permalink
add "global" to reservedkeywords
Browse files Browse the repository at this point in the history
  • Loading branch information
jumerckx committed Dec 31, 2023
1 parent 7b2cfa7 commit 652bf77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deps/tblgen/jl-generators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ end
auto opname = op.getOperationName();
auto functionname = opname.substr(op.getDialectName().str().length() + 1); // get rid of "dialect." prefix.
// check if functionname colides with Julia keywords (for, return, if, continue, break, ...):
if (functionname == "for" || functionname == "return" || functionname == "if" || functionname == "continue" || functionname == "break" || functionname == "module")
std::vector<std::string> reservedKeywords = {"for", "return", "if", "continue", "break", "module", "global"};
if (std::find(reservedKeywords.begin(), reservedKeywords.end(), functionname) != reservedKeywords.end())
{
functionname = functionname + "_";
}
Expand Down

0 comments on commit 652bf77

Please sign in to comment.