konstruo 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +22 -0
- data/.tool-versions +1 -0
- data/CHANGELOG.md +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +35 -0
- data/Rakefile +10 -0
- data/lib/konstruo/mapper.rb +120 -0
- data/lib/konstruo/version.rb +6 -0
- data/lib/konstruo.rb +18 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/actionmailer.rbi +10 -0
- data/sorbet/rbi/annotations/actionpack.rbi +430 -0
- data/sorbet/rbi/annotations/actionview.rbi +75 -0
- data/sorbet/rbi/annotations/activejob.rbi +44 -0
- data/sorbet/rbi/annotations/activemodel.rbi +89 -0
- data/sorbet/rbi/annotations/activerecord.rbi +92 -0
- data/sorbet/rbi/annotations/activesupport.rbi +454 -0
- data/sorbet/rbi/annotations/globalid.rbi +30 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/railties.rbi +61 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/actioncable@7.2.1.rbi +3096 -0
- data/sorbet/rbi/gems/actionmailbox@7.2.1.rbi +1832 -0
- data/sorbet/rbi/gems/actionmailer@7.2.1.rbi +2664 -0
- data/sorbet/rbi/gems/actionpack@7.2.1.rbi +20536 -0
- data/sorbet/rbi/gems/actiontext@7.2.1.rbi +1697 -0
- data/sorbet/rbi/gems/actionview@7.2.1.rbi +15752 -0
- data/sorbet/rbi/gems/activejob@7.2.1.rbi +2828 -0
- data/sorbet/rbi/gems/activemodel@7.2.1.rbi +6762 -0
- data/sorbet/rbi/gems/activerecord@7.2.1.rbi +41433 -0
- data/sorbet/rbi/gems/activestorage@7.2.1.rbi +3247 -0
- data/sorbet/rbi/gems/activesupport@7.2.1.rbi +21142 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
- data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
- data/sorbet/rbi/gems/bigdecimal@3.1.8.rbi +78 -0
- data/sorbet/rbi/gems/builder@3.3.0.rbi +9 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.3.4.rbi +11645 -0
- data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
- data/sorbet/rbi/gems/crass@1.0.6.rbi +623 -0
- data/sorbet/rbi/gems/dashbrains-rubocop-config@1.0.4.rbi +9 -0
- data/sorbet/rbi/gems/date@3.3.4.rbi +75 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +1131 -0
- data/sorbet/rbi/gems/drb@2.2.1.rbi +1347 -0
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
- data/sorbet/rbi/gems/globalid@1.2.1.rbi +749 -0
- data/sorbet/rbi/gems/i18n@1.14.5.rbi +2359 -0
- data/sorbet/rbi/gems/io-console@0.7.2.rbi +9 -0
- data/sorbet/rbi/gems/json@2.7.2.rbi +1562 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
- data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
- data/sorbet/rbi/gems/loofah@2.22.0.rbi +1081 -0
- data/sorbet/rbi/gems/mail@2.8.1.rbi +8658 -0
- data/sorbet/rbi/gems/marcel@1.0.4.rbi +239 -0
- data/sorbet/rbi/gems/mini_mime@1.1.5.rbi +173 -0
- data/sorbet/rbi/gems/minitest@5.25.1.rbi +1546 -0
- data/sorbet/rbi/gems/net-imap@0.4.16.rbi +10845 -0
- data/sorbet/rbi/gems/net-pop@0.1.2.rbi +927 -0
- data/sorbet/rbi/gems/net-protocol@0.2.2.rbi +292 -0
- data/sorbet/rbi/gems/net-smtp@0.5.0.rbi +1228 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/nio4r@2.7.3.rbi +293 -0
- data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
- data/sorbet/rbi/gems/parallel@1.26.3.rbi +291 -0
- data/sorbet/rbi/gems/parser@3.3.5.0.rbi +5519 -0
- data/sorbet/rbi/gems/prism@1.0.0.rbi +35493 -0
- data/sorbet/rbi/gems/psych@5.1.2.rbi +1769 -0
- data/sorbet/rbi/gems/racc@1.8.1.rbi +162 -0
- data/sorbet/rbi/gems/rack-session@2.0.0.rbi +727 -0
- data/sorbet/rbi/gems/rack-test@2.1.0.rbi +747 -0
- data/sorbet/rbi/gems/rack@3.1.7.rbi +4902 -0
- data/sorbet/rbi/gems/rackup@2.1.0.rbi +390 -0
- data/sorbet/rbi/gems/rails-dom-testing@2.2.0.rbi +758 -0
- data/sorbet/rbi/gems/rails-html-sanitizer@1.6.0.rbi +785 -0
- data/sorbet/rbi/gems/rails@7.2.1.rbi +9 -0
- data/sorbet/rbi/gems/railties@7.2.1.rbi +3824 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake@13.2.1.rbi +3046 -0
- data/sorbet/rbi/gems/rbi@0.2.0.rbi +4105 -0
- data/sorbet/rbi/gems/rdoc@6.7.0.rbi +12721 -0
- data/sorbet/rbi/gems/regexp_parser@2.9.2.rbi +3772 -0
- data/sorbet/rbi/gems/reline@0.5.10.rbi +9 -0
- data/sorbet/rbi/gems/rspec-core@3.13.1.rbi +11012 -0
- data/sorbet/rbi/gems/rspec-expectations@3.13.3.rbi +8183 -0
- data/sorbet/rbi/gems/rspec-mocks@3.13.1.rbi +5341 -0
- data/sorbet/rbi/gems/rspec-support@3.13.1.rbi +1630 -0
- data/sorbet/rbi/gems/rspec@3.13.0.rbi +83 -0
- data/sorbet/rbi/gems/rubocop-ast@1.32.3.rbi +7446 -0
- data/sorbet/rbi/gems/rubocop-capybara@2.21.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-factory_bot@2.26.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-graphql@1.5.4.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-minitest@0.36.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-performance@1.21.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rails@2.26.1.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
- data/sorbet/rbi/gems/rubocop-rspec@3.0.5.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-rspec_rails@2.30.0.rbi +9 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.8.5.rbi +9 -0
- data/sorbet/rbi/gems/rubocop@1.66.1.rbi +58268 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/securerandom@0.3.1.rbi +396 -0
- data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
- data/sorbet/rbi/gems/stringio@3.1.1.rbi +9 -0
- data/sorbet/rbi/gems/tapioca@0.16.2.rbi +3581 -0
- data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
- data/sorbet/rbi/gems/timeout@0.4.1.rbi +149 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
- data/sorbet/rbi/gems/useragent@0.16.10.rbi +9 -0
- data/sorbet/rbi/gems/webrick@1.8.1.rbi +2607 -0
- data/sorbet/rbi/gems/websocket-driver@0.7.6.rbi +993 -0
- data/sorbet/rbi/gems/websocket-extensions@0.1.5.rbi +121 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.37.rbi +18570 -0
- data/sorbet/rbi/gems/zeitwerk@2.6.18.rbi +1051 -0
- data/sorbet/rbi/todo.rbi +6 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +9 -0
- data/tasks/bundle_update.rake +14 -0
- data/tasks/sorbet.rake +26 -0
- metadata +216 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `connection_pool` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem connection_pool`.
|
6
|
+
|
7
|
+
|
8
|
+
# THIS IS AN EMPTY RBI FILE.
|
9
|
+
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|
@@ -0,0 +1,623 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `crass` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem crass`.
|
6
|
+
|
7
|
+
|
8
|
+
# A CSS parser based on the CSS Syntax Module Level 3 spec.
|
9
|
+
#
|
10
|
+
# source://crass//lib/crass/token-scanner.rb#3
|
11
|
+
module Crass
|
12
|
+
class << self
|
13
|
+
# Parses _input_ as a CSS stylesheet and returns a parse tree.
|
14
|
+
#
|
15
|
+
# See {Tokenizer#initialize} for _options_.
|
16
|
+
#
|
17
|
+
# source://crass//lib/crass.rb#10
|
18
|
+
def parse(input, options = T.unsafe(nil)); end
|
19
|
+
|
20
|
+
# Parses _input_ as a string of CSS properties (such as the contents of an
|
21
|
+
# HTML element's `style` attribute) and returns a parse tree.
|
22
|
+
#
|
23
|
+
# See {Tokenizer#initialize} for _options_.
|
24
|
+
#
|
25
|
+
# source://crass//lib/crass.rb#18
|
26
|
+
def parse_properties(input, options = T.unsafe(nil)); end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
# Parses a CSS string or list of tokens.
|
31
|
+
#
|
32
|
+
# 5. http://dev.w3.org/csswg/css-syntax/#parsing
|
33
|
+
#
|
34
|
+
# source://crass//lib/crass/parser.rb#10
|
35
|
+
class Crass::Parser
|
36
|
+
# Initializes a parser based on the given _input_, which may be a CSS string
|
37
|
+
# or an array of tokens.
|
38
|
+
#
|
39
|
+
# See {Tokenizer#initialize} for _options_.
|
40
|
+
#
|
41
|
+
# @return [Parser] a new instance of Parser
|
42
|
+
#
|
43
|
+
# source://crass//lib/crass/parser.rb#126
|
44
|
+
def initialize(input, options = T.unsafe(nil)); end
|
45
|
+
|
46
|
+
# Consumes an at-rule and returns it.
|
47
|
+
#
|
48
|
+
# 5.4.2. http://dev.w3.org/csswg/css-syntax-3/#consume-at-rule
|
49
|
+
#
|
50
|
+
# source://crass//lib/crass/parser.rb#137
|
51
|
+
def consume_at_rule(input = T.unsafe(nil)); end
|
52
|
+
|
53
|
+
# Consumes a component value and returns it, or `nil` if there are no more
|
54
|
+
# tokens.
|
55
|
+
#
|
56
|
+
# 5.4.6. http://dev.w3.org/csswg/css-syntax-3/#consume-a-component-value
|
57
|
+
#
|
58
|
+
# source://crass//lib/crass/parser.rb#184
|
59
|
+
def consume_component_value(input = T.unsafe(nil)); end
|
60
|
+
|
61
|
+
# Consumes a declaration and returns it, or `nil` on parse error.
|
62
|
+
#
|
63
|
+
# 5.4.5. http://dev.w3.org/csswg/css-syntax-3/#consume-a-declaration
|
64
|
+
#
|
65
|
+
# source://crass//lib/crass/parser.rb#209
|
66
|
+
def consume_declaration(input = T.unsafe(nil)); end
|
67
|
+
|
68
|
+
# Consumes a list of declarations and returns them.
|
69
|
+
#
|
70
|
+
# By default, the returned list may include `:comment`, `:semicolon`, and
|
71
|
+
# `:whitespace` nodes, which is non-standard.
|
72
|
+
#
|
73
|
+
# Options:
|
74
|
+
#
|
75
|
+
# * **:strict** - Set to `true` to exclude non-standard `:comment`,
|
76
|
+
# `:semicolon`, and `:whitespace` nodes.
|
77
|
+
#
|
78
|
+
# 5.4.4. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-declarations
|
79
|
+
#
|
80
|
+
# source://crass//lib/crass/parser.rb#276
|
81
|
+
def consume_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
|
82
|
+
|
83
|
+
# Consumes a function and returns it.
|
84
|
+
#
|
85
|
+
# 5.4.8. http://dev.w3.org/csswg/css-syntax-3/#consume-a-function
|
86
|
+
#
|
87
|
+
# source://crass//lib/crass/parser.rb#326
|
88
|
+
def consume_function(input = T.unsafe(nil)); end
|
89
|
+
|
90
|
+
# Consumes a qualified rule and returns it, or `nil` if a parse error
|
91
|
+
# occurs.
|
92
|
+
#
|
93
|
+
# 5.4.3. http://dev.w3.org/csswg/css-syntax-3/#consume-a-qualified-rule
|
94
|
+
#
|
95
|
+
# source://crass//lib/crass/parser.rb#357
|
96
|
+
def consume_qualified_rule(input = T.unsafe(nil)); end
|
97
|
+
|
98
|
+
# Consumes a list of rules and returns them.
|
99
|
+
#
|
100
|
+
# 5.4.1. http://dev.w3.org/csswg/css-syntax/#consume-a-list-of-rules
|
101
|
+
#
|
102
|
+
# source://crass//lib/crass/parser.rb#398
|
103
|
+
def consume_rules(flags = T.unsafe(nil)); end
|
104
|
+
|
105
|
+
# Consumes and returns a simple block associated with the current input
|
106
|
+
# token.
|
107
|
+
#
|
108
|
+
# 5.4.7. http://dev.w3.org/csswg/css-syntax/#consume-a-simple-block
|
109
|
+
#
|
110
|
+
# source://crass//lib/crass/parser.rb#434
|
111
|
+
def consume_simple_block(input = T.unsafe(nil)); end
|
112
|
+
|
113
|
+
# Creates and returns a new parse node with the given _properties_.
|
114
|
+
#
|
115
|
+
# source://crass//lib/crass/parser.rb#458
|
116
|
+
def create_node(type, properties = T.unsafe(nil)); end
|
117
|
+
|
118
|
+
# Parses the given _input_ tokens into a selector node and returns it.
|
119
|
+
#
|
120
|
+
# Doesn't bother splitting the selector list into individual selectors or
|
121
|
+
# validating them. Feel free to do that yourself! It'll be fun!
|
122
|
+
#
|
123
|
+
# source://crass//lib/crass/parser.rb#466
|
124
|
+
def create_selector(input); end
|
125
|
+
|
126
|
+
# Creates a `:style_rule` node from the given qualified _rule_, and returns
|
127
|
+
# it.
|
128
|
+
#
|
129
|
+
# source://crass//lib/crass/parser.rb#474
|
130
|
+
def create_style_rule(rule); end
|
131
|
+
|
132
|
+
# Parses a single component value and returns it.
|
133
|
+
#
|
134
|
+
# 5.3.7. http://dev.w3.org/csswg/css-syntax-3/#parse-a-component-value
|
135
|
+
#
|
136
|
+
# source://crass//lib/crass/parser.rb#483
|
137
|
+
def parse_component_value(input = T.unsafe(nil)); end
|
138
|
+
|
139
|
+
# Parses a list of component values and returns an array of parsed tokens.
|
140
|
+
#
|
141
|
+
# 5.3.8. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-component-values
|
142
|
+
#
|
143
|
+
# source://crass//lib/crass/parser.rb#510
|
144
|
+
def parse_component_values(input = T.unsafe(nil)); end
|
145
|
+
|
146
|
+
# Parses a single declaration and returns it.
|
147
|
+
#
|
148
|
+
# 5.3.5. http://dev.w3.org/csswg/css-syntax/#parse-a-declaration
|
149
|
+
#
|
150
|
+
# source://crass//lib/crass/parser.rb#524
|
151
|
+
def parse_declaration(input = T.unsafe(nil)); end
|
152
|
+
|
153
|
+
# Parses a list of declarations and returns them.
|
154
|
+
#
|
155
|
+
# See {#consume_declarations} for _options_.
|
156
|
+
#
|
157
|
+
# 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
|
158
|
+
#
|
159
|
+
# source://crass//lib/crass/parser.rb#552
|
160
|
+
def parse_declarations(input = T.unsafe(nil), options = T.unsafe(nil)); end
|
161
|
+
|
162
|
+
# Parses a list of declarations and returns an array of `:property` nodes
|
163
|
+
# (and any non-declaration nodes that were in the input). This is useful for
|
164
|
+
# parsing the contents of an HTML element's `style` attribute.
|
165
|
+
#
|
166
|
+
# source://crass//lib/crass/parser.rb#560
|
167
|
+
def parse_properties(input = T.unsafe(nil)); end
|
168
|
+
|
169
|
+
# Parses a single rule and returns it.
|
170
|
+
#
|
171
|
+
# 5.3.4. http://dev.w3.org/csswg/css-syntax-3/#parse-a-rule
|
172
|
+
#
|
173
|
+
# source://crass//lib/crass/parser.rb#586
|
174
|
+
def parse_rule(input = T.unsafe(nil)); end
|
175
|
+
|
176
|
+
# Returns the unescaped value of a selector name or property declaration.
|
177
|
+
#
|
178
|
+
# source://crass//lib/crass/parser.rb#615
|
179
|
+
def parse_value(nodes); end
|
180
|
+
|
181
|
+
# {TokenScanner} wrapping the tokens generated from this parser's input.
|
182
|
+
#
|
183
|
+
# source://crass//lib/crass/parser.rb#120
|
184
|
+
def tokens; end
|
185
|
+
|
186
|
+
class << self
|
187
|
+
# Parses CSS properties (such as the contents of an HTML element's `style`
|
188
|
+
# attribute) and returns a parse tree.
|
189
|
+
#
|
190
|
+
# See {Tokenizer#initialize} for _options_.
|
191
|
+
#
|
192
|
+
# 5.3.6. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-declarations
|
193
|
+
#
|
194
|
+
# source://crass//lib/crass/parser.rb#25
|
195
|
+
def parse_properties(input, options = T.unsafe(nil)); end
|
196
|
+
|
197
|
+
# Parses CSS rules (such as the content of a `@media` block) and returns a
|
198
|
+
# parse tree. The only difference from {parse_stylesheet} is that CDO/CDC
|
199
|
+
# nodes (`<!--` and `-->`) aren't ignored.
|
200
|
+
#
|
201
|
+
# See {Tokenizer#initialize} for _options_.
|
202
|
+
#
|
203
|
+
# 5.3.3. http://dev.w3.org/csswg/css-syntax/#parse-a-list-of-rules
|
204
|
+
#
|
205
|
+
# source://crass//lib/crass/parser.rb#36
|
206
|
+
def parse_rules(input, options = T.unsafe(nil)); end
|
207
|
+
|
208
|
+
# Parses a CSS stylesheet and returns a parse tree.
|
209
|
+
#
|
210
|
+
# See {Tokenizer#initialize} for _options_.
|
211
|
+
#
|
212
|
+
# 5.3.2. http://dev.w3.org/csswg/css-syntax/#parse-a-stylesheet
|
213
|
+
#
|
214
|
+
# source://crass//lib/crass/parser.rb#54
|
215
|
+
def parse_stylesheet(input, options = T.unsafe(nil)); end
|
216
|
+
|
217
|
+
# Converts a node or array of nodes into a CSS string based on their
|
218
|
+
# original tokenized input.
|
219
|
+
#
|
220
|
+
# Options:
|
221
|
+
#
|
222
|
+
# * **:exclude_comments** - When `true`, comments will be excluded.
|
223
|
+
#
|
224
|
+
# source://crass//lib/crass/parser.rb#74
|
225
|
+
def stringify(nodes, options = T.unsafe(nil)); end
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
# source://crass//lib/crass/parser.rb#11
|
230
|
+
Crass::Parser::BLOCK_END_TOKENS = T.let(T.unsafe(nil), Hash)
|
231
|
+
|
232
|
+
# Similar to a StringScanner, but with extra functionality needed to tokenize
|
233
|
+
# CSS while preserving the original text.
|
234
|
+
#
|
235
|
+
# source://crass//lib/crass/scanner.rb#8
|
236
|
+
class Crass::Scanner
|
237
|
+
# Creates a Scanner instance for the given _input_ string or IO instance.
|
238
|
+
#
|
239
|
+
# @return [Scanner] a new instance of Scanner
|
240
|
+
#
|
241
|
+
# source://crass//lib/crass/scanner.rb#25
|
242
|
+
def initialize(input); end
|
243
|
+
|
244
|
+
# Consumes the next character and returns it, advancing the pointer, or
|
245
|
+
# an empty string if the end of the string has been reached.
|
246
|
+
#
|
247
|
+
# source://crass//lib/crass/scanner.rb#34
|
248
|
+
def consume; end
|
249
|
+
|
250
|
+
# Consumes the rest of the string and returns it, advancing the pointer to
|
251
|
+
# the end of the string. Returns an empty string is the end of the string
|
252
|
+
# has already been reached.
|
253
|
+
#
|
254
|
+
# source://crass//lib/crass/scanner.rb#46
|
255
|
+
def consume_rest; end
|
256
|
+
|
257
|
+
# Current character, or `nil` if the scanner hasn't yet consumed a
|
258
|
+
# character, or is at the end of the string.
|
259
|
+
#
|
260
|
+
# source://crass//lib/crass/scanner.rb#11
|
261
|
+
def current; end
|
262
|
+
|
263
|
+
# Returns `true` if the end of the string has been reached, `false`
|
264
|
+
# otherwise.
|
265
|
+
#
|
266
|
+
# @return [Boolean]
|
267
|
+
#
|
268
|
+
# source://crass//lib/crass/scanner.rb#57
|
269
|
+
def eos?; end
|
270
|
+
|
271
|
+
# Sets the marker to the position of the next character that will be
|
272
|
+
# consumed.
|
273
|
+
#
|
274
|
+
# source://crass//lib/crass/scanner.rb#63
|
275
|
+
def mark; end
|
276
|
+
|
277
|
+
# Returns the substring between {#marker} and {#pos}, without altering the
|
278
|
+
# pointer.
|
279
|
+
#
|
280
|
+
# source://crass//lib/crass/scanner.rb#69
|
281
|
+
def marked; end
|
282
|
+
|
283
|
+
# Current marker position. Use {#marked} to get the substring between
|
284
|
+
# {#marker} and {#pos}.
|
285
|
+
#
|
286
|
+
# source://crass//lib/crass/scanner.rb#15
|
287
|
+
def marker; end
|
288
|
+
|
289
|
+
# Current marker position. Use {#marked} to get the substring between
|
290
|
+
# {#marker} and {#pos}.
|
291
|
+
#
|
292
|
+
# source://crass//lib/crass/scanner.rb#15
|
293
|
+
def marker=(_arg0); end
|
294
|
+
|
295
|
+
# Returns up to _length_ characters starting at the current position, but
|
296
|
+
# doesn't consume them. The number of characters returned may be less than
|
297
|
+
# _length_ if the end of the string is reached.
|
298
|
+
#
|
299
|
+
# source://crass//lib/crass/scanner.rb#80
|
300
|
+
def peek(length = T.unsafe(nil)); end
|
301
|
+
|
302
|
+
# Position of the next character that will be consumed. This is a character
|
303
|
+
# position, not a byte position, so it accounts for multi-byte characters.
|
304
|
+
#
|
305
|
+
# source://crass//lib/crass/scanner.rb#19
|
306
|
+
def pos; end
|
307
|
+
|
308
|
+
# Position of the next character that will be consumed. This is a character
|
309
|
+
# position, not a byte position, so it accounts for multi-byte characters.
|
310
|
+
#
|
311
|
+
# source://crass//lib/crass/scanner.rb#19
|
312
|
+
def pos=(_arg0); end
|
313
|
+
|
314
|
+
# Moves the pointer back one character without changing the value of
|
315
|
+
# {#current}. The next call to {#consume} will re-consume the current
|
316
|
+
# character.
|
317
|
+
#
|
318
|
+
# source://crass//lib/crass/scanner.rb#87
|
319
|
+
def reconsume; end
|
320
|
+
|
321
|
+
# Resets the pointer to the beginning of the string.
|
322
|
+
#
|
323
|
+
# source://crass//lib/crass/scanner.rb#93
|
324
|
+
def reset; end
|
325
|
+
|
326
|
+
# Tries to match _pattern_ at the current position. If it matches, the
|
327
|
+
# matched substring will be returned and the pointer will be advanced.
|
328
|
+
# Otherwise, `nil` will be returned.
|
329
|
+
#
|
330
|
+
# source://crass//lib/crass/scanner.rb#103
|
331
|
+
def scan(pattern); end
|
332
|
+
|
333
|
+
# Scans the string until the _pattern_ is matched. Returns the substring up
|
334
|
+
# to and including the end of the match, and advances the pointer. If there
|
335
|
+
# is no match, `nil` is returned and the pointer is not advanced.
|
336
|
+
#
|
337
|
+
# source://crass//lib/crass/scanner.rb#115
|
338
|
+
def scan_until(pattern); end
|
339
|
+
|
340
|
+
# String being scanned.
|
341
|
+
#
|
342
|
+
# source://crass//lib/crass/scanner.rb#22
|
343
|
+
def string; end
|
344
|
+
end
|
345
|
+
|
346
|
+
# Like {Scanner}, but for tokens!
|
347
|
+
#
|
348
|
+
# source://crass//lib/crass/token-scanner.rb#6
|
349
|
+
class Crass::TokenScanner
|
350
|
+
# @return [TokenScanner] a new instance of TokenScanner
|
351
|
+
#
|
352
|
+
# source://crass//lib/crass/token-scanner.rb#9
|
353
|
+
def initialize(tokens); end
|
354
|
+
|
355
|
+
# Executes the given block, collects all tokens that are consumed during its
|
356
|
+
# execution, and returns them.
|
357
|
+
#
|
358
|
+
# source://crass//lib/crass/token-scanner.rb#16
|
359
|
+
def collect; end
|
360
|
+
|
361
|
+
# Consumes the next token and returns it, advancing the pointer. Returns
|
362
|
+
# `nil` if there is no next token.
|
363
|
+
#
|
364
|
+
# source://crass//lib/crass/token-scanner.rb#24
|
365
|
+
def consume; end
|
366
|
+
|
367
|
+
# Returns the value of attribute current.
|
368
|
+
#
|
369
|
+
# source://crass//lib/crass/token-scanner.rb#7
|
370
|
+
def current; end
|
371
|
+
|
372
|
+
# Returns the next token without consuming it, or `nil` if there is no next
|
373
|
+
# token.
|
374
|
+
#
|
375
|
+
# source://crass//lib/crass/token-scanner.rb#32
|
376
|
+
def peek; end
|
377
|
+
|
378
|
+
# Returns the value of attribute pos.
|
379
|
+
#
|
380
|
+
# source://crass//lib/crass/token-scanner.rb#7
|
381
|
+
def pos; end
|
382
|
+
|
383
|
+
# Reconsumes the current token, moving the pointer back one position.
|
384
|
+
#
|
385
|
+
# http://www.w3.org/TR/2013/WD-css-syntax-3-20130919/#reconsume-the-current-input-token
|
386
|
+
#
|
387
|
+
# source://crass//lib/crass/token-scanner.rb#39
|
388
|
+
def reconsume; end
|
389
|
+
|
390
|
+
# Resets the pointer to the first token in the list.
|
391
|
+
#
|
392
|
+
# source://crass//lib/crass/token-scanner.rb#44
|
393
|
+
def reset; end
|
394
|
+
|
395
|
+
# Returns the value of attribute tokens.
|
396
|
+
#
|
397
|
+
# source://crass//lib/crass/token-scanner.rb#7
|
398
|
+
def tokens; end
|
399
|
+
end
|
400
|
+
|
401
|
+
# Tokenizes a CSS string.
|
402
|
+
#
|
403
|
+
# 4. http://dev.w3.org/csswg/css-syntax/#tokenization
|
404
|
+
#
|
405
|
+
# source://crass//lib/crass/tokenizer.rb#9
|
406
|
+
class Crass::Tokenizer
|
407
|
+
# Initializes a new Tokenizer.
|
408
|
+
#
|
409
|
+
# Options:
|
410
|
+
#
|
411
|
+
# * **:preserve_comments** - If `true`, comments will be preserved as
|
412
|
+
# `:comment` tokens.
|
413
|
+
#
|
414
|
+
# * **:preserve_hacks** - If `true`, certain non-standard browser hacks
|
415
|
+
# such as the IE "*" hack will be preserved even though they violate
|
416
|
+
# CSS 3 syntax rules.
|
417
|
+
#
|
418
|
+
# @return [Tokenizer] a new instance of Tokenizer
|
419
|
+
#
|
420
|
+
# source://crass//lib/crass/tokenizer.rb#62
|
421
|
+
def initialize(input, options = T.unsafe(nil)); end
|
422
|
+
|
423
|
+
# Consumes a token and returns the token that was consumed.
|
424
|
+
#
|
425
|
+
# 4.3.1. http://dev.w3.org/csswg/css-syntax/#consume-a-token
|
426
|
+
#
|
427
|
+
# source://crass//lib/crass/tokenizer.rb#70
|
428
|
+
def consume; end
|
429
|
+
|
430
|
+
# Consumes the remnants of a bad URL and returns the consumed text.
|
431
|
+
#
|
432
|
+
# 4.3.15. http://dev.w3.org/csswg/css-syntax/#consume-the-remnants-of-a-bad-url
|
433
|
+
#
|
434
|
+
# source://crass//lib/crass/tokenizer.rb#275
|
435
|
+
def consume_bad_url; end
|
436
|
+
|
437
|
+
# Consumes comments and returns them, or `nil` if no comments were consumed.
|
438
|
+
#
|
439
|
+
# 4.3.2. http://dev.w3.org/csswg/css-syntax/#consume-comments
|
440
|
+
#
|
441
|
+
# source://crass//lib/crass/tokenizer.rb#301
|
442
|
+
def consume_comments; end
|
443
|
+
|
444
|
+
# Consumes an escaped code point and returns its unescaped value.
|
445
|
+
#
|
446
|
+
# This method assumes that the `\` has already been consumed, and that the
|
447
|
+
# next character in the input has already been verified not to be a newline
|
448
|
+
# or EOF.
|
449
|
+
#
|
450
|
+
# 4.3.8. http://dev.w3.org/csswg/css-syntax/#consume-an-escaped-code-point
|
451
|
+
#
|
452
|
+
# source://crass//lib/crass/tokenizer.rb#326
|
453
|
+
def consume_escaped; end
|
454
|
+
|
455
|
+
# Consumes an ident-like token and returns it.
|
456
|
+
#
|
457
|
+
# 4.3.4. http://dev.w3.org/csswg/css-syntax/#consume-an-ident-like-token
|
458
|
+
#
|
459
|
+
# source://crass//lib/crass/tokenizer.rb#350
|
460
|
+
def consume_ident; end
|
461
|
+
|
462
|
+
# Consumes a name and returns it.
|
463
|
+
#
|
464
|
+
# 4.3.12. http://dev.w3.org/csswg/css-syntax/#consume-a-name
|
465
|
+
#
|
466
|
+
# source://crass//lib/crass/tokenizer.rb#375
|
467
|
+
def consume_name; end
|
468
|
+
|
469
|
+
# Consumes a number and returns a 3-element array containing the number's
|
470
|
+
# original representation, its numeric value, and its type (either
|
471
|
+
# `:integer` or `:number`).
|
472
|
+
#
|
473
|
+
# 4.3.13. http://dev.w3.org/csswg/css-syntax/#consume-a-number
|
474
|
+
#
|
475
|
+
# source://crass//lib/crass/tokenizer.rb#407
|
476
|
+
def consume_number; end
|
477
|
+
|
478
|
+
# Consumes a numeric token and returns it.
|
479
|
+
#
|
480
|
+
# 4.3.3. http://dev.w3.org/csswg/css-syntax/#consume-a-numeric-token
|
481
|
+
#
|
482
|
+
# source://crass//lib/crass/tokenizer.rb#430
|
483
|
+
def consume_numeric; end
|
484
|
+
|
485
|
+
# Consumes a string token that ends at the given character, and returns the
|
486
|
+
# token.
|
487
|
+
#
|
488
|
+
# 4.3.5. http://dev.w3.org/csswg/css-syntax/#consume-a-string-token
|
489
|
+
#
|
490
|
+
# source://crass//lib/crass/tokenizer.rb#469
|
491
|
+
def consume_string(ending = T.unsafe(nil)); end
|
492
|
+
|
493
|
+
# Consumes a Unicode range token and returns it. Assumes the initial "u+" or
|
494
|
+
# "U+" has already been consumed.
|
495
|
+
#
|
496
|
+
# 4.3.7. http://dev.w3.org/csswg/css-syntax/#consume-a-unicode-range-token
|
497
|
+
#
|
498
|
+
# source://crass//lib/crass/tokenizer.rb#510
|
499
|
+
def consume_unicode_range; end
|
500
|
+
|
501
|
+
# Consumes a URL token and returns it. Assumes the original "url(" has
|
502
|
+
# already been consumed.
|
503
|
+
#
|
504
|
+
# 4.3.6. http://dev.w3.org/csswg/css-syntax/#consume-a-url-token
|
505
|
+
#
|
506
|
+
# source://crass//lib/crass/tokenizer.rb#542
|
507
|
+
def consume_url; end
|
508
|
+
|
509
|
+
# Converts a valid CSS number string into a number and returns the number.
|
510
|
+
#
|
511
|
+
# 4.3.14. http://dev.w3.org/csswg/css-syntax/#convert-a-string-to-a-number
|
512
|
+
#
|
513
|
+
# source://crass//lib/crass/tokenizer.rb#590
|
514
|
+
def convert_string_to_number(str); end
|
515
|
+
|
516
|
+
# Creates and returns a new token with the given _properties_.
|
517
|
+
#
|
518
|
+
# source://crass//lib/crass/tokenizer.rb#616
|
519
|
+
def create_token(type, properties = T.unsafe(nil)); end
|
520
|
+
|
521
|
+
# Preprocesses _input_ to prepare it for the tokenizer.
|
522
|
+
#
|
523
|
+
# 3.3. http://dev.w3.org/csswg/css-syntax/#input-preprocessing
|
524
|
+
#
|
525
|
+
# source://crass//lib/crass/tokenizer.rb#627
|
526
|
+
def preprocess(input); end
|
527
|
+
|
528
|
+
# Returns `true` if the given three-character _text_ would start an
|
529
|
+
# identifier. If _text_ is `nil`, the current and next two characters in the
|
530
|
+
# input stream will be checked, but will not be consumed.
|
531
|
+
#
|
532
|
+
# 4.3.10. http://dev.w3.org/csswg/css-syntax/#would-start-an-identifier
|
533
|
+
#
|
534
|
+
# @return [Boolean]
|
535
|
+
#
|
536
|
+
# source://crass//lib/crass/tokenizer.rb#642
|
537
|
+
def start_identifier?(text = T.unsafe(nil)); end
|
538
|
+
|
539
|
+
# Returns `true` if the given three-character _text_ would start a number.
|
540
|
+
# If _text_ is `nil`, the current and next two characters in the input
|
541
|
+
# stream will be checked, but will not be consumed.
|
542
|
+
#
|
543
|
+
# 4.3.11. http://dev.w3.org/csswg/css-syntax/#starts-with-a-number
|
544
|
+
#
|
545
|
+
# @return [Boolean]
|
546
|
+
#
|
547
|
+
# source://crass//lib/crass/tokenizer.rb#666
|
548
|
+
def start_number?(text = T.unsafe(nil)); end
|
549
|
+
|
550
|
+
# Tokenizes the input stream and returns an array of tokens.
|
551
|
+
#
|
552
|
+
# source://crass//lib/crass/tokenizer.rb#685
|
553
|
+
def tokenize; end
|
554
|
+
|
555
|
+
# Returns `true` if the given two-character _text_ is the beginning of a
|
556
|
+
# valid escape sequence. If _text_ is `nil`, the current and next character
|
557
|
+
# in the input stream will be checked, but will not be consumed.
|
558
|
+
#
|
559
|
+
# 4.3.9. http://dev.w3.org/csswg/css-syntax/#starts-with-a-valid-escape
|
560
|
+
#
|
561
|
+
# @return [Boolean]
|
562
|
+
#
|
563
|
+
# source://crass//lib/crass/tokenizer.rb#702
|
564
|
+
def valid_escape?(text = T.unsafe(nil)); end
|
565
|
+
|
566
|
+
class << self
|
567
|
+
# Tokenizes the given _input_ as a CSS string and returns an array of
|
568
|
+
# tokens.
|
569
|
+
#
|
570
|
+
# See {#initialize} for _options_.
|
571
|
+
#
|
572
|
+
# source://crass//lib/crass/tokenizer.rb#45
|
573
|
+
def tokenize(input, options = T.unsafe(nil)); end
|
574
|
+
end
|
575
|
+
end
|
576
|
+
|
577
|
+
# source://crass//lib/crass/tokenizer.rb#10
|
578
|
+
Crass::Tokenizer::RE_COMMENT_CLOSE = T.let(T.unsafe(nil), Regexp)
|
579
|
+
|
580
|
+
# source://crass//lib/crass/tokenizer.rb#11
|
581
|
+
Crass::Tokenizer::RE_DIGIT = T.let(T.unsafe(nil), Regexp)
|
582
|
+
|
583
|
+
# source://crass//lib/crass/tokenizer.rb#12
|
584
|
+
Crass::Tokenizer::RE_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
585
|
+
|
586
|
+
# source://crass//lib/crass/tokenizer.rb#13
|
587
|
+
Crass::Tokenizer::RE_HEX = T.let(T.unsafe(nil), Regexp)
|
588
|
+
|
589
|
+
# source://crass//lib/crass/tokenizer.rb#14
|
590
|
+
Crass::Tokenizer::RE_NAME = T.let(T.unsafe(nil), Regexp)
|
591
|
+
|
592
|
+
# source://crass//lib/crass/tokenizer.rb#15
|
593
|
+
Crass::Tokenizer::RE_NAME_START = T.let(T.unsafe(nil), Regexp)
|
594
|
+
|
595
|
+
# source://crass//lib/crass/tokenizer.rb#16
|
596
|
+
Crass::Tokenizer::RE_NON_PRINTABLE = T.let(T.unsafe(nil), Regexp)
|
597
|
+
|
598
|
+
# source://crass//lib/crass/tokenizer.rb#17
|
599
|
+
Crass::Tokenizer::RE_NUMBER_DECIMAL = T.let(T.unsafe(nil), Regexp)
|
600
|
+
|
601
|
+
# source://crass//lib/crass/tokenizer.rb#18
|
602
|
+
Crass::Tokenizer::RE_NUMBER_EXPONENT = T.let(T.unsafe(nil), Regexp)
|
603
|
+
|
604
|
+
# source://crass//lib/crass/tokenizer.rb#19
|
605
|
+
Crass::Tokenizer::RE_NUMBER_SIGN = T.let(T.unsafe(nil), Regexp)
|
606
|
+
|
607
|
+
# source://crass//lib/crass/tokenizer.rb#21
|
608
|
+
Crass::Tokenizer::RE_NUMBER_STR = T.let(T.unsafe(nil), Regexp)
|
609
|
+
|
610
|
+
# source://crass//lib/crass/tokenizer.rb#33
|
611
|
+
Crass::Tokenizer::RE_QUOTED_URL_START = T.let(T.unsafe(nil), Regexp)
|
612
|
+
|
613
|
+
# source://crass//lib/crass/tokenizer.rb#35
|
614
|
+
Crass::Tokenizer::RE_UNICODE_RANGE_END = T.let(T.unsafe(nil), Regexp)
|
615
|
+
|
616
|
+
# source://crass//lib/crass/tokenizer.rb#34
|
617
|
+
Crass::Tokenizer::RE_UNICODE_RANGE_START = T.let(T.unsafe(nil), Regexp)
|
618
|
+
|
619
|
+
# source://crass//lib/crass/tokenizer.rb#36
|
620
|
+
Crass::Tokenizer::RE_WHITESPACE = T.let(T.unsafe(nil), Regexp)
|
621
|
+
|
622
|
+
# source://crass//lib/crass/tokenizer.rb#37
|
623
|
+
Crass::Tokenizer::RE_WHITESPACE_ANCHORED = T.let(T.unsafe(nil), Regexp)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `dashbrains-rubocop-config` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem dashbrains-rubocop-config`.
|
6
|
+
|
7
|
+
|
8
|
+
# THIS IS AN EMPTY RBI FILE.
|
9
|
+
# see https://github.com/Shopify/tapioca#manually-requiring-parts-of-a-gem
|