-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync to upstream/release/599 #1069
Conversation
This exposes a bug in CodeAllocator that needs to be fixed properly
if (AstStatForIn* statForIn = (*it)->as<AstStatForIn>(); statForIn && !statForIn->body->hasEnd) | ||
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword}); | ||
else if (AstStatFor* statFor = (*it)->as<AstStatFor>(); statFor && !statFor->body->hasEnd) | ||
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword}); | ||
else if (AstStatIf* statIf = (*it)->as<AstStatIf>()) | ||
{ | ||
bool hasEnd = statIf->thenbody->hasEnd; | ||
if (statIf->elsebody) | ||
{ | ||
if (AstStatBlock* elseBlock = statIf->elsebody->as<AstStatBlock>()) | ||
hasEnd = elseBlock->hasEnd; | ||
} | ||
|
||
if (!hasEnd) | ||
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword}); | ||
} | ||
else if (AstStatWhile* statWhile = (*it)->as<AstStatWhile>(); statWhile && !statWhile->body->hasEnd) | ||
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword}); | ||
else if (AstExprFunction* exprFunction = (*it)->as<AstExprFunction>(); exprFunction && !exprFunction->body->hasEnd) | ||
result.emplace("end", AutocompleteEntry{AutocompleteEntryKind::Keyword}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: will this be deleted once LuauAutocompleteDoEnd
is clipped? since its all covered by the AstStatBlock? (i guess apart from AstStatIf)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't actually thought about that. I think so in theory?
I'll give it a shot when it's time to clip the flag.
What's Changed
CLI/FileUtils.cpp
by @SamuraiCrow Improve POSIX compliance in CLI/FileUtils.cpp #1064AstStat*::hasEnd
is deprecated; useAstStatBlock::hasEnd
instead#
operatorgetfenv
andsetfenv
Compiler
New Type Solver
Native Codegen
Co-authored-by: Aaron Weiss [email protected]
Co-authored-by: Alexander McCord [email protected]
Co-authored-by: Andy Friesen [email protected]
Co-authored-by: Vighnesh Vijay [email protected]
Co-authored-by: Vyacheslav Egorov [email protected]