Skip to content

Commit 813e20d

Browse files
committed
Rebase against main
1 parent 7905bdb commit 813e20d

File tree

13 files changed

+16
-514
lines changed

13 files changed

+16
-514
lines changed

Steepfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
target :lib do
44
signature "sig"
55

6-
# Tell Steep about any stdlib "require"s
76
library "cgi" # in lib/prism/dot_visitor.rb (Prism::DotVisitor)
87

98
check "lib"

lib/prism/parse_result.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def character_column(byte_offset)
6767
# concept of code units that differs from the number of characters in other
6868
# encodings, it is not captured here.
6969
def code_units_offset(byte_offset, encoding)
70-
byteslice = source.byteslice(0, byte_offset).encode(encoding)
70+
byteslice = (source.byteslice(0, byte_offset) or raise).encode(encoding)
7171
(encoding == Encoding::UTF_16LE || encoding == Encoding::UTF_16BE) ? (byteslice.bytesize / 2) : byteslice.length
7272
end
7373

lib/prism/ripper_compat.rb

Lines changed: 0 additions & 208 deletions
This file was deleted.

sig/_shims/symbol.rbs

Lines changed: 0 additions & 4 deletions
This file was deleted.

sig/prism/_private/parse_result.rbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module Prism
33
private
44

55
def find_line: (Integer) -> Integer
6-
def compute_offsets: (String) -> Array[Integer]
76
end
87

98
class Location

sig/prism/node_ext.rbs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,10 @@ module Prism
4343
def heredoc?: () -> bool?
4444
end
4545

46-
class FloatNode < Node
47-
def value: () -> Float
48-
end
49-
5046
class ImaginaryNode < Node
5147
def value: () -> Complex
5248
end
5349

54-
class IntegerNode < Node
55-
def value: () -> Integer
56-
end
57-
5850
class RationalNode < Node
5951
def value: () -> Rational
6052
end

sig/prism/parse_result.rbs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ module Prism
1313
def column: (Integer byte_offset) -> Integer
1414
def character_offset: (Integer byte_offset) -> Integer
1515
def character_column: (Integer byte_offset) -> Integer
16+
def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer
17+
def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer
1618
end
1719

1820
class Location
@@ -81,17 +83,19 @@ module Prism
8183
class ParseError
8284
attr_reader message: String
8385
attr_reader location: Location
86+
attr_reader level: Symbol
8487

85-
def initialize: (String message, Location location) -> void
86-
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location }
88+
def initialize: (String message, Location location, Symbol level) -> void
89+
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location, level: Symbol }
8790
end
8891

8992
class ParseWarning
9093
attr_reader message: String
9194
attr_reader location: Location
95+
attr_reader level: Symbol
9296

93-
def initialize: (String message, Location location) -> void
94-
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location }
97+
def initialize: (String message, Location location, Symbol level) -> void
98+
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location, level: Symbol }
9599
end
96100

97101
class ParseResult[out T]
@@ -110,11 +114,12 @@ module Prism
110114
end
111115

112116
class Token
117+
attr_reader source: Source
113118
attr_reader type: Symbol
114119
attr_reader value: String
115120
attr_reader location: Location
116121

117-
def initialize: (Symbol type, String value, Location location) -> void
122+
def initialize: (Source source, Symbol type, String value, Location location) -> void
118123
def deconstruct_keys: (Array[Symbol] keys) -> { type: Symbol, value: String, location: Location }
119124
def pretty_print: (untyped q) -> untyped
120125
def ==: (untyped other) -> bool

sig/prism/ripper_compat.rbs

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)