yarp 0.6.0 → 0.8.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 +55 -0
- data/CONTRIBUTING.md +4 -0
- data/{Makefile.in → Makefile} +5 -4
- data/README.md +6 -3
- data/config.yml +83 -274
- data/docs/build_system.md +4 -15
- data/docs/building.md +1 -5
- data/docs/encoding.md +1 -0
- data/docs/{extension.md → ruby_api.md} +6 -3
- data/docs/serialization.md +71 -24
- data/ext/yarp/api_node.c +173 -585
- data/ext/yarp/extconf.rb +15 -10
- data/ext/yarp/extension.c +4 -2
- data/ext/yarp/extension.h +1 -1
- data/include/yarp/ast.h +167 -306
- data/include/yarp/defines.h +5 -15
- data/include/yarp/enc/yp_encoding.h +1 -0
- data/include/yarp/unescape.h +1 -1
- data/include/yarp/util/yp_buffer.h +9 -0
- data/include/yarp/util/yp_constant_pool.h +3 -0
- data/include/yarp/util/yp_list.h +7 -7
- data/include/yarp/util/yp_newline_list.h +4 -0
- data/include/yarp/util/yp_state_stack.h +1 -1
- data/include/yarp/util/yp_string.h +5 -1
- data/include/yarp/version.h +2 -3
- data/include/yarp.h +4 -2
- data/lib/yarp/ffi.rb +226 -0
- data/lib/yarp/lex_compat.rb +16 -2
- data/lib/yarp/node.rb +594 -1437
- data/lib/yarp/ripper_compat.rb +3 -3
- data/lib/yarp/serialize.rb +312 -149
- data/lib/yarp.rb +167 -2
- data/src/enc/yp_unicode.c +9 -0
- data/src/node.c +92 -250
- data/src/prettyprint.c +81 -206
- data/src/serialize.c +124 -149
- data/src/unescape.c +29 -35
- data/src/util/yp_buffer.c +18 -0
- data/src/util/yp_list.c +7 -16
- data/src/util/yp_state_stack.c +0 -6
- data/src/util/yp_string.c +8 -17
- data/src/yarp.c +444 -717
- data/yarp.gemspec +5 -5
- metadata +6 -6
- data/config.h.in +0 -25
- data/configure +0 -4487
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef0d177f2be8f0d5ecd0ba54901e3cdf17fd6ec6f44a1b04160082ae5a1cb519
|
4
|
+
data.tar.gz: 776a4c7b981d4d6f3848bef030a448ea7d402f6ea75c20fcd87d3cbf935ecfe5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e462ba8f51d24c8164ca67804a372d1bea6f6706828801cb2404af02ee183c301e221fef21725d59e013a64652eab06eae84b3e10a427f58ee7e0eed35c3950
|
7
|
+
data.tar.gz: 9594d53c55fc434c92c0601db17c548f473ca62812a0ab57b229d5b9753315198742c83f57a44744b6572def60b4b9659cfa1f93e4d86d66fd6b2f73e0db5234
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
|
+
|
7
|
+
## [Unreleased]
|
8
|
+
|
9
|
+
## [0.8.0] - 2023-08-18
|
10
|
+
|
11
|
+
### Added
|
12
|
+
|
13
|
+
- Some performance improvements when converting from the C AST to the Ruby AST.
|
14
|
+
- Two rust crates have been added: `yarp-sys` and `yarp`. They are as yet unpublished.
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Escaped newlines in strings and heredocs are now handled more correctly.
|
19
|
+
- Dedenting heredocs that result in empty string nodes will now drop those string nodes from the list.
|
20
|
+
- Beginless and endless ranges in conditional expressions now properly form a flip flop node.
|
21
|
+
- `%` at the end of files no longer crashes.
|
22
|
+
- Location information has been corrected for `if/elsif` chains that have no `else`.
|
23
|
+
- `__END__` at the very end of the file was previously parsed as an identifier, but is now correct.
|
24
|
+
- **BREAKING**: Nodes that reference `&&=`, `||=`, and other writing operators have been consolidated. Previously, they were separate individual nodes. Now they are a tree with the target being the left-hand side and the value being the right-hand side with a joining `AndWriteNode`, `OrWriteNode`, or `OperatorWriteNode` in the middle. This impacts all of the nodes that match this pattern: `{ClassVariable,Constant,ConstantPath,GlobalVariable,InstanceVariable,LocalVariable}Operator{And,Or,}WriteNode`.
|
25
|
+
- **BREAKING**: `BlockParametersNode`, `ClassNode`, `DefNode`, `LambdaNode`, `ModuleNode`, `ParenthesesNode`, and `SingletonClassNode` have had their `statements` field renamed to `body` to give a hint that it might not be a `StatementsNode` (it could also be a `BeginNode`).
|
26
|
+
|
27
|
+
## [0.7.0] - 2023-08-14
|
28
|
+
|
29
|
+
### Added
|
30
|
+
|
31
|
+
- We now have an explicit `FlipFlopNode`. It has the same flags as `RangeNode`.
|
32
|
+
- We now have a syntax error when implicit and explicit blocks are passed to a method call.
|
33
|
+
- `Node#slice` is now implemented, for retrieving the slice of the source code corresponding to a node.
|
34
|
+
- We now support the `utf8-mac` encoding.
|
35
|
+
- Predicate methods have been added for nodes that have flags. For example `CallNode#safe_navigation?` and `RangeNode#exclude_end?`.
|
36
|
+
- The gem now functions on JRuby and TruffleRuby, thanks to a new FFI backend.
|
37
|
+
- Comments are now part of the serialization API.
|
38
|
+
|
39
|
+
### Changed
|
40
|
+
|
41
|
+
- Autotools has been removed from the build system, so when the gem is installed it will no longer need to go through a configure step.
|
42
|
+
- The AST for `foo = *bar` has changed to have an explicit array on the right hand side, rather than a splat node. This is more consistent with how other parsers handle this.
|
43
|
+
- **BREAKING**: `RangeNodeFlags` has been renamed to `RangeFlags`.
|
44
|
+
- Unary minus on number literals is now parsed as part of the literal, rather than a call to a unary operator. This is more consistent with how other parsers handle this.
|
45
|
+
|
46
|
+
## [0.6.0] - 2023-08-09
|
47
|
+
|
48
|
+
### Added
|
49
|
+
|
50
|
+
- 🎉 Initial release! 🎉
|
51
|
+
|
52
|
+
[unreleased]: https://github.com/ruby/yarp/compare/v0.8.0...HEAD
|
53
|
+
[0.8.0]: https://github.com/ruby/yarp/compare/v0.7.0...v0.8.0
|
54
|
+
[0.7.0]: https://github.com/ruby/yarp/compare/v0.6.0...v0.7.0
|
55
|
+
[0.6.0]: https://github.com/ruby/yarp/compare/d60531...v0.6.0
|
data/CONTRIBUTING.md
CHANGED
@@ -10,6 +10,10 @@ The discussions page on the GitHub repository are open. If you have a question o
|
|
10
10
|
|
11
11
|
If you want to contribute code, please first open or contribute to a discussion. A lot of the project is in flux, and we want to make sure that you are contributing to the right place. Once you have a discussion going, you can open a pull request with your changes. We will review your code and get it merged in.
|
12
12
|
|
13
|
+
### Ruby Features
|
14
|
+
|
15
|
+
Pattern matching and endless method definitions should be avoided as long as the latest TruffleRuby release does not support it.
|
16
|
+
|
13
17
|
## Tests
|
14
18
|
|
15
19
|
We could always use more tests! One of the biggest challenges of this project is building up a big test suite. If you want to contribute tests, feel free to open a pull request. These will get merged in as soon as possible.
|
data/{Makefile.in → Makefile}
RENAMED
@@ -10,10 +10,9 @@ FUZZ_OUTPUT_DIR = $(shell pwd)/fuzz/output
|
|
10
10
|
|
11
11
|
SOEXT := $(shell ruby -e 'puts RbConfig::CONFIG["SOEXT"]')
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
CC := @CC@
|
13
|
+
CPPFLAGS := -Iinclude
|
14
|
+
CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -fPIC -fvisibility=hidden
|
15
|
+
CC := cc
|
17
16
|
|
18
17
|
HEADERS := $(shell find include -name '*.h')
|
19
18
|
SOURCES := $(shell find src -name '*.c')
|
@@ -62,6 +61,8 @@ fuzz-docker-build: fuzz/docker/Dockerfile
|
|
62
61
|
$(Q) docker build -t yarp/fuzz fuzz/docker/
|
63
62
|
|
64
63
|
fuzz-run-%: FORCE fuzz-docker-build
|
64
|
+
$(ECHO) "generating templates"
|
65
|
+
$(Q) bundle exec rake templates
|
65
66
|
$(ECHO) "running $* fuzzer"
|
66
67
|
$(Q) docker run --rm -v $(shell pwd):/yarp yarp/fuzz /bin/bash -c "FUZZ_FLAGS=\"$(FUZZ_FLAGS)\" make build/fuzz.$*"
|
67
68
|
$(ECHO) "starting AFL++ run"
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ The repository contains the infrastructure for both a shared library (librubypar
|
|
8
8
|
|
9
9
|
```
|
10
10
|
.
|
11
|
-
├── Makefile
|
11
|
+
├── Makefile configuration to compile the shared library and native tests
|
12
12
|
├── Rakefile configuration to compile the native extension and run the Ruby tests
|
13
13
|
├── bin
|
14
14
|
│ ├── lex runs the lexer on a file or string, prints the tokens, and compares to ripper
|
@@ -29,6 +29,8 @@ The repository contains the infrastructure for both a shared library (librubypar
|
|
29
29
|
│ ├── yarp Ruby library files
|
30
30
|
│ └── yarp.rb main entrypoint for the Ruby library
|
31
31
|
├── rakelib various Rake tasks for the project
|
32
|
+
├── rust
|
33
|
+
│ └── yarp-sys FFI binding for Rust
|
32
34
|
├── src
|
33
35
|
│ ├── enc various encoding files
|
34
36
|
│ ├── util various utility files
|
@@ -45,7 +47,7 @@ The repository contains the infrastructure for both a shared library (librubypar
|
|
45
47
|
To compile the shared library, you will need:
|
46
48
|
|
47
49
|
* A C99 compiler
|
48
|
-
* autotools
|
50
|
+
* autotools autoconf, automake, libtool)
|
49
51
|
* make
|
50
52
|
* Ruby 3.3.0-preview1 or later
|
51
53
|
|
@@ -77,10 +79,11 @@ See the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information. We additio
|
|
77
79
|
* [Configuration](docs/configuration.md)
|
78
80
|
* [Design](docs/design.md)
|
79
81
|
* [Encoding](docs/encoding.md)
|
80
|
-
* [Extension](docs/extension.md)
|
81
82
|
* [Fuzzing](docs/fuzzing.md)
|
82
83
|
* [Heredocs](docs/heredocs.md)
|
83
84
|
* [Mapping](docs/mapping.md)
|
84
85
|
* [Ripper](docs/ripper.md)
|
86
|
+
* [Ruby API](docs/ruby_api.md)
|
85
87
|
* [Serialization](docs/serialization.md)
|
86
88
|
* [Testing](docs/testing.md)
|
89
|
+
|
data/config.yml
CHANGED
@@ -337,7 +337,7 @@ flags:
|
|
337
337
|
values:
|
338
338
|
- name: BEGIN_MODIFIER
|
339
339
|
comment: "a loop after a begin statement, so the body is executed first before the condition"
|
340
|
-
- name:
|
340
|
+
- name: RangeFlags
|
341
341
|
values:
|
342
342
|
- name: EXCLUDE_END
|
343
343
|
comment: "... operator"
|
@@ -399,6 +399,19 @@ nodes:
|
|
399
399
|
|
400
400
|
left and right
|
401
401
|
^^^^^^^^^^^^^^
|
402
|
+
- name: AndWriteNode
|
403
|
+
child_nodes:
|
404
|
+
- name: target
|
405
|
+
type: node
|
406
|
+
- name: value
|
407
|
+
type: node
|
408
|
+
- name: operator_loc
|
409
|
+
type: location
|
410
|
+
comment: |
|
411
|
+
Represents the use of the `&&=` operator.
|
412
|
+
|
413
|
+
target &&= value
|
414
|
+
^^^^^^^^^^^^^^^^
|
402
415
|
- name: ArgumentsNode
|
403
416
|
child_nodes:
|
404
417
|
- name: arguments
|
@@ -527,7 +540,7 @@ nodes:
|
|
527
540
|
- name: parameters
|
528
541
|
type: node?
|
529
542
|
kind: BlockParametersNode
|
530
|
-
- name:
|
543
|
+
- name: body
|
531
544
|
type: node?
|
532
545
|
- name: opening_loc
|
533
546
|
type: location
|
@@ -601,7 +614,8 @@ nodes:
|
|
601
614
|
type: node?
|
602
615
|
kind: BlockNode
|
603
616
|
- name: flags
|
604
|
-
type:
|
617
|
+
type: flags
|
618
|
+
kind: CallNodeFlags
|
605
619
|
- name: name
|
606
620
|
type: string
|
607
621
|
comment: |
|
@@ -713,7 +727,7 @@ nodes:
|
|
713
727
|
type: location?
|
714
728
|
- name: superclass
|
715
729
|
type: node?
|
716
|
-
- name:
|
730
|
+
- name: body
|
717
731
|
type: node?
|
718
732
|
- name: end_keyword_loc
|
719
733
|
type: location
|
@@ -722,47 +736,6 @@ nodes:
|
|
722
736
|
|
723
737
|
class Foo end
|
724
738
|
^^^^^^^^^^^^^
|
725
|
-
- name: ClassVariableOperatorAndWriteNode
|
726
|
-
child_nodes:
|
727
|
-
- name: name_loc
|
728
|
-
type: location
|
729
|
-
- name: operator_loc
|
730
|
-
type: location
|
731
|
-
- name: value
|
732
|
-
type: node
|
733
|
-
comment: |
|
734
|
-
Represents the use of the `&&=` operator for assignment to a class variable.
|
735
|
-
|
736
|
-
@@target &&= value
|
737
|
-
^^^^^^^^^^^^^^^^
|
738
|
-
- name: ClassVariableOperatorOrWriteNode
|
739
|
-
child_nodes:
|
740
|
-
- name: name_loc
|
741
|
-
type: location
|
742
|
-
- name: operator_loc
|
743
|
-
type: location
|
744
|
-
- name: value
|
745
|
-
type: node
|
746
|
-
comment: |
|
747
|
-
Represents the use of the `||=` operator for assignment to a class variable.
|
748
|
-
|
749
|
-
@@target ||= value
|
750
|
-
^^^^^^^^^^^^^^^^^^
|
751
|
-
- name: ClassVariableOperatorWriteNode
|
752
|
-
child_nodes:
|
753
|
-
- name: name_loc
|
754
|
-
type: location
|
755
|
-
- name: operator_loc
|
756
|
-
type: location
|
757
|
-
- name: value
|
758
|
-
type: node
|
759
|
-
- name: operator
|
760
|
-
type: constant
|
761
|
-
comment: |
|
762
|
-
Represents assigning to a class variable using an operator that isn't `=`.
|
763
|
-
|
764
|
-
@@target += value
|
765
|
-
^^^^^^^^^^^^^^^^^
|
766
739
|
- name: ClassVariableReadNode
|
767
740
|
comment: |
|
768
741
|
Represents referencing a class variable.
|
@@ -782,47 +755,6 @@ nodes:
|
|
782
755
|
|
783
756
|
@@foo = 1
|
784
757
|
^^^^^^^^^
|
785
|
-
- name: ConstantOperatorAndWriteNode
|
786
|
-
child_nodes:
|
787
|
-
- name: name_loc
|
788
|
-
type: location
|
789
|
-
- name: operator_loc
|
790
|
-
type: location
|
791
|
-
- name: value
|
792
|
-
type: node
|
793
|
-
comment: |
|
794
|
-
Represents the use of the `&&=` operator for assignment to a constant.
|
795
|
-
|
796
|
-
Target &&= value
|
797
|
-
^^^^^^^^^^^^^^^^
|
798
|
-
- name: ConstantOperatorOrWriteNode
|
799
|
-
child_nodes:
|
800
|
-
- name: name_loc
|
801
|
-
type: location
|
802
|
-
- name: operator_loc
|
803
|
-
type: location
|
804
|
-
- name: value
|
805
|
-
type: node
|
806
|
-
comment: |
|
807
|
-
Represents the use of the `||=` operator for assignment to a constant.
|
808
|
-
|
809
|
-
Target ||= value
|
810
|
-
^^^^^^^^^^^^^^^^
|
811
|
-
- name: ConstantOperatorWriteNode
|
812
|
-
child_nodes:
|
813
|
-
- name: name_loc
|
814
|
-
type: location
|
815
|
-
- name: operator_loc
|
816
|
-
type: location
|
817
|
-
- name: value
|
818
|
-
type: node
|
819
|
-
- name: operator
|
820
|
-
type: constant
|
821
|
-
comment: |
|
822
|
-
Represents assigning to a constant using an operator that isn't `=`.
|
823
|
-
|
824
|
-
Target += value
|
825
|
-
^^^^^^^^^^^^^^^
|
826
758
|
- name: ConstantPathNode
|
827
759
|
child_nodes:
|
828
760
|
- name: parent
|
@@ -836,50 +768,6 @@ nodes:
|
|
836
768
|
|
837
769
|
Foo::Bar
|
838
770
|
^^^^^^^^
|
839
|
-
- name: ConstantPathOperatorAndWriteNode
|
840
|
-
child_nodes:
|
841
|
-
- name: target
|
842
|
-
type: node
|
843
|
-
kind: ConstantPathNode
|
844
|
-
- name: operator_loc
|
845
|
-
type: location
|
846
|
-
- name: value
|
847
|
-
type: node
|
848
|
-
comment: |
|
849
|
-
Represents the use of the `&&=` operator for assignment to a constant path.
|
850
|
-
|
851
|
-
Parent::Child &&= value
|
852
|
-
^^^^^^^^^^^^^^^^^^^^^^^
|
853
|
-
- name: ConstantPathOperatorOrWriteNode
|
854
|
-
child_nodes:
|
855
|
-
- name: target
|
856
|
-
type: node
|
857
|
-
kind: ConstantPathNode
|
858
|
-
- name: operator_loc
|
859
|
-
type: location
|
860
|
-
- name: value
|
861
|
-
type: node
|
862
|
-
comment: |
|
863
|
-
Represents the use of the `||=` operator for assignment to a constant path.
|
864
|
-
|
865
|
-
Parent::Child ||= value
|
866
|
-
^^^^^^^^^^^^^^^^^^^^^^^
|
867
|
-
- name: ConstantPathOperatorWriteNode
|
868
|
-
child_nodes:
|
869
|
-
- name: target
|
870
|
-
type: node
|
871
|
-
kind: ConstantPathNode
|
872
|
-
- name: operator_loc
|
873
|
-
type: location
|
874
|
-
- name: value
|
875
|
-
type: node
|
876
|
-
- name: operator
|
877
|
-
type: constant
|
878
|
-
comment: |
|
879
|
-
Represents assigning to a constant path using an operator that isn't `=`.
|
880
|
-
|
881
|
-
Parent::Child += value
|
882
|
-
^^^^^^^^^^^^^^^^^^^^^^
|
883
771
|
- name: ConstantPathWriteNode
|
884
772
|
child_nodes:
|
885
773
|
- name: target
|
@@ -928,7 +816,7 @@ nodes:
|
|
928
816
|
- name: parameters
|
929
817
|
type: node?
|
930
818
|
kind: ParametersNode
|
931
|
-
- name:
|
819
|
+
- name: body
|
932
820
|
type: node?
|
933
821
|
- name: locals
|
934
822
|
type: constant[]
|
@@ -1053,6 +941,22 @@ nodes:
|
|
1053
941
|
|
1054
942
|
foo in Foo(*bar, baz, *qux)
|
1055
943
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
944
|
+
- name: FlipFlopNode
|
945
|
+
child_nodes:
|
946
|
+
- name: left
|
947
|
+
type: node?
|
948
|
+
- name: right
|
949
|
+
type: node?
|
950
|
+
- name: operator_loc
|
951
|
+
type: location
|
952
|
+
- name: flags
|
953
|
+
type: flags
|
954
|
+
kind: RangeFlags
|
955
|
+
comment: |
|
956
|
+
Represents the use of the `..` or `...` operators to create flip flops.
|
957
|
+
|
958
|
+
baz if foo .. bar
|
959
|
+
^^^^^^^^^^
|
1056
960
|
- name: FloatNode
|
1057
961
|
comment: |
|
1058
962
|
Represents a floating point number literal.
|
@@ -1106,47 +1010,6 @@ nodes:
|
|
1106
1010
|
|
1107
1011
|
super
|
1108
1012
|
^^^^^
|
1109
|
-
- name: GlobalVariableOperatorAndWriteNode
|
1110
|
-
child_nodes:
|
1111
|
-
- name: name_loc
|
1112
|
-
type: location
|
1113
|
-
- name: operator_loc
|
1114
|
-
type: location
|
1115
|
-
- name: value
|
1116
|
-
type: node
|
1117
|
-
comment: |
|
1118
|
-
Represents the use of the `&&=` operator for assignment to a global variable.
|
1119
|
-
|
1120
|
-
$target &&= value
|
1121
|
-
^^^^^^^^^^^^^^^^^
|
1122
|
-
- name: GlobalVariableOperatorOrWriteNode
|
1123
|
-
child_nodes:
|
1124
|
-
- name: name_loc
|
1125
|
-
type: location
|
1126
|
-
- name: operator_loc
|
1127
|
-
type: location
|
1128
|
-
- name: value
|
1129
|
-
type: node
|
1130
|
-
comment: |
|
1131
|
-
Represents the use of the `||=` operator for assignment to a global variable.
|
1132
|
-
|
1133
|
-
$target ||= value
|
1134
|
-
^^^^^^^^^^^^^^^^^
|
1135
|
-
- name: GlobalVariableOperatorWriteNode
|
1136
|
-
child_nodes:
|
1137
|
-
- name: name_loc
|
1138
|
-
type: location
|
1139
|
-
- name: operator_loc
|
1140
|
-
type: location
|
1141
|
-
- name: value
|
1142
|
-
type: node
|
1143
|
-
- name: operator
|
1144
|
-
type: constant
|
1145
|
-
comment: |
|
1146
|
-
Represents assigning to a global variable using an operator that isn't `=`.
|
1147
|
-
|
1148
|
-
$target += value
|
1149
|
-
^^^^^^^^^^^^^^^^
|
1150
1013
|
- name: GlobalVariableReadNode
|
1151
1014
|
comment: |
|
1152
1015
|
Represents referencing a global variable.
|
@@ -1246,47 +1109,6 @@ nodes:
|
|
1246
1109
|
|
1247
1110
|
case a; in b then c end
|
1248
1111
|
^^^^^^^^^^^
|
1249
|
-
- name: InstanceVariableOperatorAndWriteNode
|
1250
|
-
child_nodes:
|
1251
|
-
- name: name_loc
|
1252
|
-
type: location
|
1253
|
-
- name: operator_loc
|
1254
|
-
type: location
|
1255
|
-
- name: value
|
1256
|
-
type: node
|
1257
|
-
comment: |
|
1258
|
-
Represents the use of the `&&=` operator for assignment to an instance variable.
|
1259
|
-
|
1260
|
-
@target &&= value
|
1261
|
-
^^^^^^^^^^^^^^^^^
|
1262
|
-
- name: InstanceVariableOperatorOrWriteNode
|
1263
|
-
child_nodes:
|
1264
|
-
- name: name_loc
|
1265
|
-
type: location
|
1266
|
-
- name: operator_loc
|
1267
|
-
type: location
|
1268
|
-
- name: value
|
1269
|
-
type: node
|
1270
|
-
comment: |
|
1271
|
-
Represents the use of the `||=` operator for assignment to an instance variable.
|
1272
|
-
|
1273
|
-
@target ||= value
|
1274
|
-
^^^^^^^^^^^^^^^^^
|
1275
|
-
- name: InstanceVariableOperatorWriteNode
|
1276
|
-
child_nodes:
|
1277
|
-
- name: name_loc
|
1278
|
-
type: location
|
1279
|
-
- name: operator_loc
|
1280
|
-
type: location
|
1281
|
-
- name: value
|
1282
|
-
type: node
|
1283
|
-
- name: operator
|
1284
|
-
type: constant
|
1285
|
-
comment: |
|
1286
|
-
Represents assigning to an instance variable using an operator that isn't `=`.
|
1287
|
-
|
1288
|
-
@target += value
|
1289
|
-
^^^^^^^^^^^^^^^^
|
1290
1112
|
- name: InstanceVariableReadNode
|
1291
1113
|
comment: |
|
1292
1114
|
Represents referencing an instance variable.
|
@@ -1321,7 +1143,8 @@ nodes:
|
|
1321
1143
|
- name: closing_loc
|
1322
1144
|
type: location
|
1323
1145
|
- name: flags
|
1324
|
-
type:
|
1146
|
+
type: flags
|
1147
|
+
kind: RegularExpressionFlags
|
1325
1148
|
newline: parts
|
1326
1149
|
comment: |
|
1327
1150
|
Represents a regular expression literal that contains interpolation.
|
@@ -1416,60 +1239,13 @@ nodes:
|
|
1416
1239
|
- name: parameters
|
1417
1240
|
type: node?
|
1418
1241
|
kind: BlockParametersNode
|
1419
|
-
- name:
|
1242
|
+
- name: body
|
1420
1243
|
type: node?
|
1421
1244
|
comment: |
|
1422
1245
|
Represents using a lambda literal (not the lambda method call).
|
1423
1246
|
|
1424
1247
|
->(value) { value * 2 }
|
1425
1248
|
^^^^^^^^^^^^^^^^^^^^^^^
|
1426
|
-
- name: LocalVariableOperatorAndWriteNode
|
1427
|
-
child_nodes:
|
1428
|
-
- name: name_loc
|
1429
|
-
type: location
|
1430
|
-
- name: operator_loc
|
1431
|
-
type: location
|
1432
|
-
- name: value
|
1433
|
-
type: node
|
1434
|
-
- name: constant_id
|
1435
|
-
type: constant
|
1436
|
-
comment: |
|
1437
|
-
Represents the use of the `&&=` operator for assignment to a local variable.
|
1438
|
-
|
1439
|
-
target &&= value
|
1440
|
-
^^^^^^^^^^^^^^^^
|
1441
|
-
- name: LocalVariableOperatorOrWriteNode
|
1442
|
-
child_nodes:
|
1443
|
-
- name: name_loc
|
1444
|
-
type: location
|
1445
|
-
- name: operator_loc
|
1446
|
-
type: location
|
1447
|
-
- name: value
|
1448
|
-
type: node
|
1449
|
-
- name: constant_id
|
1450
|
-
type: constant
|
1451
|
-
comment: |
|
1452
|
-
Represents the use of the `||=` operator for assignment to a local variable.
|
1453
|
-
|
1454
|
-
target ||= value
|
1455
|
-
^^^^^^^^^^^^^^^^
|
1456
|
-
- name: LocalVariableOperatorWriteNode
|
1457
|
-
child_nodes:
|
1458
|
-
- name: name_loc
|
1459
|
-
type: location
|
1460
|
-
- name: operator_loc
|
1461
|
-
type: location
|
1462
|
-
- name: value
|
1463
|
-
type: node
|
1464
|
-
- name: constant_id
|
1465
|
-
type: constant
|
1466
|
-
- name: operator_id
|
1467
|
-
type: constant
|
1468
|
-
comment: |
|
1469
|
-
Represents assigning to a local variable using an operator that isn't `=`.
|
1470
|
-
|
1471
|
-
target += value
|
1472
|
-
^^^^^^^^^^^^^^^
|
1473
1249
|
- name: LocalVariableReadNode
|
1474
1250
|
child_nodes:
|
1475
1251
|
- name: constant_id
|
@@ -1538,7 +1314,7 @@ nodes:
|
|
1538
1314
|
type: location
|
1539
1315
|
- name: constant_path
|
1540
1316
|
type: node
|
1541
|
-
- name:
|
1317
|
+
- name: body
|
1542
1318
|
type: node?
|
1543
1319
|
- name: end_keyword_loc
|
1544
1320
|
type: location
|
@@ -1600,6 +1376,21 @@ nodes:
|
|
1600
1376
|
|
1601
1377
|
$1
|
1602
1378
|
^^
|
1379
|
+
- name: OperatorWriteNode
|
1380
|
+
child_nodes:
|
1381
|
+
- name: target
|
1382
|
+
type: node
|
1383
|
+
- name: operator_loc
|
1384
|
+
type: location
|
1385
|
+
- name: operator
|
1386
|
+
type: constant
|
1387
|
+
- name: value
|
1388
|
+
type: node
|
1389
|
+
comment: |
|
1390
|
+
Represents the use of an operator on a write.
|
1391
|
+
|
1392
|
+
target += value
|
1393
|
+
^^^^^^^^^^^^^^^
|
1603
1394
|
- name: OptionalParameterNode
|
1604
1395
|
child_nodes:
|
1605
1396
|
- name: constant_id
|
@@ -1629,6 +1420,19 @@ nodes:
|
|
1629
1420
|
|
1630
1421
|
left or right
|
1631
1422
|
^^^^^^^^^^^^^
|
1423
|
+
- name: OrWriteNode
|
1424
|
+
child_nodes:
|
1425
|
+
- name: target
|
1426
|
+
type: node
|
1427
|
+
- name: value
|
1428
|
+
type: node
|
1429
|
+
- name: operator_loc
|
1430
|
+
type: location
|
1431
|
+
comment: |
|
1432
|
+
Represents the use of the `||=` operator.
|
1433
|
+
|
1434
|
+
target ||= value
|
1435
|
+
^^^^^^^^^^^^^^^^
|
1632
1436
|
- name: ParametersNode
|
1633
1437
|
child_nodes:
|
1634
1438
|
- name: requireds
|
@@ -1655,7 +1459,7 @@ nodes:
|
|
1655
1459
|
end
|
1656
1460
|
- name: ParenthesesNode
|
1657
1461
|
child_nodes:
|
1658
|
-
- name:
|
1462
|
+
- name: body
|
1659
1463
|
type: node?
|
1660
1464
|
- name: opening_loc
|
1661
1465
|
type: location
|
@@ -1744,7 +1548,8 @@ nodes:
|
|
1744
1548
|
- name: operator_loc
|
1745
1549
|
type: location
|
1746
1550
|
- name: flags
|
1747
|
-
type:
|
1551
|
+
type: flags
|
1552
|
+
kind: RangeFlags
|
1748
1553
|
comment: |
|
1749
1554
|
Represents the use of the `..` or `...` operators.
|
1750
1555
|
|
@@ -1779,7 +1584,8 @@ nodes:
|
|
1779
1584
|
- name: unescaped
|
1780
1585
|
type: string
|
1781
1586
|
- name: flags
|
1782
|
-
type:
|
1587
|
+
type: flags
|
1588
|
+
kind: RegularExpressionFlags
|
1783
1589
|
comment: |
|
1784
1590
|
Represents a regular expression literal with no interpolation.
|
1785
1591
|
|
@@ -1896,7 +1702,7 @@ nodes:
|
|
1896
1702
|
type: location
|
1897
1703
|
- name: expression
|
1898
1704
|
type: node
|
1899
|
-
- name:
|
1705
|
+
- name: body
|
1900
1706
|
type: node?
|
1901
1707
|
- name: end_keyword_loc
|
1902
1708
|
type: location
|
@@ -1912,7 +1718,6 @@ nodes:
|
|
1912
1718
|
__ENCODING__
|
1913
1719
|
^^^^^^^^^^^^
|
1914
1720
|
- name: SourceFileNode
|
1915
|
-
is_migrated: true
|
1916
1721
|
child_nodes:
|
1917
1722
|
- name: filepath
|
1918
1723
|
type: string
|
@@ -2070,7 +1875,8 @@ nodes:
|
|
2070
1875
|
type: node?
|
2071
1876
|
kind: StatementsNode
|
2072
1877
|
- name: flags
|
2073
|
-
type:
|
1878
|
+
type: flags
|
1879
|
+
kind: LoopFlags
|
2074
1880
|
newline: predicate
|
2075
1881
|
comment: |
|
2076
1882
|
Represents the use of the `until` keyword, either in the block form or the modifier form.
|
@@ -2090,10 +1896,12 @@ nodes:
|
|
2090
1896
|
type: node?
|
2091
1897
|
kind: StatementsNode
|
2092
1898
|
comment: |
|
2093
|
-
case
|
2094
|
-
|
2095
|
-
|
2096
|
-
|
1899
|
+
Represents the use of the `when` keyword within a case statement.
|
1900
|
+
|
1901
|
+
case true
|
1902
|
+
when true
|
1903
|
+
^^^^^^^^^
|
1904
|
+
end
|
2097
1905
|
- name: WhileNode
|
2098
1906
|
child_nodes:
|
2099
1907
|
- name: keyword_loc
|
@@ -2104,7 +1912,8 @@ nodes:
|
|
2104
1912
|
type: node?
|
2105
1913
|
kind: StatementsNode
|
2106
1914
|
- name: flags
|
2107
|
-
type:
|
1915
|
+
type: flags
|
1916
|
+
kind: LoopFlags
|
2108
1917
|
newline: predicate
|
2109
1918
|
comment: |
|
2110
1919
|
Represents the use of the `while` keyword, either in the block form or the modifier form.
|