@herb-tools/node 0.7.0 → 0.7.2
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.
- package/dist/herb-node.esm.js +1 -1
- package/extension/error_helpers.cpp +1 -1
- package/extension/error_helpers.h +1 -1
- package/extension/libherb/ast_nodes.c +1 -1
- package/extension/libherb/ast_nodes.h +1 -1
- package/extension/libherb/ast_pretty_print.c +1 -1
- package/extension/libherb/ast_pretty_print.h +1 -1
- package/extension/libherb/errors.c +1 -1
- package/extension/libherb/errors.h +1 -1
- package/extension/libherb/include/ast_nodes.h +1 -1
- package/extension/libherb/include/ast_pretty_print.h +1 -1
- package/extension/libherb/include/errors.h +1 -1
- package/extension/libherb/include/version.h +1 -1
- package/extension/libherb/parser.c +19 -9
- package/extension/libherb/version.h +1 -1
- package/extension/libherb/visitor.c +1 -1
- package/extension/nodes.cpp +1 -1
- package/extension/nodes.h +1 -1
- package/extension/prism/include/prism/ast.h +275 -49
- package/extension/prism/include/prism/diagnostic.h +4 -0
- package/extension/prism/include/prism/options.h +43 -3
- package/extension/prism/include/prism/regexp.h +2 -2
- package/extension/prism/include/prism/util/pm_buffer.h +8 -0
- package/extension/prism/include/prism/util/pm_integer.h +4 -0
- package/extension/prism/include/prism/util/pm_list.h +6 -0
- package/extension/prism/include/prism/util/pm_string.h +12 -2
- package/extension/prism/include/prism/version.h +3 -3
- package/extension/prism/include/prism.h +39 -14
- package/extension/prism/src/diagnostic.c +7 -1
- package/extension/prism/src/node.c +2 -0
- package/extension/prism/src/options.c +2 -2
- package/extension/prism/src/prettyprint.c +2 -0
- package/extension/prism/src/prism.c +248 -130
- package/extension/prism/src/serialize.c +2 -0
- package/extension/prism/src/token_type.c +36 -34
- package/package.json +2 -2
package/dist/herb-node.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/javascript/packages/node/extension/error_helpers.cpp.erb
|
|
3
3
|
|
|
4
4
|
#include <node_api.h>
|
|
5
5
|
#include "error_helpers.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/javascript/packages/node/extension/error_helpers.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_EXTENSION_ERRORS_H
|
|
5
5
|
#define HERB_EXTENSION_ERRORS_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/ast_nodes.c.erb
|
|
3
3
|
|
|
4
4
|
#include <stdio.h>
|
|
5
5
|
#include <stdbool.h>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/ast_nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_NODES_H
|
|
5
5
|
#define HERB_AST_NODES_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/ast_pretty_print.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/ast_node.h"
|
|
5
5
|
#include "include/ast_nodes.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/ast_pretty_print.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_PRETTY_PRINT_H
|
|
5
5
|
#define HERB_AST_PRETTY_PRINT_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/errors.c.erb
|
|
3
3
|
|
|
4
4
|
#include "include/array.h"
|
|
5
5
|
#include "include/errors.h"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/errors.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_ERRORS_H
|
|
5
5
|
#define HERB_ERRORS_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/ast_nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_NODES_H
|
|
5
5
|
#define HERB_AST_NODES_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/ast_pretty_print.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_AST_PRETTY_PRINT_H
|
|
5
5
|
#define HERB_AST_PRETTY_PRINT_H
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/include/errors.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_ERRORS_H
|
|
5
5
|
#define HERB_ERRORS_H
|
|
@@ -555,14 +555,12 @@ static AST_HTML_ATTRIBUTE_VALUE_NODE_T* parser_parse_html_attribute_value(parser
|
|
|
555
555
|
return value;
|
|
556
556
|
}
|
|
557
557
|
|
|
558
|
-
token_T* token = parser_advance(parser);
|
|
559
|
-
|
|
560
558
|
append_unexpected_error(
|
|
561
559
|
"Unexpected Token",
|
|
562
560
|
"TOKEN_IDENTIFIER, TOKEN_QUOTE, TOKEN_ERB_START",
|
|
563
|
-
token_type_to_string(
|
|
564
|
-
|
|
565
|
-
|
|
561
|
+
token_type_to_string(parser->current_token->type),
|
|
562
|
+
parser->current_token->location->start,
|
|
563
|
+
parser->current_token->location->end,
|
|
566
564
|
errors
|
|
567
565
|
);
|
|
568
566
|
|
|
@@ -571,13 +569,11 @@ static AST_HTML_ATTRIBUTE_VALUE_NODE_T* parser_parse_html_attribute_value(parser
|
|
|
571
569
|
children,
|
|
572
570
|
NULL,
|
|
573
571
|
false,
|
|
574
|
-
|
|
575
|
-
|
|
572
|
+
parser->current_token->location->start,
|
|
573
|
+
parser->current_token->location->end,
|
|
576
574
|
errors
|
|
577
575
|
);
|
|
578
576
|
|
|
579
|
-
token_free(token);
|
|
580
|
-
|
|
581
577
|
return value;
|
|
582
578
|
}
|
|
583
579
|
|
|
@@ -805,6 +801,20 @@ static AST_HTML_OPEN_TAG_NODE_T* parser_parse_html_open_tag(parser_T* parser) {
|
|
|
805
801
|
continue;
|
|
806
802
|
}
|
|
807
803
|
|
|
804
|
+
if (parser->current_token->type == TOKEN_COLON) {
|
|
805
|
+
lexer_T lexer_copy = *parser->lexer;
|
|
806
|
+
token_T* next_token = lexer_next_token(&lexer_copy);
|
|
807
|
+
|
|
808
|
+
if (next_token && next_token->type == TOKEN_IDENTIFIER) {
|
|
809
|
+
token_free(next_token);
|
|
810
|
+
array_append(children, parser_parse_html_attribute(parser));
|
|
811
|
+
|
|
812
|
+
continue;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
token_free(next_token);
|
|
816
|
+
}
|
|
817
|
+
|
|
808
818
|
parser_append_unexpected_error(
|
|
809
819
|
parser,
|
|
810
820
|
"Unexpected Token",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/src/visitor.c.erb
|
|
3
3
|
|
|
4
4
|
#include <stdio.h>
|
|
5
5
|
|
package/extension/nodes.cpp
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/javascript/packages/node/extension/nodes.cpp.erb
|
|
3
3
|
|
|
4
4
|
#include <node_api.h>
|
|
5
5
|
#include "error_helpers.h"
|
package/extension/nodes.h
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// NOTE: This file is generated by the templates/template.rb script and should not
|
|
2
|
-
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.
|
|
2
|
+
// be modified manually. See /Users/marcoroth/Development/herb-release-0.7.2/templates/javascript/packages/node/extension/nodes.h.erb
|
|
3
3
|
|
|
4
4
|
#ifndef HERB_EXTENSION_NODES_H
|
|
5
5
|
#define HERB_EXTENSION_NODES_H
|