Skip to content
Closed
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 @@ -97,6 +97,19 @@ public String perform() {
lcToken = token;
misc();
break;
case "-":
if (lcToken.equals("-"))
{
String ttt;
do {
ttt = tokens.nextToken();
token += ttt;
}
while (tokens.hasMoreTokens());
lcToken = token;
misc();
}
break;
Comment on lines +101 to +112
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like your code distinguishes a simple minus sign - from a comment -- properly. The following should work though:

Suggested change
if (lcToken.equals("-"))
{
String ttt;
do {
ttt = tokens.nextToken();
token += ttt;
}
while (tokens.hasMoreTokens());
lcToken = token;
misc();
}
break;
String ttt;
if ( tokens.hasMoreTokens() && ( ttt = tokens.nextToken() ).equals( "-" ) ) {
// Comment
token += "--";
while (tokens.hasMoreTokens()) {
ttt = tokens.nextToken();
token += ttt;
}
lcToken = token;
misc();
}
else {
misc();
}
break;

Copy link
Author

@skarbgud skarbgud Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you look at the code you suggested,
token += "--";
I don't know if it's because of that.
The code -- is expressed as ---.
So when I turned to the original code, both the case of -- and - met the test.


case ",":
if ( afterByOrSetOrFromOrSelect && inFunction==0 ) {
Expand Down