prism 1.1.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +39 -1
- data/Makefile +1 -1
- data/config.yml +422 -3
- data/docs/build_system.md +8 -11
- data/docs/relocation.md +34 -0
- data/ext/prism/api_node.c +18 -10
- data/ext/prism/extconf.rb +13 -36
- data/ext/prism/extension.c +68 -0
- data/ext/prism/extension.h +1 -1
- data/include/prism/ast.h +427 -3
- data/include/prism/defines.h +22 -7
- data/include/prism/diagnostic.h +1 -0
- data/include/prism/parser.h +25 -12
- data/include/prism/version.h +2 -2
- data/include/prism.h +47 -0
- data/lib/prism/dot_visitor.rb +10 -0
- data/lib/prism/dsl.rb +4 -4
- data/lib/prism/ffi.rb +49 -2
- data/lib/prism/inspect_visitor.rb +2 -0
- data/lib/prism/node.rb +1839 -96
- data/lib/prism/parse_result/errors.rb +1 -1
- data/lib/prism/parse_result.rb +140 -3
- data/lib/prism/reflection.rb +2 -2
- data/lib/prism/relocation.rb +504 -0
- data/lib/prism/serialize.rb +17 -5
- data/lib/prism/string_query.rb +30 -0
- data/lib/prism/translation/parser/compiler.rb +36 -26
- data/lib/prism/translation/parser.rb +3 -3
- data/lib/prism/translation/ripper.rb +1 -5
- data/lib/prism/translation/ruby_parser.rb +14 -5
- data/lib/prism.rb +6 -4
- data/prism.gemspec +7 -1
- data/rbi/prism/dsl.rbi +4 -4
- data/rbi/prism/node.rbi +5118 -1030
- data/rbi/prism/parse_result.rbi +29 -0
- data/rbi/prism/string_query.rbi +12 -0
- data/rbi/prism.rbi +34 -34
- data/sig/prism/dsl.rbs +2 -2
- data/sig/prism/node.rbs +13 -98
- data/sig/prism/parse_result.rbs +20 -0
- data/sig/prism/relocation.rbs +185 -0
- data/sig/prism/string_query.rbs +11 -0
- data/src/diagnostic.c +3 -1
- data/src/node.c +18 -0
- data/src/prettyprint.c +32 -0
- data/src/prism.c +586 -195
- data/src/regexp.c +7 -3
- data/src/serialize.c +12 -0
- data/src/static_literals.c +1 -1
- data/src/util/pm_char.c +1 -1
- data/src/util/pm_string.c +1 -0
- metadata +9 -3
data/rbi/prism/parse_result.rbi
CHANGED
@@ -40,10 +40,21 @@ class Prism::Source
|
|
40
40
|
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
|
41
41
|
def code_units_offset(byte_offset, encoding); end
|
42
42
|
|
43
|
+
sig { params(encoding: Encoding).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) }
|
44
|
+
def code_units_cache(encoding); end
|
45
|
+
|
43
46
|
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
|
44
47
|
def code_units_column(byte_offset, encoding); end
|
45
48
|
end
|
46
49
|
|
50
|
+
class Prism::CodeUnitsCache
|
51
|
+
sig { params(source: String, encoding: Encoding).void }
|
52
|
+
def initialize(source, encoding); end
|
53
|
+
|
54
|
+
sig { params(byte_offset: Integer).returns(Integer) }
|
55
|
+
def [](byte_offset); end
|
56
|
+
end
|
57
|
+
|
47
58
|
class Prism::ASCIISource < Prism::Source
|
48
59
|
sig { params(byte_offset: Integer).returns(Integer) }
|
49
60
|
def character_offset(byte_offset); end
|
@@ -54,6 +65,9 @@ class Prism::ASCIISource < Prism::Source
|
|
54
65
|
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
|
55
66
|
def code_units_offset(byte_offset, encoding); end
|
56
67
|
|
68
|
+
sig { params(encoding: Encoding).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) }
|
69
|
+
def code_units_cache(encoding); end
|
70
|
+
|
57
71
|
sig { params(byte_offset: Integer, encoding: Encoding).returns(Integer) }
|
58
72
|
def code_units_column(byte_offset, encoding); end
|
59
73
|
end
|
@@ -107,6 +121,9 @@ class Prism::Location
|
|
107
121
|
sig { params(encoding: Encoding).returns(Integer) }
|
108
122
|
def start_code_units_offset(encoding = Encoding::UTF_16LE); end
|
109
123
|
|
124
|
+
sig { params(cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))).returns(Integer) }
|
125
|
+
def cached_start_code_units_offset(cache); end
|
126
|
+
|
110
127
|
sig { returns(Integer) }
|
111
128
|
def end_offset; end
|
112
129
|
|
@@ -116,6 +133,9 @@ class Prism::Location
|
|
116
133
|
sig { params(encoding: Encoding).returns(Integer) }
|
117
134
|
def end_code_units_offset(encoding = Encoding::UTF_16LE); end
|
118
135
|
|
136
|
+
sig { params(cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))).returns(Integer) }
|
137
|
+
def cached_end_code_units_offset(cache); end
|
138
|
+
|
119
139
|
sig { returns(Integer) }
|
120
140
|
def start_line; end
|
121
141
|
|
@@ -134,6 +154,9 @@ class Prism::Location
|
|
134
154
|
sig { params(encoding: Encoding).returns(Integer) }
|
135
155
|
def start_code_units_column(encoding = Encoding::UTF_16LE); end
|
136
156
|
|
157
|
+
sig { params(cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))).returns(Integer) }
|
158
|
+
def cached_start_code_units_column(cache); end
|
159
|
+
|
137
160
|
sig { returns(Integer) }
|
138
161
|
def end_column; end
|
139
162
|
|
@@ -143,6 +166,9 @@ class Prism::Location
|
|
143
166
|
sig { params(encoding: Encoding).returns(Integer) }
|
144
167
|
def end_code_units_column(encoding = Encoding::UTF_16LE); end
|
145
168
|
|
169
|
+
sig { params(cache: T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))).returns(Integer) }
|
170
|
+
def cached_end_code_units_column(cache); end
|
171
|
+
|
146
172
|
sig { params(keys: T.nilable(T::Array[Symbol])).returns(T::Hash[Symbol, T.untyped]) }
|
147
173
|
def deconstruct_keys(keys); end
|
148
174
|
|
@@ -296,6 +322,9 @@ class Prism::Result
|
|
296
322
|
|
297
323
|
sig { returns(T::Boolean) }
|
298
324
|
def failure?; end
|
325
|
+
|
326
|
+
sig { params(encoding: Encoding).returns(T.any(Prism::CodeUnitsCache, T.proc.params(byte_offset: Integer).returns(Integer))) }
|
327
|
+
def code_units_cache(encoding); end
|
299
328
|
end
|
300
329
|
|
301
330
|
class Prism::ParseResult < Prism::Result
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# typed: strict
|
2
|
+
|
3
|
+
class Prism::StringQuery
|
4
|
+
sig { params(string: String).returns(T::Boolean) }
|
5
|
+
def self.local?(string); end
|
6
|
+
|
7
|
+
sig { params(string: String).returns(T::Boolean) }
|
8
|
+
def self.constant?(string); end
|
9
|
+
|
10
|
+
sig { params(string: String).returns(T::Boolean) }
|
11
|
+
def self.method_name?(string); end
|
12
|
+
end
|
data/rbi/prism.rbi
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
# typed: strict
|
2
2
|
|
3
3
|
module Prism
|
4
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
|
5
|
-
def self.dump(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
4
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
|
5
|
+
def self.dump(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
6
6
|
|
7
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
|
8
|
-
def self.dump_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
7
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(String) }
|
8
|
+
def self.dump_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
9
9
|
|
10
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
|
11
|
-
def self.lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
10
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
|
11
|
+
def self.lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
12
12
|
|
13
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
|
14
|
-
def self.lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
13
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::LexResult) }
|
14
|
+
def self.lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
15
15
|
|
16
16
|
sig { params(source: String, options: T::Hash[Symbol, T.untyped]).returns(Prism::LexCompat::Result) }
|
17
17
|
def self.lex_compat(source, **options); end
|
@@ -22,42 +22,42 @@ module Prism
|
|
22
22
|
sig { params(source: String, serialized: String).returns(Prism::ParseResult) }
|
23
23
|
def self.load(source, serialized); end
|
24
24
|
|
25
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
26
|
-
def self.parse(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
25
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
26
|
+
def self.parse(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
27
27
|
|
28
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
29
|
-
def self.parse_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
28
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
29
|
+
def self.parse_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
30
30
|
|
31
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
|
32
|
-
def self.profile(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
31
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
|
32
|
+
def self.profile(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
33
33
|
|
34
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
|
35
|
-
def self.profile_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
34
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).void }
|
35
|
+
def self.profile_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
36
36
|
|
37
|
-
sig { params(stream: T.any(IO, StringIO), command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
38
|
-
def self.parse_stream(stream, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
37
|
+
sig { params(stream: T.any(IO, StringIO), command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseResult) }
|
38
|
+
def self.parse_stream(stream, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
39
39
|
|
40
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
|
41
|
-
def self.parse_comments(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
40
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(String, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
|
41
|
+
def self.parse_comments(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
42
42
|
|
43
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
|
44
|
-
def self.parse_file_comments(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
43
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Array[Prism::Comment]) }
|
44
|
+
def self.parse_file_comments(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
45
45
|
|
46
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
|
47
|
-
def self.parse_lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
46
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
|
47
|
+
def self.parse_lex(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
48
48
|
|
49
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
|
50
|
-
def self.parse_lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
49
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(Prism::ParseLexResult) }
|
50
|
+
def self.parse_lex_file(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
51
51
|
|
52
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
53
|
-
def self.parse_success?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
52
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
53
|
+
def self.parse_success?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
54
54
|
|
55
|
-
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
56
|
-
def self.parse_failure?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
55
|
+
sig { params(source: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), filepath: T.nilable(String), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
56
|
+
def self.parse_failure?(source, command_line: nil, encoding: nil, filepath: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
57
57
|
|
58
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
59
|
-
def self.parse_file_success?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
58
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
59
|
+
def self.parse_file_success?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
60
60
|
|
61
|
-
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
62
|
-
def self.parse_file_failure?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, scopes: nil, version: nil); end
|
61
|
+
sig { params(filepath: String, command_line: T.nilable(String), encoding: T.nilable(T.any(FalseClass, Encoding)), frozen_string_literal: T.nilable(T::Boolean), line: T.nilable(Integer), main_script: T.nilable(T::Boolean), partial_script: T.nilable(T::Boolean), scopes: T.nilable(T::Array[T::Array[Symbol]]), version: T.nilable(String)).returns(T::Boolean) }
|
62
|
+
def self.parse_file_failure?(filepath, command_line: nil, encoding: nil, frozen_string_literal: nil, line: nil, main_script: nil, partial_script: nil, scopes: nil, version: nil); end
|
63
63
|
end
|
data/sig/prism/dsl.rbs
CHANGED
@@ -300,11 +300,11 @@ module Prism
|
|
300
300
|
|
301
301
|
def unless_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?predicate: Prism::node, ?then_keyword_loc: Location?, ?statements: StatementsNode?, ?else_clause: ElseNode?, ?end_keyword_loc: Location?) -> UnlessNode
|
302
302
|
|
303
|
-
def until_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
|
303
|
+
def until_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
|
304
304
|
|
305
305
|
def when_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?conditions: Array[Prism::node], ?then_keyword_loc: Location?, ?statements: StatementsNode?) -> WhenNode
|
306
306
|
|
307
|
-
def while_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
|
307
|
+
def while_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
|
308
308
|
|
309
309
|
def x_string_node: (?source: Source, ?node_id: Integer, ?location: Location, ?flags: Integer, ?opening_loc: Location, ?content_loc: Location, ?closing_loc: Location, ?unescaped: String) -> XStringNode
|
310
310
|
|
data/sig/prism/node.rbs
CHANGED
@@ -138,13 +138,9 @@ module Prism
|
|
138
138
|
include _Node
|
139
139
|
|
140
140
|
def contains_forwarding?: () -> bool
|
141
|
-
|
142
141
|
def contains_keywords?: () -> bool
|
143
|
-
|
144
142
|
def contains_keyword_splat?: () -> bool
|
145
|
-
|
146
143
|
def contains_splat?: () -> bool
|
147
|
-
|
148
144
|
def contains_multiple_splats?: () -> bool
|
149
145
|
|
150
146
|
attr_reader arguments: Array[Prism::node]
|
@@ -188,8 +184,8 @@ module Prism
|
|
188
184
|
# foo in [1, 2]
|
189
185
|
# ^^^^^^^^^^^^^
|
190
186
|
#
|
191
|
-
# foo in *
|
192
|
-
#
|
187
|
+
# foo in *bar
|
188
|
+
# ^^^^^^^^^^^
|
193
189
|
#
|
194
190
|
# foo in Bar[]
|
195
191
|
# ^^^^^^^^^^^^
|
@@ -435,11 +431,8 @@ module Prism
|
|
435
431
|
include _Node
|
436
432
|
|
437
433
|
def safe_navigation?: () -> bool
|
438
|
-
|
439
434
|
def variable_call?: () -> bool
|
440
|
-
|
441
435
|
def attribute_write?: () -> bool
|
442
|
-
|
443
436
|
def ignore_visibility?: () -> bool
|
444
437
|
|
445
438
|
attr_reader receiver: Prism::node?
|
@@ -484,11 +477,8 @@ module Prism
|
|
484
477
|
include _Node
|
485
478
|
|
486
479
|
def safe_navigation?: () -> bool
|
487
|
-
|
488
480
|
def variable_call?: () -> bool
|
489
|
-
|
490
481
|
def attribute_write?: () -> bool
|
491
|
-
|
492
482
|
def ignore_visibility?: () -> bool
|
493
483
|
|
494
484
|
attr_reader receiver: Prism::node?
|
@@ -520,11 +510,8 @@ module Prism
|
|
520
510
|
include _Node
|
521
511
|
|
522
512
|
def safe_navigation?: () -> bool
|
523
|
-
|
524
513
|
def variable_call?: () -> bool
|
525
|
-
|
526
514
|
def attribute_write?: () -> bool
|
527
|
-
|
528
515
|
def ignore_visibility?: () -> bool
|
529
516
|
|
530
517
|
attr_reader receiver: Prism::node?
|
@@ -554,11 +541,8 @@ module Prism
|
|
554
541
|
include _Node
|
555
542
|
|
556
543
|
def safe_navigation?: () -> bool
|
557
|
-
|
558
544
|
def variable_call?: () -> bool
|
559
|
-
|
560
545
|
def attribute_write?: () -> bool
|
561
|
-
|
562
546
|
def ignore_visibility?: () -> bool
|
563
547
|
|
564
548
|
attr_reader receiver: Prism::node?
|
@@ -596,11 +580,8 @@ module Prism
|
|
596
580
|
include _Node
|
597
581
|
|
598
582
|
def safe_navigation?: () -> bool
|
599
|
-
|
600
583
|
def variable_call?: () -> bool
|
601
|
-
|
602
584
|
def attribute_write?: () -> bool
|
603
|
-
|
604
585
|
def ignore_visibility?: () -> bool
|
605
586
|
|
606
587
|
attr_reader receiver: Prism::node
|
@@ -1678,11 +1659,8 @@ module Prism
|
|
1678
1659
|
include _Node
|
1679
1660
|
|
1680
1661
|
def safe_navigation?: () -> bool
|
1681
|
-
|
1682
1662
|
def variable_call?: () -> bool
|
1683
|
-
|
1684
1663
|
def attribute_write?: () -> bool
|
1685
|
-
|
1686
1664
|
def ignore_visibility?: () -> bool
|
1687
1665
|
|
1688
1666
|
attr_reader receiver: Prism::node?
|
@@ -1714,11 +1692,8 @@ module Prism
|
|
1714
1692
|
include _Node
|
1715
1693
|
|
1716
1694
|
def safe_navigation?: () -> bool
|
1717
|
-
|
1718
1695
|
def variable_call?: () -> bool
|
1719
|
-
|
1720
1696
|
def attribute_write?: () -> bool
|
1721
|
-
|
1722
1697
|
def ignore_visibility?: () -> bool
|
1723
1698
|
|
1724
1699
|
attr_reader receiver: Prism::node?
|
@@ -1750,11 +1725,8 @@ module Prism
|
|
1750
1725
|
include _Node
|
1751
1726
|
|
1752
1727
|
def safe_navigation?: () -> bool
|
1753
|
-
|
1754
1728
|
def variable_call?: () -> bool
|
1755
|
-
|
1756
1729
|
def attribute_write?: () -> bool
|
1757
|
-
|
1758
1730
|
def ignore_visibility?: () -> bool
|
1759
1731
|
|
1760
1732
|
attr_reader receiver: Prism::node?
|
@@ -1794,11 +1766,8 @@ module Prism
|
|
1794
1766
|
include _Node
|
1795
1767
|
|
1796
1768
|
def safe_navigation?: () -> bool
|
1797
|
-
|
1798
1769
|
def variable_call?: () -> bool
|
1799
|
-
|
1800
1770
|
def attribute_write?: () -> bool
|
1801
|
-
|
1802
1771
|
def ignore_visibility?: () -> bool
|
1803
1772
|
|
1804
1773
|
attr_reader receiver: Prism::node
|
@@ -1943,11 +1912,8 @@ module Prism
|
|
1943
1912
|
include _Node
|
1944
1913
|
|
1945
1914
|
def binary?: () -> bool
|
1946
|
-
|
1947
1915
|
def decimal?: () -> bool
|
1948
|
-
|
1949
1916
|
def octal?: () -> bool
|
1950
|
-
|
1951
1917
|
def hexadecimal?: () -> bool
|
1952
1918
|
|
1953
1919
|
attr_reader value: Integer
|
@@ -1968,25 +1934,15 @@ module Prism
|
|
1968
1934
|
include _Node
|
1969
1935
|
|
1970
1936
|
def ignore_case?: () -> bool
|
1971
|
-
|
1972
1937
|
def extended?: () -> bool
|
1973
|
-
|
1974
1938
|
def multi_line?: () -> bool
|
1975
|
-
|
1976
1939
|
def once?: () -> bool
|
1977
|
-
|
1978
1940
|
def euc_jp?: () -> bool
|
1979
|
-
|
1980
1941
|
def ascii_8bit?: () -> bool
|
1981
|
-
|
1982
1942
|
def windows_31j?: () -> bool
|
1983
|
-
|
1984
1943
|
def utf_8?: () -> bool
|
1985
|
-
|
1986
1944
|
def forced_utf8_encoding?: () -> bool
|
1987
|
-
|
1988
1945
|
def forced_binary_encoding?: () -> bool
|
1989
|
-
|
1990
1946
|
def forced_us_ascii_encoding?: () -> bool
|
1991
1947
|
|
1992
1948
|
attr_reader opening_loc: Location
|
@@ -2011,25 +1967,15 @@ module Prism
|
|
2011
1967
|
include _Node
|
2012
1968
|
|
2013
1969
|
def ignore_case?: () -> bool
|
2014
|
-
|
2015
1970
|
def extended?: () -> bool
|
2016
|
-
|
2017
1971
|
def multi_line?: () -> bool
|
2018
|
-
|
2019
1972
|
def once?: () -> bool
|
2020
|
-
|
2021
1973
|
def euc_jp?: () -> bool
|
2022
|
-
|
2023
1974
|
def ascii_8bit?: () -> bool
|
2024
|
-
|
2025
1975
|
def windows_31j?: () -> bool
|
2026
|
-
|
2027
1976
|
def utf_8?: () -> bool
|
2028
|
-
|
2029
1977
|
def forced_utf8_encoding?: () -> bool
|
2030
|
-
|
2031
1978
|
def forced_binary_encoding?: () -> bool
|
2032
|
-
|
2033
1979
|
def forced_us_ascii_encoding?: () -> bool
|
2034
1980
|
|
2035
1981
|
attr_reader opening_loc: Location
|
@@ -2054,7 +2000,6 @@ module Prism
|
|
2054
2000
|
include _Node
|
2055
2001
|
|
2056
2002
|
def frozen?: () -> bool
|
2057
|
-
|
2058
2003
|
def mutable?: () -> bool
|
2059
2004
|
|
2060
2005
|
attr_reader opening_loc: Location?
|
@@ -2344,25 +2289,15 @@ module Prism
|
|
2344
2289
|
include _Node
|
2345
2290
|
|
2346
2291
|
def ignore_case?: () -> bool
|
2347
|
-
|
2348
2292
|
def extended?: () -> bool
|
2349
|
-
|
2350
2293
|
def multi_line?: () -> bool
|
2351
|
-
|
2352
2294
|
def once?: () -> bool
|
2353
|
-
|
2354
2295
|
def euc_jp?: () -> bool
|
2355
|
-
|
2356
2296
|
def ascii_8bit?: () -> bool
|
2357
|
-
|
2358
2297
|
def windows_31j?: () -> bool
|
2359
|
-
|
2360
2298
|
def utf_8?: () -> bool
|
2361
|
-
|
2362
2299
|
def forced_utf8_encoding?: () -> bool
|
2363
|
-
|
2364
2300
|
def forced_binary_encoding?: () -> bool
|
2365
|
-
|
2366
2301
|
def forced_us_ascii_encoding?: () -> bool
|
2367
2302
|
|
2368
2303
|
attr_reader opening_loc: Location
|
@@ -2867,11 +2802,8 @@ module Prism
|
|
2867
2802
|
include _Node
|
2868
2803
|
|
2869
2804
|
def binary?: () -> bool
|
2870
|
-
|
2871
2805
|
def decimal?: () -> bool
|
2872
|
-
|
2873
2806
|
def octal?: () -> bool
|
2874
|
-
|
2875
2807
|
def hexadecimal?: () -> bool
|
2876
2808
|
|
2877
2809
|
attr_reader numerator: Integer
|
@@ -2909,25 +2841,15 @@ module Prism
|
|
2909
2841
|
include _Node
|
2910
2842
|
|
2911
2843
|
def ignore_case?: () -> bool
|
2912
|
-
|
2913
2844
|
def extended?: () -> bool
|
2914
|
-
|
2915
2845
|
def multi_line?: () -> bool
|
2916
|
-
|
2917
2846
|
def once?: () -> bool
|
2918
|
-
|
2919
2847
|
def euc_jp?: () -> bool
|
2920
|
-
|
2921
2848
|
def ascii_8bit?: () -> bool
|
2922
|
-
|
2923
2849
|
def windows_31j?: () -> bool
|
2924
|
-
|
2925
2850
|
def utf_8?: () -> bool
|
2926
|
-
|
2927
2851
|
def forced_utf8_encoding?: () -> bool
|
2928
|
-
|
2929
2852
|
def forced_binary_encoding?: () -> bool
|
2930
|
-
|
2931
2853
|
def forced_us_ascii_encoding?: () -> bool
|
2932
2854
|
|
2933
2855
|
attr_reader opening_loc: Location
|
@@ -3015,7 +2937,7 @@ module Prism
|
|
3015
2937
|
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
3016
2938
|
# end
|
3017
2939
|
#
|
3018
|
-
# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `
|
2940
|
+
# `Foo, *splat, Bar` are in the `exceptions` field. `ex` is in the `reference` field.
|
3019
2941
|
class RescueNode < Node
|
3020
2942
|
include _Node
|
3021
2943
|
|
@@ -3119,9 +3041,7 @@ module Prism
|
|
3119
3041
|
include _Node
|
3120
3042
|
|
3121
3043
|
def literal?: () -> bool
|
3122
|
-
|
3123
3044
|
def experimental_everything?: () -> bool
|
3124
|
-
|
3125
3045
|
def experimental_copy?: () -> bool
|
3126
3046
|
|
3127
3047
|
attr_reader write: ConstantWriteNode | ConstantAndWriteNode | ConstantOrWriteNode | ConstantOperatorWriteNode | ConstantPathWriteNode | ConstantPathAndWriteNode | ConstantPathOrWriteNode | ConstantPathOperatorWriteNode
|
@@ -3183,11 +3103,8 @@ module Prism
|
|
3183
3103
|
include _Node
|
3184
3104
|
|
3185
3105
|
def forced_utf8_encoding?: () -> bool
|
3186
|
-
|
3187
3106
|
def forced_binary_encoding?: () -> bool
|
3188
|
-
|
3189
3107
|
def frozen?: () -> bool
|
3190
|
-
|
3191
3108
|
def mutable?: () -> bool
|
3192
3109
|
|
3193
3110
|
attr_reader filepath: String
|
@@ -3266,11 +3183,8 @@ module Prism
|
|
3266
3183
|
include _Node
|
3267
3184
|
|
3268
3185
|
def forced_utf8_encoding?: () -> bool
|
3269
|
-
|
3270
3186
|
def forced_binary_encoding?: () -> bool
|
3271
|
-
|
3272
3187
|
def frozen?: () -> bool
|
3273
|
-
|
3274
3188
|
def mutable?: () -> bool
|
3275
3189
|
|
3276
3190
|
attr_reader opening_loc: Location?
|
@@ -3327,9 +3241,7 @@ module Prism
|
|
3327
3241
|
include _Node
|
3328
3242
|
|
3329
3243
|
def forced_utf8_encoding?: () -> bool
|
3330
|
-
|
3331
3244
|
def forced_binary_encoding?: () -> bool
|
3332
|
-
|
3333
3245
|
def forced_us_ascii_encoding?: () -> bool
|
3334
3246
|
|
3335
3247
|
attr_reader opening_loc: Location?
|
@@ -3424,14 +3336,16 @@ module Prism
|
|
3424
3336
|
def begin_modifier?: () -> bool
|
3425
3337
|
|
3426
3338
|
attr_reader keyword_loc: Location
|
3339
|
+
attr_reader do_keyword_loc: Location?
|
3427
3340
|
attr_reader closing_loc: Location?
|
3428
3341
|
attr_reader predicate: Prism::node
|
3429
3342
|
attr_reader statements: StatementsNode?
|
3430
3343
|
|
3431
|
-
def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
|
3432
|
-
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
|
3433
|
-
def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
|
3344
|
+
def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
|
3345
|
+
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> UntilNode
|
3346
|
+
def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
|
3434
3347
|
def keyword: () -> String
|
3348
|
+
def do_keyword: () -> String?
|
3435
3349
|
def closing: () -> String?
|
3436
3350
|
def type: () -> :until_node
|
3437
3351
|
| ...
|
@@ -3475,14 +3389,16 @@ module Prism
|
|
3475
3389
|
def begin_modifier?: () -> bool
|
3476
3390
|
|
3477
3391
|
attr_reader keyword_loc: Location
|
3392
|
+
attr_reader do_keyword_loc: Location?
|
3478
3393
|
attr_reader closing_loc: Location?
|
3479
3394
|
attr_reader predicate: Prism::node
|
3480
3395
|
attr_reader statements: StatementsNode?
|
3481
3396
|
|
3482
|
-
def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
|
3483
|
-
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
|
3484
|
-
def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
|
3397
|
+
def initialize: (Source source, Integer node_id, Location location, Integer flags, Location keyword_loc, Location? do_keyword_loc, Location? closing_loc, Prism::node predicate, StatementsNode? statements) -> void
|
3398
|
+
def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?keyword_loc: Location, ?do_keyword_loc: Location?, ?closing_loc: Location?, ?predicate: Prism::node, ?statements: StatementsNode?) -> WhileNode
|
3399
|
+
def deconstruct_keys: (Array[Symbol] keys) -> { node_id: Integer, location: Location, keyword_loc: Location, do_keyword_loc: Location?, closing_loc: Location?, predicate: Prism::node, statements: StatementsNode? }
|
3485
3400
|
def keyword: () -> String
|
3401
|
+
def do_keyword: () -> String?
|
3486
3402
|
def closing: () -> String?
|
3487
3403
|
def type: () -> :while_node
|
3488
3404
|
| ...
|
@@ -3497,7 +3413,6 @@ module Prism
|
|
3497
3413
|
include _Node
|
3498
3414
|
|
3499
3415
|
def forced_utf8_encoding?: () -> bool
|
3500
|
-
|
3501
3416
|
def forced_binary_encoding?: () -> bool
|
3502
3417
|
|
3503
3418
|
attr_reader opening_loc: Location
|
data/sig/prism/parse_result.rbs
CHANGED
@@ -1,4 +1,8 @@
|
|
1
1
|
module Prism
|
2
|
+
interface _CodeUnitsCache
|
3
|
+
def []: (Integer byte_offset) -> Integer
|
4
|
+
end
|
5
|
+
|
2
6
|
class Source
|
3
7
|
attr_reader source: String
|
4
8
|
attr_reader start_line: Integer
|
@@ -16,15 +20,22 @@ module Prism
|
|
16
20
|
def character_offset: (Integer byte_offset) -> Integer
|
17
21
|
def character_column: (Integer byte_offset) -> Integer
|
18
22
|
def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer
|
23
|
+
def code_units_cache: (Encoding encoding) -> _CodeUnitsCache
|
19
24
|
def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer
|
20
25
|
|
21
26
|
def self.for: (String source) -> Source
|
22
27
|
end
|
23
28
|
|
29
|
+
class CodeUnitsCache
|
30
|
+
def initialize: (String source, Encoding encoding) -> void
|
31
|
+
def []: (Integer byte_offset) -> Integer
|
32
|
+
end
|
33
|
+
|
24
34
|
class ASCIISource < Source
|
25
35
|
def character_offset: (Integer byte_offset) -> Integer
|
26
36
|
def character_column: (Integer byte_offset) -> Integer
|
27
37
|
def code_units_offset: (Integer byte_offset, Encoding encoding) -> Integer
|
38
|
+
def code_units_cache: (Encoding encoding) -> _CodeUnitsCache
|
28
39
|
def code_units_column: (Integer byte_offset, Encoding encoding) -> Integer
|
29
40
|
end
|
30
41
|
|
@@ -45,15 +56,23 @@ module Prism
|
|
45
56
|
def slice: () -> String
|
46
57
|
def slice_lines: () -> String
|
47
58
|
def start_character_offset: () -> Integer
|
59
|
+
def start_code_units_offset: (Encoding encoding) -> Integer
|
60
|
+
def cached_start_code_units_offset: (_CodeUnitsCache cache) -> Integer
|
48
61
|
def end_offset: () -> Integer
|
49
62
|
def end_character_offset: () -> Integer
|
63
|
+
def end_code_units_offset: (Encoding encoding) -> Integer
|
64
|
+
def cached_end_code_units_offset: (_CodeUnitsCache cache) -> Integer
|
50
65
|
def start_line: () -> Integer
|
51
66
|
def start_line_slice: () -> String
|
52
67
|
def end_line: () -> Integer
|
53
68
|
def start_column: () -> Integer
|
54
69
|
def start_character_column: () -> Integer
|
70
|
+
def start_code_units_column: (Encoding encoding) -> Integer
|
71
|
+
def cached_start_code_units_column: (_CodeUnitsCache cache) -> Integer
|
55
72
|
def end_column: () -> Integer
|
56
73
|
def end_character_column: () -> Integer
|
74
|
+
def end_code_units_column: (Encoding encoding) -> Integer
|
75
|
+
def cached_end_code_units_column: (_CodeUnitsCache cache) -> Integer
|
57
76
|
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
58
77
|
def pretty_print: (untyped q) -> untyped
|
59
78
|
def join: (Location other) -> Location
|
@@ -125,6 +144,7 @@ module Prism
|
|
125
144
|
def deconstruct_keys: (Array[Symbol]? keys) -> Hash[Symbol, untyped]
|
126
145
|
def success?: () -> bool
|
127
146
|
def failure?: () -> bool
|
147
|
+
def code_units_cache: (Encoding encoding) -> _CodeUnitsCache
|
128
148
|
end
|
129
149
|
|
130
150
|
class ParseResult < Result
|