Skip to content
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

Bugfix proposal for #28 #29

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,21 @@ protected Token produceToken() {
}
} else if (read.getType().equals(SymbolType.END)) {
// EOF always stops the loop. The caller method (parse) can flag a runaway group error.
token = read;
// START KGU#1144 2024-04-15: Bugfix #28 Save a line comment at end of file
//token = read;
// An open group (e.g. line comment) expecting just some NOISE, however, should be preserved
Token grp = null;
if (groupStack.size() == 1
&& (grp = groupStack.peek()).getGroup().getEndingMode() == EndingMode.OPEN
&& grp.getGroup().getEnd().getType().equals(SymbolType.NOISE)) {
groupStack.pop();
grp.setSymbol(grp.getGroup().getContainer());
token = grp;
}
else {
token = read;
}
// END KGU#1144 2024-04-15
done = true;
} else {
// We are in a group, Append to the Token on the top of the stack.
Expand Down