Skip to content

Commit

Permalink
Rebase against main
Browse files Browse the repository at this point in the history
  • Loading branch information
kddnewton committed Feb 24, 2024
1 parent 7905bdb commit 813e20d
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 514 deletions.
1 change: 0 additions & 1 deletion Steepfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
target :lib do
signature "sig"

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

check "lib"
Expand Down
2 changes: 1 addition & 1 deletion lib/prism/parse_result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def character_column(byte_offset)
# concept of code units that differs from the number of characters in other
# encodings, it is not captured here.
def code_units_offset(byte_offset, encoding)
byteslice = source.byteslice(0, byte_offset).encode(encoding)
byteslice = (source.byteslice(0, byte_offset) or raise).encode(encoding)
(encoding == Encoding::UTF_16LE || encoding == Encoding::UTF_16BE) ? (byteslice.bytesize / 2) : byteslice.length
end

Expand Down
208 changes: 0 additions & 208 deletions lib/prism/ripper_compat.rb

This file was deleted.

4 changes: 0 additions & 4 deletions sig/_shims/symbol.rbs

This file was deleted.

1 change: 0 additions & 1 deletion sig/prism/_private/parse_result.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Prism
private

def find_line: (Integer) -> Integer
def compute_offsets: (String) -> Array[Integer]
end

class Location
Expand Down
8 changes: 0 additions & 8 deletions sig/prism/node_ext.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,10 @@ module Prism
def heredoc?: () -> bool?
end

class FloatNode < Node
def value: () -> Float
end

class ImaginaryNode < Node
def value: () -> Complex
end

class IntegerNode < Node
def value: () -> Integer
end

class RationalNode < Node
def value: () -> Rational
end
Expand Down
15 changes: 10 additions & 5 deletions sig/prism/parse_result.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module Prism
def column: (Integer byte_offset) -> Integer
def character_offset: (Integer byte_offset) -> Integer
def character_column: (Integer byte_offset) -> Integer
def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer
def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer
end

class Location
Expand Down Expand Up @@ -81,17 +83,19 @@ module Prism
class ParseError
attr_reader message: String
attr_reader location: Location
attr_reader level: Symbol

def initialize: (String message, Location location) -> void
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location }
def initialize: (String message, Location location, Symbol level) -> void
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location, level: Symbol }
end

class ParseWarning
attr_reader message: String
attr_reader location: Location
attr_reader level: Symbol

def initialize: (String message, Location location) -> void
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location }
def initialize: (String message, Location location, Symbol level) -> void
def deconstruct_keys: (Array[Symbol] keys) -> { message: String, location: Location, level: Symbol }
end

class ParseResult[out T]
Expand All @@ -110,11 +114,12 @@ module Prism
end

class Token
attr_reader source: Source
attr_reader type: Symbol
attr_reader value: String
attr_reader location: Location

def initialize: (Symbol type, String value, Location location) -> void
def initialize: (Source source, Symbol type, String value, Location location) -> void
def deconstruct_keys: (Array[Symbol] keys) -> { type: Symbol, value: String, location: Location }
def pretty_print: (untyped q) -> untyped
def ==: (untyped other) -> bool
Expand Down
22 changes: 0 additions & 22 deletions sig/prism/ripper_compat.rbs

This file was deleted.

Loading

0 comments on commit 813e20d

Please sign in to comment.