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

Add fall-through statements in Emitter #235

Merged
merged 4 commits into from
Nov 4, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion jflex-unicode-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<plugin>
<groupId>de.jflex</groupId>
<artifactId>jflex-maven-plugin</artifactId>
<version>1.6.1</version>
<version>${project.parent.version}</version>
<executions>
<execution>
<goals>
Expand Down
23 changes: 12 additions & 11 deletions jflex/src/main/java/jflex/Emitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,10 @@ private void emitLexFunctHeader() {
println(" zzCh = Character.codePointAt(zzBufferL, zzCurrentPosL, zzMarkedPosL);");
println(" zzCharCount = Character.charCount(zzCh);");
println(" switch (zzCh) {");
println(" case '\\u000B':");
println(" case '\\u000C':");
println(" case '\\u0085':");
println(" case '\\u2028':");
println(" case '\\u000B': // fall though");
println(" case '\\u000C': // fall though");
println(" case '\\u0085': // fall though");
println(" case '\\u2028': // fall though");
Copy link

Choose a reason for hiding this comment

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

@regisd - I know this was merged a long time ago, but "through" is consistently misspelled, FYI.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, thanks!

println(" case '\\u2029':");
if (scanner.lineCount) println(" yyline++;");
if (scanner.columnCount) println(" yycolumn = 0;");
Expand Down Expand Up @@ -981,11 +981,11 @@ private void emitLexFunctHeader() {
println(" if (zzMarkedPosL > zzStartRead) {");
println(" switch (zzBufferL[zzMarkedPosL-1]) {");
println(" case '\\n':");
println(" case '\\u000B':");
println(" case '\\u000C':");
println(" case '\\u0085':");
println(" case '\\u2028':");
println(" case '\\u2029':");
println(" case '\\u000B': // fall though");
println(" case '\\u000C': // fall though");
println(" case '\\u0085': // fall though");
println(" case '\\u2028': // fall though");
println(" case '\\u2029': // fall though");
println(" zzAtBOL = true;");
println(" break;");
println(" case '\\r': ");
Expand Down Expand Up @@ -1200,7 +1200,8 @@ private void emitActions() {
}

println(" { " + action.content);
println(" }");
println(" } ");
println(" // fall through");
println(" case " + (i++) + ": break;");
}
}
Expand Down Expand Up @@ -1233,7 +1234,7 @@ private void emitEOFVal() {
println(" }\");");
}
println(" " + action.content);
println(" }");
println(" } // fall though");
println(" case " + (++last) + ": break;");
}
}
Expand Down