Skip to content

Commit 4b5b849

Browse files
committed
Testing
1 parent 5ea83ca commit 4b5b849

1 file changed

Lines changed: 1 addition & 39 deletions

File tree

lib/prism/lex_compat.rb

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -233,33 +233,6 @@ def ==(other) # :nodoc:
233233
end
234234
end
235235

236-
# Ident tokens for the most part are exactly the same, except sometimes we
237-
# know an ident is a local when ripper doesn't (when they are introduced
238-
# through named captures in regular expressions). In that case we don't
239-
# compare the state.
240-
class IdentToken < Token
241-
def ==(other) # :nodoc:
242-
(self[0...-1] == other[0...-1]) && (
243-
(other[3] == Translation::Ripper::EXPR_LABEL | Translation::Ripper::EXPR_END) ||
244-
(other[3] & (Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_CMDARG) != 0)
245-
)
246-
end
247-
end
248-
249-
# Ignored newlines can occasionally have a LABEL state attached to them, so
250-
# we compare the state differently here.
251-
class IgnoredNewlineToken < Token
252-
def ==(other) # :nodoc:
253-
return false unless self[0...-1] == other[0...-1]
254-
255-
if self[3] == Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_LABELED
256-
other[3] & Translation::Ripper::EXPR_ARG | Translation::Ripper::EXPR_LABELED != 0
257-
else
258-
self[3] == other[3]
259-
end
260-
end
261-
end
262-
263236
# If we have an identifier that follows a method name like:
264237
#
265238
# def foo bar
@@ -695,23 +668,12 @@ def result
695668
# parent scope named bar because it hasn't pushed the local table
696669
# yet. We do this more accurately, so we need to allow comparing
697670
# against both END and END|LABEL.
698-
ParamToken.new([[lineno, column], event, value, lex_state])
699-
elsif lex_state == Translation::Ripper::EXPR_END | Translation::Ripper::EXPR_LABEL
700-
# In the event that we're comparing identifiers, we're going to
701-
# allow a little divergence. Ripper doesn't account for local
702-
# variables introduced through named captures in regexes, and we
703-
# do, which accounts for this difference.
704-
IdentToken.new([[lineno, column], event, value, lex_state])
671+
Token.new([[lineno, column], event, value, lex_state])
705672
else
706673
Token.new([[lineno, column], event, value, lex_state])
707674
end
708675
when :on_embexpr_end
709676
IgnoreStateToken.new([[lineno, column], event, value, lex_state])
710-
when :on_ignored_nl
711-
# Ignored newlines can occasionally have a LABEL state attached to
712-
# them which doesn't actually impact anything. We don't mirror that
713-
# state so we ignored it.
714-
IgnoredNewlineToken.new([[lineno, column], event, value, lex_state])
715677
when :on_regexp_end
716678
# On regex end, Ripper scans and then sets end state, so the ripper
717679
# lexed output is begin, when it should be end. prism sets lex state

0 commit comments

Comments
 (0)