Skip to content

Commit 66f8f3e

Browse files
committed
MRI and their fall-throughs in switches
1 parent 41fc369 commit 66f8f3e

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

core/src/main/java/org/jruby/ext/ripper/HeredocTerm.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,10 @@ public int parseString(RubyLexer lexer, LexerSource src) throws java.io.IOExcept
142142
switch(lexer.p(pend-1)) {
143143
case '\n':
144144
pend--;
145-
if (pend == p || lexer.p(pend-1) == '\r') {
146-
pend--;
145+
if (pend == p || lexer.p(pend - 1) != '\r') {
146+
pend++;
147147
break;
148148
}
149-
break;
150149
case '\r':
151150
pend--;
152151
break;

core/src/main/java/org/jruby/lexer/yacc/HeredocTerm.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ public int parseString(RubyLexer lexer) throws java.io.IOException {
125125
switch (lexer.p(pend - 1)) {
126126
case '\n':
127127
pend--;
128-
if (pend == p || lexer.p(pend - 1) == '\r') {
129-
pend--;
128+
if (pend == p || lexer.p(pend - 1) != '\r') {
129+
pend++;
130130
break;
131131
}
132-
break;
133132
case '\r':
134133
pend--;
135134
break;

0 commit comments

Comments
 (0)