yarp 0.10.0 → 0.11.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 +4 -4
- data/CHANGELOG.md +25 -1
- data/CONTRIBUTING.md +7 -0
- data/config.yml +154 -43
- data/docs/configuration.md +0 -1
- data/docs/mapping.md +91 -91
- data/docs/serialization.md +23 -20
- data/ext/yarp/api_node.c +1074 -391
- data/ext/yarp/extension.c +1 -1
- data/ext/yarp/extension.h +2 -2
- data/include/yarp/ast.h +501 -301
- data/include/yarp/diagnostic.h +198 -1
- data/include/yarp/node.h +0 -4
- data/include/yarp/util/yp_char.h +1 -1
- data/include/yarp/util/yp_constant_pool.h +11 -4
- data/include/yarp/version.h +2 -2
- data/lib/yarp/desugar_visitor.rb +19 -19
- data/lib/yarp/mutation_visitor.rb +22 -12
- data/lib/yarp/node.rb +2883 -293
- data/lib/yarp/parse_result/comments.rb +172 -0
- data/lib/yarp/parse_result/newlines.rb +60 -0
- data/lib/yarp/pattern.rb +239 -0
- data/lib/yarp/serialize.rb +152 -129
- data/lib/yarp.rb +104 -44
- data/src/diagnostic.c +254 -2
- data/src/node.c +901 -868
- data/src/prettyprint.c +380 -186
- data/src/serialize.c +325 -170
- data/src/unescape.c +20 -20
- data/src/util/yp_char.c +2 -7
- data/src/util/yp_constant_pool.c +41 -8
- data/src/util/yp_newline_list.c +5 -1
- data/src/util/yp_string_list.c +4 -1
- data/src/yarp.c +946 -818
- data/yarp.gemspec +4 -1
- metadata +6 -3
data/ext/yarp/extension.c
CHANGED
@@ -347,7 +347,7 @@ parse_input(yp_string_t *input, const char *filepath) {
|
|
347
347
|
yp_node_t *node = yp_parse(&parser);
|
348
348
|
rb_encoding *encoding = rb_enc_find(parser.encoding.name);
|
349
349
|
|
350
|
-
VALUE source = yp_source_new(&parser);
|
350
|
+
VALUE source = yp_source_new(&parser, encoding);
|
351
351
|
VALUE result_argv[] = {
|
352
352
|
yp_ast_new(&parser, node, encoding),
|
353
353
|
parser_comments(&parser, source),
|
data/ext/yarp/extension.h
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
#ifndef YARP_EXT_NODE_H
|
2
2
|
#define YARP_EXT_NODE_H
|
3
3
|
|
4
|
-
#define EXPECTED_YARP_VERSION "0.
|
4
|
+
#define EXPECTED_YARP_VERSION "0.11.0"
|
5
5
|
|
6
6
|
#include <ruby.h>
|
7
7
|
#include <ruby/encoding.h>
|
8
8
|
#include "yarp.h"
|
9
9
|
|
10
|
-
VALUE yp_source_new(yp_parser_t *parser);
|
10
|
+
VALUE yp_source_new(yp_parser_t *parser, rb_encoding *encoding);
|
11
11
|
VALUE yp_token_new(yp_parser_t *parser, yp_token_t *token, rb_encoding *encoding, VALUE source);
|
12
12
|
VALUE yp_ast_new(yp_parser_t *parser, yp_node_t *node, rb_encoding *encoding);
|
13
13
|
|