herb 0.8.10-arm-linux-gnu → 0.9.1-arm-linux-gnu
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 +4 -4
- data/Makefile +11 -3
- data/README.md +64 -34
- data/Rakefile +48 -40
- data/config.yml +473 -34
- data/ext/herb/error_helpers.c +535 -140
- data/ext/herb/error_helpers.h +1 -0
- data/ext/herb/extconf.rb +67 -28
- data/ext/herb/extension.c +321 -51
- data/ext/herb/extension.h +1 -0
- data/ext/herb/extension_helpers.c +24 -14
- data/ext/herb/extension_helpers.h +2 -2
- data/ext/herb/nodes.c +647 -270
- data/ext/herb/nodes.h +1 -0
- data/herb.gemspec +3 -2
- data/lib/herb/3.0/herb.so +0 -0
- data/lib/herb/3.1/herb.so +0 -0
- data/lib/herb/3.2/herb.so +0 -0
- data/lib/herb/3.3/herb.so +0 -0
- data/lib/herb/3.4/herb.so +0 -0
- data/lib/herb/4.0/herb.so +0 -0
- data/lib/herb/ast/helpers.rb +3 -3
- data/lib/herb/ast/node.rb +15 -2
- data/lib/herb/ast/nodes.rb +1530 -179
- data/lib/herb/bootstrap.rb +87 -0
- data/lib/herb/cli.rb +341 -31
- data/lib/herb/configuration.rb +248 -0
- data/lib/herb/defaults.yml +32 -0
- data/lib/herb/engine/compiler.rb +78 -11
- data/lib/herb/engine/debug_visitor.rb +13 -3
- data/lib/herb/engine/error_formatter.rb +13 -9
- data/lib/herb/engine/parser_error_overlay.rb +10 -6
- data/lib/herb/engine/validator.rb +8 -3
- data/lib/herb/engine/validators/nesting_validator.rb +2 -2
- data/lib/herb/engine.rb +119 -43
- data/lib/herb/errors.rb +808 -88
- data/lib/herb/lex_result.rb +1 -0
- data/lib/herb/location.rb +7 -3
- data/lib/herb/parse_result.rb +12 -2
- data/lib/herb/parser_options.rb +62 -0
- data/lib/herb/position.rb +1 -0
- data/lib/herb/prism_inspect.rb +120 -0
- data/lib/herb/project.rb +923 -331
- data/lib/herb/range.rb +1 -0
- data/lib/herb/token.rb +7 -1
- data/lib/herb/version.rb +1 -1
- data/lib/herb/visitor.rb +47 -2
- data/lib/herb/warnings.rb +6 -1
- data/lib/herb.rb +35 -3
- data/sig/herb/ast/helpers.rbs +2 -2
- data/sig/herb/ast/node.rbs +12 -2
- data/sig/herb/ast/nodes.rbs +773 -128
- data/sig/herb/bootstrap.rbs +31 -0
- data/sig/herb/configuration.rbs +89 -0
- data/sig/herb/engine/compiler.rbs +9 -1
- data/sig/herb/engine/debug_visitor.rbs +2 -0
- data/sig/herb/engine/validator.rbs +5 -1
- data/sig/herb/engine.rbs +21 -3
- data/sig/herb/errors.rbs +372 -63
- data/sig/herb/location.rbs +4 -0
- data/sig/herb/parse_result.rbs +4 -2
- data/sig/herb/parser_options.rbs +46 -0
- data/sig/herb/position.rbs +1 -0
- data/sig/herb/prism_inspect.rbs +28 -0
- data/sig/herb/range.rbs +1 -0
- data/sig/herb/token.rbs +6 -0
- data/sig/herb/visitor.rbs +31 -4
- data/sig/herb/warnings.rbs +6 -1
- data/sig/herb.rbs +14 -0
- data/sig/herb_c_extension.rbs +5 -2
- data/sig/rubyvm.rbs +5 -0
- data/sig/serialized_ast_errors.rbs +82 -6
- data/sig/serialized_ast_nodes.rbs +91 -6
- data/src/analyze/action_view/attribute_extraction_helpers.c +303 -0
- data/src/analyze/action_view/content_tag.c +78 -0
- data/src/analyze/action_view/link_to.c +167 -0
- data/src/analyze/action_view/registry.c +83 -0
- data/src/analyze/action_view/tag.c +70 -0
- data/src/analyze/action_view/tag_helper_node_builders.c +305 -0
- data/src/analyze/action_view/tag_helpers.c +815 -0
- data/src/analyze/action_view/turbo_frame_tag.c +88 -0
- data/src/analyze/analyze.c +885 -0
- data/src/{analyzed_ruby.c → analyze/analyzed_ruby.c} +13 -11
- data/src/analyze/builders.c +343 -0
- data/src/analyze/conditional_elements.c +594 -0
- data/src/analyze/conditional_open_tags.c +640 -0
- data/src/analyze/control_type.c +250 -0
- data/src/{analyze_helpers.c → analyze/helpers.c} +48 -23
- data/src/analyze/invalid_structures.c +193 -0
- data/src/{analyze_missing_end.c → analyze/missing_end.c} +33 -22
- data/src/analyze/parse_errors.c +84 -0
- data/src/analyze/prism_annotate.c +399 -0
- data/src/analyze/render_nodes.c +761 -0
- data/src/{analyze_transform.c → analyze/transform.c} +24 -3
- data/src/ast_node.c +17 -7
- data/src/ast_nodes.c +759 -387
- data/src/ast_pretty_print.c +264 -6
- data/src/errors.c +1454 -519
- data/src/extract.c +145 -49
- data/src/herb.c +52 -34
- data/src/html_util.c +241 -12
- data/src/include/analyze/action_view/attribute_extraction_helpers.h +36 -0
- data/src/include/analyze/action_view/tag_helper_handler.h +43 -0
- data/src/include/analyze/action_view/tag_helper_node_builders.h +70 -0
- data/src/include/analyze/action_view/tag_helpers.h +38 -0
- data/src/include/{analyze.h → analyze/analyze.h} +14 -4
- data/src/include/{analyzed_ruby.h → analyze/analyzed_ruby.h} +3 -3
- data/src/include/analyze/builders.h +27 -0
- data/src/include/analyze/conditional_elements.h +9 -0
- data/src/include/analyze/conditional_open_tags.h +9 -0
- data/src/include/analyze/control_type.h +14 -0
- data/src/include/{analyze_helpers.h → analyze/helpers.h} +4 -2
- data/src/include/analyze/invalid_structures.h +11 -0
- data/src/include/analyze/prism_annotate.h +16 -0
- data/src/include/analyze/render_nodes.h +11 -0
- data/src/include/ast_node.h +11 -5
- data/src/include/ast_nodes.h +154 -38
- data/src/include/ast_pretty_print.h +5 -0
- data/src/include/element_source.h +3 -8
- data/src/include/errors.h +206 -55
- data/src/include/extract.h +21 -5
- data/src/include/herb.h +18 -6
- data/src/include/herb_prism_node.h +13 -0
- data/src/include/html_util.h +7 -2
- data/src/include/io.h +3 -1
- data/src/include/lex_helpers.h +29 -0
- data/src/include/lexer.h +1 -1
- data/src/include/lexer_peek_helpers.h +87 -13
- data/src/include/lexer_struct.h +2 -0
- data/src/include/location.h +2 -1
- data/src/include/parser.h +28 -2
- data/src/include/parser_helpers.h +19 -3
- data/src/include/pretty_print.h +10 -5
- data/src/include/prism_context.h +45 -0
- data/src/include/prism_helpers.h +10 -7
- data/src/include/prism_serialized.h +12 -0
- data/src/include/token.h +16 -4
- data/src/include/token_struct.h +10 -3
- data/src/include/utf8.h +2 -1
- data/src/include/util/hb_allocator.h +78 -0
- data/src/include/util/hb_arena.h +6 -1
- data/src/include/util/hb_arena_debug.h +12 -1
- data/src/include/util/hb_array.h +7 -3
- data/src/include/util/hb_buffer.h +6 -4
- data/src/include/util/hb_foreach.h +79 -0
- data/src/include/util/hb_narray.h +8 -4
- data/src/include/util/hb_string.h +56 -9
- data/src/include/util.h +6 -3
- data/src/include/version.h +1 -1
- data/src/io.c +3 -2
- data/src/lexer.c +42 -30
- data/src/lexer_peek_helpers.c +12 -74
- data/src/location.c +2 -2
- data/src/main.c +53 -28
- data/src/parser.c +784 -247
- data/src/parser_helpers.c +110 -23
- data/src/parser_match_tags.c +129 -48
- data/src/pretty_print.c +29 -24
- data/src/prism_helpers.c +30 -27
- data/src/ruby_parser.c +2 -0
- data/src/token.c +151 -66
- data/src/token_matchers.c +0 -1
- data/src/utf8.c +7 -6
- data/src/util/hb_allocator.c +341 -0
- data/src/util/hb_arena.c +81 -56
- data/src/util/hb_arena_debug.c +32 -17
- data/src/util/hb_array.c +30 -15
- data/src/util/hb_buffer.c +17 -21
- data/src/util/hb_narray.c +22 -7
- data/src/util/hb_string.c +49 -35
- data/src/util.c +21 -11
- data/src/visitor.c +67 -0
- data/templates/ext/herb/error_helpers.c.erb +24 -11
- data/templates/ext/herb/error_helpers.h.erb +1 -0
- data/templates/ext/herb/nodes.c.erb +50 -16
- data/templates/ext/herb/nodes.h.erb +1 -0
- data/templates/java/error_helpers.c.erb +1 -1
- data/templates/java/nodes.c.erb +30 -8
- data/templates/java/org/herb/ast/Errors.java.erb +24 -1
- data/templates/java/org/herb/ast/Nodes.java.erb +80 -21
- data/templates/javascript/packages/core/src/errors.ts.erb +16 -3
- data/templates/javascript/packages/core/src/node-type-guards.ts.erb +3 -1
- data/templates/javascript/packages/core/src/nodes.ts.erb +109 -32
- data/templates/javascript/packages/node/extension/error_helpers.cpp.erb +13 -4
- data/templates/javascript/packages/node/extension/nodes.cpp.erb +43 -4
- data/templates/lib/herb/ast/nodes.rb.erb +95 -32
- data/templates/lib/herb/errors.rb.erb +15 -3
- data/templates/lib/herb/visitor.rb.erb +2 -2
- data/templates/rust/src/ast/nodes.rs.erb +97 -44
- data/templates/rust/src/errors.rs.erb +2 -1
- data/templates/rust/src/nodes.rs.erb +168 -16
- data/templates/rust/src/union_types.rs.erb +60 -0
- data/templates/rust/src/visitor.rs.erb +81 -0
- data/templates/src/{analyze_missing_end.c.erb → analyze/missing_end.c.erb} +9 -6
- data/templates/src/{analyze_transform.c.erb → analyze/transform.c.erb} +2 -2
- data/templates/src/ast_nodes.c.erb +34 -26
- data/templates/src/ast_pretty_print.c.erb +24 -5
- data/templates/src/errors.c.erb +60 -54
- data/templates/src/include/ast_nodes.h.erb +6 -2
- data/templates/src/include/ast_pretty_print.h.erb +5 -0
- data/templates/src/include/errors.h.erb +15 -11
- data/templates/src/include/util/hb_foreach.h.erb +20 -0
- data/templates/src/parser_match_tags.c.erb +10 -4
- data/templates/src/visitor.c.erb +2 -2
- data/templates/template.rb +204 -29
- data/templates/wasm/error_helpers.cpp.erb +9 -5
- data/templates/wasm/nodes.cpp.erb +41 -4
- metadata +60 -16
- data/src/analyze.c +0 -1608
- data/src/element_source.c +0 -12
- data/src/include/util/hb_system.h +0 -9
- data/src/util/hb_system.c +0 -30
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Generated from lib/herb/bootstrap.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Herb
|
|
4
|
+
module Bootstrap
|
|
5
|
+
ROOT_PATH: untyped
|
|
6
|
+
|
|
7
|
+
PRISM_VENDOR_DIR: untyped
|
|
8
|
+
|
|
9
|
+
PRISM_ENTRIES: untyped
|
|
10
|
+
|
|
11
|
+
def self.generate_templates: () -> untyped
|
|
12
|
+
|
|
13
|
+
def self.git_source?: () -> untyped
|
|
14
|
+
|
|
15
|
+
def self.templates_generated?: () -> untyped
|
|
16
|
+
|
|
17
|
+
def self.vendor_prism: (prism_gem_path: untyped) -> untyped
|
|
18
|
+
|
|
19
|
+
def self.prism_vendored?: () -> untyped
|
|
20
|
+
|
|
21
|
+
def self.prism_ast_header_exists?: () -> untyped
|
|
22
|
+
|
|
23
|
+
def self.find_prism_gem_path: () -> untyped
|
|
24
|
+
|
|
25
|
+
def self.generate_prism_templates: () -> untyped
|
|
26
|
+
|
|
27
|
+
def self.find_prism_as_bundler_sibling: () -> untyped
|
|
28
|
+
|
|
29
|
+
def self.find_prism_from_gem_spec: () -> untyped
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Generated from lib/herb/configuration.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Herb
|
|
4
|
+
class Configuration
|
|
5
|
+
CONFIG_FILENAMES: untyped
|
|
6
|
+
|
|
7
|
+
PROJECT_INDICATORS: untyped
|
|
8
|
+
|
|
9
|
+
DEFAULTS_PATH: untyped
|
|
10
|
+
|
|
11
|
+
DEFAULTS: untyped
|
|
12
|
+
|
|
13
|
+
attr_reader config: untyped
|
|
14
|
+
|
|
15
|
+
attr_reader config_path: untyped
|
|
16
|
+
|
|
17
|
+
attr_reader project_root: untyped
|
|
18
|
+
|
|
19
|
+
def initialize: (?untyped project_path) -> untyped
|
|
20
|
+
|
|
21
|
+
def []: (untyped key) -> untyped
|
|
22
|
+
|
|
23
|
+
def dig: (*untyped keys) -> untyped
|
|
24
|
+
|
|
25
|
+
def version: () -> untyped
|
|
26
|
+
|
|
27
|
+
def files: () -> untyped
|
|
28
|
+
|
|
29
|
+
def file_include_patterns: () -> untyped
|
|
30
|
+
|
|
31
|
+
def file_exclude_patterns: () -> untyped
|
|
32
|
+
|
|
33
|
+
def linter: () -> untyped
|
|
34
|
+
|
|
35
|
+
def engine: () -> untyped
|
|
36
|
+
|
|
37
|
+
def enabled_validators: (?untyped overrides) -> untyped
|
|
38
|
+
|
|
39
|
+
def formatter: () -> untyped
|
|
40
|
+
|
|
41
|
+
def include_patterns_for: (untyped tool) -> untyped
|
|
42
|
+
|
|
43
|
+
def exclude_patterns_for: (untyped tool) -> untyped
|
|
44
|
+
|
|
45
|
+
def linter_include_patterns: () -> untyped
|
|
46
|
+
|
|
47
|
+
def linter_exclude_patterns: () -> untyped
|
|
48
|
+
|
|
49
|
+
def formatter_include_patterns: () -> untyped
|
|
50
|
+
|
|
51
|
+
def formatter_exclude_patterns: () -> untyped
|
|
52
|
+
|
|
53
|
+
def enabled_for_path?: (untyped path, untyped tool) -> untyped
|
|
54
|
+
|
|
55
|
+
def linter_enabled_for_path?: (untyped path) -> untyped
|
|
56
|
+
|
|
57
|
+
def formatter_enabled_for_path?: (untyped path) -> untyped
|
|
58
|
+
|
|
59
|
+
def path_excluded?: (untyped path, untyped patterns) -> untyped
|
|
60
|
+
|
|
61
|
+
def path_included?: (untyped path, untyped patterns) -> untyped
|
|
62
|
+
|
|
63
|
+
def find_files: (?untyped search_path) -> untyped
|
|
64
|
+
|
|
65
|
+
def find_files_for_tool: (untyped tool, ?untyped search_path) -> untyped
|
|
66
|
+
|
|
67
|
+
def find_files_for_linter: (?untyped search_path) -> untyped
|
|
68
|
+
|
|
69
|
+
def find_files_for_formatter: (?untyped search_path) -> untyped
|
|
70
|
+
|
|
71
|
+
def self.load: (?untyped project_path) -> untyped
|
|
72
|
+
|
|
73
|
+
def self.default: () -> untyped
|
|
74
|
+
|
|
75
|
+
def self.default_file_patterns: () -> untyped
|
|
76
|
+
|
|
77
|
+
def self.default_exclude_patterns: () -> untyped
|
|
78
|
+
|
|
79
|
+
private
|
|
80
|
+
|
|
81
|
+
def find_config_file: () -> untyped
|
|
82
|
+
|
|
83
|
+
def project_root?: (untyped path) -> untyped
|
|
84
|
+
|
|
85
|
+
def load_config: () -> untyped
|
|
86
|
+
|
|
87
|
+
def deep_merge: (untyped base, untyped override, ?additive_keys: untyped) -> untyped
|
|
88
|
+
end
|
|
89
|
+
end
|
|
@@ -13,6 +13,8 @@ module Herb
|
|
|
13
13
|
|
|
14
14
|
def visit_html_element_node: (untyped node) -> untyped
|
|
15
15
|
|
|
16
|
+
def visit_html_conditional_element_node: (untyped node) -> untyped
|
|
17
|
+
|
|
16
18
|
def visit_html_open_tag_node: (untyped node) -> untyped
|
|
17
19
|
|
|
18
20
|
def visit_html_attribute_node: (untyped node) -> untyped
|
|
@@ -23,6 +25,8 @@ module Herb
|
|
|
23
25
|
|
|
24
26
|
def visit_html_close_tag_node: (untyped node) -> untyped
|
|
25
27
|
|
|
28
|
+
def visit_html_omitted_close_tag_node: (untyped node) -> untyped
|
|
29
|
+
|
|
26
30
|
def visit_html_text_node: (untyped node) -> untyped
|
|
27
31
|
|
|
28
32
|
def visit_literal_node: (untyped node) -> untyped
|
|
@@ -73,6 +77,8 @@ module Herb
|
|
|
73
77
|
|
|
74
78
|
def visit_erb_block_node: (untyped node) -> untyped
|
|
75
79
|
|
|
80
|
+
def visit_erb_block_end_node: (untyped node, ?escaped: untyped) -> untyped
|
|
81
|
+
|
|
76
82
|
def visit_erb_control_with_parts: (untyped node, *untyped parts) -> untyped
|
|
77
83
|
|
|
78
84
|
private
|
|
@@ -111,7 +117,7 @@ module Herb
|
|
|
111
117
|
|
|
112
118
|
def find_token_before_code_sequence: (untyped tokens, untyped whitespace_index) -> untyped
|
|
113
119
|
|
|
114
|
-
def process_erb_output: (untyped opening, untyped code) -> untyped
|
|
120
|
+
def process_erb_output: (untyped node, untyped opening, untyped code) -> untyped
|
|
115
121
|
|
|
116
122
|
def should_escape_output?: (untyped opening) -> untyped
|
|
117
123
|
|
|
@@ -119,6 +125,8 @@ module Herb
|
|
|
119
125
|
|
|
120
126
|
def at_line_start?: () -> untyped
|
|
121
127
|
|
|
128
|
+
def preceding_token_ends_with_newline?: () -> untyped
|
|
129
|
+
|
|
122
130
|
def extract_lspace: () -> untyped
|
|
123
131
|
|
|
124
132
|
def extract_and_remove_lspace!: () -> untyped
|
|
@@ -5,7 +5,11 @@ module Herb
|
|
|
5
5
|
class Validator < Herb::Visitor
|
|
6
6
|
attr_reader diagnostics: untyped
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
attr_reader enabled: untyped
|
|
9
|
+
|
|
10
|
+
def initialize: (?enabled: untyped) -> untyped
|
|
11
|
+
|
|
12
|
+
def enabled?: () -> untyped
|
|
9
13
|
|
|
10
14
|
def validate: (untyped node) -> untyped
|
|
11
15
|
|
data/sig/herb/engine.rbs
CHANGED
|
@@ -20,11 +20,19 @@ module Herb
|
|
|
20
20
|
|
|
21
21
|
attr_reader visitors: untyped
|
|
22
22
|
|
|
23
|
+
attr_reader enabled_validators: untyped
|
|
24
|
+
|
|
23
25
|
ESCAPE_TABLE: untyped
|
|
24
26
|
|
|
25
27
|
class CompilationError < StandardError
|
|
26
28
|
end
|
|
27
29
|
|
|
30
|
+
class InvalidRubyError < CompilationError
|
|
31
|
+
attr_reader compiled_source: untyped
|
|
32
|
+
|
|
33
|
+
def initialize: (untyped message, ?compiled_source: untyped) -> untyped
|
|
34
|
+
end
|
|
35
|
+
|
|
28
36
|
def initialize: (untyped input, ?untyped properties) -> untyped
|
|
29
37
|
|
|
30
38
|
def self.h: (untyped value) -> untyped
|
|
@@ -35,10 +43,16 @@ module Herb
|
|
|
35
43
|
|
|
36
44
|
def self.css: (untyped value) -> untyped
|
|
37
45
|
|
|
46
|
+
def self.comment?: (untyped code) -> untyped
|
|
47
|
+
|
|
48
|
+
def self.heredoc?: (untyped code) -> untyped
|
|
49
|
+
|
|
38
50
|
def add_text: (untyped text) -> untyped
|
|
39
51
|
|
|
40
52
|
def add_code: (untyped code) -> untyped
|
|
41
53
|
|
|
54
|
+
def expression_block?: () -> untyped
|
|
55
|
+
|
|
42
56
|
def add_expression: (untyped indicator, untyped code) -> untyped
|
|
43
57
|
|
|
44
58
|
def add_expression_result: (untyped code) -> untyped
|
|
@@ -51,7 +65,9 @@ module Herb
|
|
|
51
65
|
|
|
52
66
|
def add_expression_block_result_escaped: (untyped code) -> untyped
|
|
53
67
|
|
|
54
|
-
def
|
|
68
|
+
def add_expression_block_end: (untyped code, ?escaped: untyped) -> untyped
|
|
69
|
+
|
|
70
|
+
def trailing_newline: (untyped code) -> untyped
|
|
55
71
|
|
|
56
72
|
def add_postamble: (untyped postamble) -> untyped
|
|
57
73
|
|
|
@@ -65,9 +81,9 @@ module Herb
|
|
|
65
81
|
|
|
66
82
|
def handle_parser_errors: (untyped parser_errors, untyped input, untyped _ast) -> untyped
|
|
67
83
|
|
|
68
|
-
def handle_validation_errors: (untyped
|
|
84
|
+
def handle_validation_errors: (untyped validators, untyped input) -> untyped
|
|
69
85
|
|
|
70
|
-
def add_validation_overlay: (untyped
|
|
86
|
+
def add_validation_overlay: (untyped validators, ?untyped input) -> untyped
|
|
71
87
|
|
|
72
88
|
def escape_attr: (untyped text) -> untyped
|
|
73
89
|
|
|
@@ -75,5 +91,7 @@ module Herb
|
|
|
75
91
|
|
|
76
92
|
# : () -> Array[Herb::Visitor]
|
|
77
93
|
def default_visitors: () -> Array[Herb::Visitor]
|
|
94
|
+
|
|
95
|
+
def ensure_valid_ruby!: (untyped source) -> untyped
|
|
78
96
|
end
|
|
79
97
|
end
|