Skip to content

Commit 33c1e68

Browse files
committed
Fix bug where macro error was misinterpreted
1 parent 7fa2bed commit 33c1e68

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ParserGenerator.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ bool HandleInvocation_Recursive(const std::vector<Token>& tokens, int invocation
732732
bool macroSucceeded = invokedMacro(tokens, invocationStartIndex, macroOutputTokens);
733733
// Don't even try to validate the code if the macro wasn't satisfied
734734
if (!macroSucceeded)
735-
return macroSucceeded;
735+
return false;
736736

737737
// TODO: Pretty print to macro expand file and change output token source to
738738
// point there
@@ -758,7 +758,7 @@ bool HandleInvocation_Recursive(const std::vector<Token>& tokens, int invocation
758758
NoteAtToken(invocationStart,
759759
"Code was generated from macro. See macro expansion below:");
760760
printTokens(macroOutputTokens);
761-
return result;
761+
return false;
762762
}
763763

764764
// TODO Remove, debug only
@@ -770,6 +770,7 @@ bool HandleInvocation_Recursive(const std::vector<Token>& tokens, int invocation
770770
GeneratorFunc invokedGenerator = findGenerator(invocationName.contents.c_str());
771771
if (!invokedGenerator)
772772
{
773+
// TODO: Fallback to C, C++, and (generated) Cakelisp function invocation generator
773774
ErrorAtTokenf(invocationStart,
774775
"Unknown function %s. Only macros and generators may be "
775776
"invoked at top level",

0 commit comments

Comments
 (0)