Skip to content

Commit 00b0956

Browse files
committed
[GR-16374] Add new ripper no-op methods.
PullRequest: truffleruby/883
2 parents 59a7908 + cd885bf commit 00b0956

File tree

5 files changed

+33
-1
lines changed

5 files changed

+33
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
Bug fixes:
44

55
* Sharing for thread-safety of objects is now triggered later as intended, e.g., when a second `Thread` is started.
6+
67
Compatibility:
78

89
* Exceptions from `coerce` are no longer rescued, like MRI.
910
* Implemented `Integer#{allbits?,anybits?,nobits?}`.
1011
* `Integer#{ceil,floor,truncate}` now accept a precision and `Integer#round` accepts a rounding mode.
1112
* Added missing `Enumerable#filter` and `Enumerator::Lazy#filter` aliases to the respective `select` method (#1610).
13+
* Implement more `Ripper` methods as no-ops (#1694).
1214

1315
# 20.0.0 beta 1
1416

lib/truffle/ripper.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,29 @@
1010

1111
class Ripper
1212

13+
def initialize(src, filename = '(ripper)', lineno = 1)
14+
end
15+
16+
def parse
17+
end
18+
19+
def column
20+
end
21+
22+
def state
23+
end
24+
25+
def yydebug
26+
false
27+
end
28+
29+
def end_seen?
30+
false
31+
end
32+
33+
def lineno
34+
end
35+
1336
class Filter
1437

1538
def initialize(src, filename='-', lineno=1)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exclude :test_yydebug_equals, "noop implementation"
2+
exclude :test_regexp_with_option, "noop implementation"
3+
exclude :test_regexp_enc_error, "noop implementation"
4+
exclude :test_filename, "noop implementation"
5+
exclude :test_encoding, "noop implementation"
6+
exclude :test_dedent_string, "noop implementation"
7+
exclude :test_end_seen_eh, "noop implementation"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude :test_invalid_gets, "noop implementation"

test/mri/failing.exclude

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ ripper/test_files.rb
1313
ripper/test_filter.rb
1414
ripper/test_lexer.rb
1515
ripper/test_parser_events.rb
16-
ripper/test_ripper.rb
1716
ripper/test_scanner_events.rb
1817
ripper/test_sexp.rb
1918
win32ole/test_err_in_callback.rb

0 commit comments

Comments
 (0)