parser 2.6.5.0 → 2.7.0.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.
- checksums.yaml +4 -4
 - data/.travis.yml +6 -0
 - data/CHANGELOG.md +46 -0
 - data/README.md +7 -0
 - data/doc/AST_FORMAT.md +346 -20
 - data/lib/parser.rb +3 -1
 - data/lib/parser/ast/processor.rb +15 -0
 - data/lib/parser/base.rb +19 -0
 - data/lib/parser/builders/default.rb +245 -12
 - data/lib/parser/context.rb +4 -0
 - data/lib/parser/current.rb +4 -4
 - data/lib/parser/current_arg_stack.rb +43 -0
 - data/lib/parser/lexer.rb +11444 -11437
 - data/lib/parser/lexer.rl +97 -94
 - data/lib/parser/lexer/dedenter.rb +52 -49
 - data/lib/parser/{lexer/max_numparam_stack.rb → max_numparam_stack.rb} +10 -4
 - data/lib/parser/messages.rb +34 -29
 - data/lib/parser/meta.rb +6 -2
 - data/lib/parser/ruby27.rb +4174 -3318
 - data/lib/parser/ruby27.y +488 -35
 - data/lib/parser/static_environment.rb +10 -0
 - data/lib/parser/variables_stack.rb +32 -0
 - data/lib/parser/version.rb +1 -1
 - data/test/helper.rb +1 -0
 - data/test/parse_helper.rb +3 -0
 - data/test/test_lexer.rb +7 -66
 - data/test/test_parser.rb +1788 -123
 - metadata +6 -4
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: eb64651ef64daa71d4c55d8ab253c90ce470eaf85f3b0ce98dfe5f171a681c80
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: a875a3b5c4a92b7fae3a58c379c300519e7c328641a7cb8d8a65e3f131118eed
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8bd9f983ef31671217011a895e07b466f5327578f1dbc2288e5bcd08e367d038e0ee53c35ee1851323c8b04ab20e3fd27c1347a7615c869a99ebcebc8a949baf
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: cab52019893fb86e6fe66aaa9391d9d6cd721daac62550f7a0d2303bafbcc6deac349c4366315f8bc4ba15f6309b7ead3f30e3ff8fcd0e15a394c63c86071db7
         
     | 
    
        data/.travis.yml
    CHANGED
    
    | 
         @@ -20,6 +20,9 @@ matrix: 
     | 
|
| 
       20 
20 
     | 
    
         
             
                - name: 2.6.5 / Parser tests
         
     | 
| 
       21 
21 
     | 
    
         
             
                  rvm: 2.6.5
         
     | 
| 
       22 
22 
     | 
    
         
             
                  script: bundle exec rake test_cov
         
     | 
| 
      
 23 
     | 
    
         
            +
                - name: 2.7.0 / Parser tests
         
     | 
| 
      
 24 
     | 
    
         
            +
                  rvm: 2.7.0
         
     | 
| 
      
 25 
     | 
    
         
            +
                  script: bundle exec rake test_cov
         
     | 
| 
       23 
26 
     | 
    
         
             
                - name: ruby-head / Parser tests
         
     | 
| 
       24 
27 
     | 
    
         
             
                  rvm: ruby-head
         
     | 
| 
       25 
28 
     | 
    
         
             
                  script: bundle exec rake test_cov
         
     | 
| 
         @@ -35,6 +38,9 @@ matrix: 
     | 
|
| 
       35 
38 
     | 
    
         
             
                - name: 2.6.5 / Rubocop tests
         
     | 
| 
       36 
39 
     | 
    
         
             
                  rvm: 2.6.5
         
     | 
| 
       37 
40 
     | 
    
         
             
                  script: ./ci/run_rubocop_specs
         
     | 
| 
      
 41 
     | 
    
         
            +
                - name: 2.7.0 / Rubocop tests
         
     | 
| 
      
 42 
     | 
    
         
            +
                  rvm: 2.7.0
         
     | 
| 
      
 43 
     | 
    
         
            +
                  script: ./ci/run_rubocop_specs
         
     | 
| 
       38 
44 
     | 
    
         
             
              allow_failures:
         
     | 
| 
       39 
45 
     | 
    
         
             
                - rvm: ruby-head
         
     | 
| 
       40 
46 
     | 
    
         
             
                - rvm: rbx-2
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,6 +1,52 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            Changelog
         
     | 
| 
       2 
2 
     | 
    
         
             
            =========
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
      
 4 
     | 
    
         
            +
            Not released (2020-01-08)
         
     | 
| 
      
 5 
     | 
    
         
            +
            -------------------------
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            Bugs fixed:
         
     | 
| 
      
 8 
     | 
    
         
            +
             * lexer.rl: fix paren_nest for curly braces (#646) (Ilya Bylich)
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            v2.7.0.1 (2019-12-30)
         
     | 
| 
      
 11 
     | 
    
         
            +
            ---------------------
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            Bugs fixed:
         
     | 
| 
      
 14 
     | 
    
         
            +
             * dedenter.rb: prevent `ArgumentError` when processing binary en… (#642) (Koichi ITO)
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            v2.7.0.0 (2019-12-26)
         
     | 
| 
      
 17 
     | 
    
         
            +
            ---------------------
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            API modifications:
         
     | 
| 
      
 20 
     | 
    
         
            +
             * README.md: documented compatibility issue with EOF chars after… (#637) (Ilya Bylich)
         
     | 
| 
      
 21 
     | 
    
         
            +
             * ruby27.y: refactor logic around 'circular argument reference'(#628) (Ilya Bylich)
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            Features implemented:
         
     | 
| 
      
 24 
     | 
    
         
            +
             * ruby27.y: added pattern matching (#574) (Ilya Bylich)
         
     | 
| 
      
 25 
     | 
    
         
            +
             * lexer.rl: parse embedded ivars/cvars starting with digit as str (#639) (Ilya Bylich)
         
     | 
| 
      
 26 
     | 
    
         
            +
             * lexer.rl: warn on `...` at EOL. (#636) (Ilya Bylich)
         
     | 
| 
      
 27 
     | 
    
         
            +
             * ruby27.y: removed opt_block_args_tail: tOROP rule. (#635) (Ilya Bylich)
         
     | 
| 
      
 28 
     | 
    
         
            +
             * ruby27.y: reverted method reference operator (added in #634) (Ilya Bylich)
         
     | 
| 
      
 29 
     | 
    
         
            +
             * ruby27.y: treat numparams as locals outside numblock. (#633) (Ilya Bylich)
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
            Bugs fixed:
         
     | 
| 
      
 32 
     | 
    
         
            +
             * dedenter.rb: fixed over-dedenting of squiggly heredocs (#641) (Ilya Bylich)
         
     | 
| 
      
 33 
     | 
    
         
            +
             * ruby27.y: added "arguments forwarding" (#625) (Ilya Bylich)
         
     | 
| 
      
 34 
     | 
    
         
            +
             * ruby27.y: reject circular argument reference. (#622) (Ilya Bylich)
         
     | 
| 
      
 35 
     | 
    
         
            +
             * ruby27.y: changed prefix of numparams to "_" (#620) (Ilya Bylich)
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            v2.6.5.0 (2019-10-03)
         
     | 
| 
      
 38 
     | 
    
         
            +
            ---------------------
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            API modifications:
         
     | 
| 
      
 41 
     | 
    
         
            +
             * Bump ruby versions to 2.4.9, 2.5.7 and 2.6.5. (#619) (Ilya Bylich)
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
            Features implemented:
         
     | 
| 
      
 44 
     | 
    
         
            +
             * lexer.rl: changed max numparam to `@9` (#617) (Ilya Bylich)
         
     | 
| 
      
 45 
     | 
    
         
            +
             * lexer.rl: support comments before leading dot in 27 mode. (#613) (Ilya Bylich)
         
     | 
| 
      
 46 
     | 
    
         
            +
             
     | 
| 
      
 47 
     | 
    
         
            +
            Bugs fixed:
         
     | 
| 
      
 48 
     | 
    
         
            +
             * lexer.rl: emit tMETHREF as tDOT+tCOLON for rubies \< 27. (#614) (Ilya Bylich)
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
       4 
50 
     | 
    
         
             
            v2.6.4.1 (2019-09-12)
         
     | 
| 
       5 
51 
     | 
    
         
             
            ---------------------
         
     | 
| 
       6 
52 
     | 
    
         | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -269,6 +269,13 @@ follows 2.1 behavior. 
     | 
|
| 
       269 
269 
     | 
    
         | 
| 
       270 
270 
     | 
    
         
             
            No known code is affected by this issue.
         
     | 
| 
       271 
271 
     | 
    
         | 
| 
      
 272 
     | 
    
         
            +
            ### EOF characters after embedded documents before 2.7
         
     | 
| 
      
 273 
     | 
    
         
            +
             
     | 
| 
      
 274 
     | 
    
         
            +
            Code like `"=begin\n""=end\0"` is invalid for all versions of Ruby before 2.7. Ruby 2.7 and later parses it
         
     | 
| 
      
 275 
     | 
    
         
            +
            normally. Parser follows 2.7 behavior.
         
     | 
| 
      
 276 
     | 
    
         
            +
             
     | 
| 
      
 277 
     | 
    
         
            +
            It is unknown whether any gems are affected by this issue.
         
     | 
| 
      
 278 
     | 
    
         
            +
             
     | 
| 
       272 
279 
     | 
    
         
             
            ## Contributors
         
     | 
| 
       273 
280 
     | 
    
         | 
| 
       274 
281 
     | 
    
         
             
            * [whitequark][]
         
     | 
    
        data/doc/AST_FORMAT.md
    CHANGED
    
    | 
         @@ -602,18 +602,6 @@ Format: 
     | 
|
| 
       602 
602 
     | 
    
         
             
             ~~~~~~~~~~~~~ expression
         
     | 
| 
       603 
603 
     | 
    
         
             
            ~~~
         
     | 
| 
       604 
604 
     | 
    
         | 
| 
       605 
     | 
    
         
            -
            ### Method reference operator
         
     | 
| 
       606 
     | 
    
         
            -
             
     | 
| 
       607 
     | 
    
         
            -
            Format:
         
     | 
| 
       608 
     | 
    
         
            -
             
     | 
| 
       609 
     | 
    
         
            -
            ~~~
         
     | 
| 
       610 
     | 
    
         
            -
            (meth-ref (self) :foo)
         
     | 
| 
       611 
     | 
    
         
            -
            "self.:foo"
         
     | 
| 
       612 
     | 
    
         
            -
                 ^^ dot
         
     | 
| 
       613 
     | 
    
         
            -
                   ^^^ selector
         
     | 
| 
       614 
     | 
    
         
            -
             ^^^^^^^^^ expression
         
     | 
| 
       615 
     | 
    
         
            -
            ~~~
         
     | 
| 
       616 
     | 
    
         
            -
             
     | 
| 
       617 
605 
     | 
    
         
             
            ### Multiple assignment
         
     | 
| 
       618 
606 
     | 
    
         | 
| 
       619 
607 
     | 
    
         
             
            #### Multiple left hand side
         
     | 
| 
         @@ -1118,22 +1106,41 @@ Format: 
     | 
|
| 
       1118 
1106 
     | 
    
         
             
            s(:numblock,
         
     | 
| 
       1119 
1107 
     | 
    
         
             
              s(:send, nil, :proc), 3,
         
     | 
| 
       1120 
1108 
     | 
    
         
             
              s(:send,
         
     | 
| 
       1121 
     | 
    
         
            -
                s(: 
     | 
| 
       1122 
     | 
    
         
            -
                s(: 
     | 
| 
       1123 
     | 
    
         
            -
            "proc {  
     | 
| 
      
 1109 
     | 
    
         
            +
                s(:lvar, :_1), :+,
         
     | 
| 
      
 1110 
     | 
    
         
            +
                s(:lvar, :_3)))
         
     | 
| 
      
 1111 
     | 
    
         
            +
            "proc { _1 + _3 }"
         
     | 
| 
       1124 
1112 
     | 
    
         
             
                  ~ begin   ~ end
         
     | 
| 
       1125 
1113 
     | 
    
         
             
             ~~~~~~~~~~~~~~~~ expression
         
     | 
| 
       1126 
1114 
     | 
    
         
             
            ~~~
         
     | 
| 
       1127 
1115 
     | 
    
         | 
| 
       1128 
     | 
    
         
            -
             
     | 
| 
      
 1116 
     | 
    
         
            +
            ## Forward arguments
         
     | 
| 
      
 1117 
     | 
    
         
            +
             
     | 
| 
      
 1118 
     | 
    
         
            +
            ### Method definition accepting forwarding arguments
         
     | 
| 
      
 1119 
     | 
    
         
            +
             
     | 
| 
      
 1120 
     | 
    
         
            +
            Ruby 2.7 introduced a feature called "arguments forwarding".
         
     | 
| 
      
 1121 
     | 
    
         
            +
            When a method takes any arguments for forwarding them in the future
         
     | 
| 
      
 1122 
     | 
    
         
            +
            the whole `args` node gets replaced with `forward-args` node.
         
     | 
| 
       1129 
1123 
     | 
    
         | 
| 
       1130 
1124 
     | 
    
         
             
            Format:
         
     | 
| 
       1131 
1125 
     | 
    
         | 
| 
       1132 
1126 
     | 
    
         
             
            ~~~
         
     | 
| 
       1133 
     | 
    
         
            -
            ( 
     | 
| 
       1134 
     | 
    
         
            -
             
     | 
| 
       1135 
     | 
    
         
            -
              
     | 
| 
       1136 
     | 
    
         
            -
              
     | 
| 
      
 1127 
     | 
    
         
            +
            (def :foo
         
     | 
| 
      
 1128 
     | 
    
         
            +
              (forward-args) nil)
         
     | 
| 
      
 1129 
     | 
    
         
            +
            "def foo(...); end"
         
     | 
| 
      
 1130 
     | 
    
         
            +
                        ~ end
         
     | 
| 
      
 1131 
     | 
    
         
            +
                    ~ begin
         
     | 
| 
      
 1132 
     | 
    
         
            +
                    ~~~~~ expression
         
     | 
| 
      
 1133 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1134 
     | 
    
         
            +
             
     | 
| 
      
 1135 
     | 
    
         
            +
            ### Method call taking arguments of the currently forwarding method
         
     | 
| 
      
 1136 
     | 
    
         
            +
             
     | 
| 
      
 1137 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1138 
     | 
    
         
            +
             
     | 
| 
      
 1139 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1140 
     | 
    
         
            +
            (send nil :foo
         
     | 
| 
      
 1141 
     | 
    
         
            +
              (forwarded-args))
         
     | 
| 
      
 1142 
     | 
    
         
            +
            "foo(...)"
         
     | 
| 
      
 1143 
     | 
    
         
            +
                 ~~~ expression
         
     | 
| 
       1137 
1144 
     | 
    
         
             
            ~~~
         
     | 
| 
       1138 
1145 
     | 
    
         | 
| 
       1139 
1146 
     | 
    
         
             
            ## Send
         
     | 
| 
         @@ -1814,3 +1821,322 @@ Format: 
     | 
|
| 
       1814 
1821 
     | 
    
         
             
            "__ENCODING__"
         
     | 
| 
       1815 
1822 
     | 
    
         
             
             ~~~~~~~~~~~~ expression
         
     | 
| 
       1816 
1823 
     | 
    
         
             
            ~~~
         
     | 
| 
      
 1824 
     | 
    
         
            +
             
     | 
| 
      
 1825 
     | 
    
         
            +
            ## Pattern matching
         
     | 
| 
      
 1826 
     | 
    
         
            +
             
     | 
| 
      
 1827 
     | 
    
         
            +
            ### Using `in` modifier
         
     | 
| 
      
 1828 
     | 
    
         
            +
             
     | 
| 
      
 1829 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1830 
     | 
    
         
            +
             
     | 
| 
      
 1831 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1832 
     | 
    
         
            +
            (in-match
         
     | 
| 
      
 1833 
     | 
    
         
            +
              (int 1)
         
     | 
| 
      
 1834 
     | 
    
         
            +
              (match-var :a))
         
     | 
| 
      
 1835 
     | 
    
         
            +
            "1 in a"
         
     | 
| 
      
 1836 
     | 
    
         
            +
               ~~ operator
         
     | 
| 
      
 1837 
     | 
    
         
            +
             ~~~~~~ expression
         
     | 
| 
      
 1838 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1839 
     | 
    
         
            +
             
     | 
| 
      
 1840 
     | 
    
         
            +
            ### Case with pattern matching
         
     | 
| 
      
 1841 
     | 
    
         
            +
             
     | 
| 
      
 1842 
     | 
    
         
            +
            #### Without else
         
     | 
| 
      
 1843 
     | 
    
         
            +
             
     | 
| 
      
 1844 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1845 
     | 
    
         
            +
             
     | 
| 
      
 1846 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1847 
     | 
    
         
            +
            (case-match
         
     | 
| 
      
 1848 
     | 
    
         
            +
              (str "str")
         
     | 
| 
      
 1849 
     | 
    
         
            +
              (in-pattern
         
     | 
| 
      
 1850 
     | 
    
         
            +
                (match-var :foo)
         
     | 
| 
      
 1851 
     | 
    
         
            +
                (lvar :bar)) nil)
         
     | 
| 
      
 1852 
     | 
    
         
            +
            "case "str"; in foo; bar; end"
         
     | 
| 
      
 1853 
     | 
    
         
            +
             ~~~~ keyword             ~~~ end
         
     | 
| 
      
 1854 
     | 
    
         
            +
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression
         
     | 
| 
      
 1855 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1856 
     | 
    
         
            +
             
     | 
| 
      
 1857 
     | 
    
         
            +
            #### With else
         
     | 
| 
      
 1858 
     | 
    
         
            +
             
     | 
| 
      
 1859 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1860 
     | 
    
         
            +
             
     | 
| 
      
 1861 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1862 
     | 
    
         
            +
            (case-match,
         
     | 
| 
      
 1863 
     | 
    
         
            +
              (str "str")
         
     | 
| 
      
 1864 
     | 
    
         
            +
              (in-pattern
         
     | 
| 
      
 1865 
     | 
    
         
            +
                (match-var :foo)
         
     | 
| 
      
 1866 
     | 
    
         
            +
                (lvar :bar))
         
     | 
| 
      
 1867 
     | 
    
         
            +
              (lvar :baz))
         
     | 
| 
      
 1868 
     | 
    
         
            +
            "case "str"; in foo; bar; else; baz; end"
         
     | 
| 
      
 1869 
     | 
    
         
            +
             ~~~~ keyword             ~~~~ else  ~~~ end
         
     | 
| 
      
 1870 
     | 
    
         
            +
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ expression
         
     | 
| 
      
 1871 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1872 
     | 
    
         
            +
             
     | 
| 
      
 1873 
     | 
    
         
            +
            ### In clause
         
     | 
| 
      
 1874 
     | 
    
         
            +
             
     | 
| 
      
 1875 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1876 
     | 
    
         
            +
             
     | 
| 
      
 1877 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1878 
     | 
    
         
            +
            (in-pattern
         
     | 
| 
      
 1879 
     | 
    
         
            +
              (match-var :foo)
         
     | 
| 
      
 1880 
     | 
    
         
            +
              (lvar :bar))
         
     | 
| 
      
 1881 
     | 
    
         
            +
            "in foo then bar"
         
     | 
| 
      
 1882 
     | 
    
         
            +
             ~~ keyword
         
     | 
| 
      
 1883 
     | 
    
         
            +
                    ~~~~ begin
         
     | 
| 
      
 1884 
     | 
    
         
            +
             ~~~~~~~~~~~~~~~ expression
         
     | 
| 
      
 1885 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1886 
     | 
    
         
            +
             
     | 
| 
      
 1887 
     | 
    
         
            +
            ### If guard
         
     | 
| 
      
 1888 
     | 
    
         
            +
             
     | 
| 
      
 1889 
     | 
    
         
            +
            This guard runs after matching, so it's not an `if` modifier.
         
     | 
| 
      
 1890 
     | 
    
         
            +
             
     | 
| 
      
 1891 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1892 
     | 
    
         
            +
             
     | 
| 
      
 1893 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1894 
     | 
    
         
            +
            (in-pattern
         
     | 
| 
      
 1895 
     | 
    
         
            +
              (match-var :foo)
         
     | 
| 
      
 1896 
     | 
    
         
            +
              (if-guard
         
     | 
| 
      
 1897 
     | 
    
         
            +
                (lvar :bar)) nil)
         
     | 
| 
      
 1898 
     | 
    
         
            +
            "in foo if bar"
         
     | 
| 
      
 1899 
     | 
    
         
            +
                    ~~ keyword
         
     | 
| 
      
 1900 
     | 
    
         
            +
                    ~~~~~~ expression
         
     | 
| 
      
 1901 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1902 
     | 
    
         
            +
             
     | 
| 
      
 1903 
     | 
    
         
            +
            ### Unless guard
         
     | 
| 
      
 1904 
     | 
    
         
            +
             
     | 
| 
      
 1905 
     | 
    
         
            +
            This guard runs after matching, so it's not an `unless` modifier.
         
     | 
| 
      
 1906 
     | 
    
         
            +
             
     | 
| 
      
 1907 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1908 
     | 
    
         
            +
             
     | 
| 
      
 1909 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1910 
     | 
    
         
            +
            (in-pattern
         
     | 
| 
      
 1911 
     | 
    
         
            +
              (match-var :foo)
         
     | 
| 
      
 1912 
     | 
    
         
            +
              (unless-guard
         
     | 
| 
      
 1913 
     | 
    
         
            +
                (lvar :bar)) nil)
         
     | 
| 
      
 1914 
     | 
    
         
            +
            "in foo unless bar"
         
     | 
| 
      
 1915 
     | 
    
         
            +
                    ~~~~~~ keyword
         
     | 
| 
      
 1916 
     | 
    
         
            +
                    ~~~~~~~~~~ expression
         
     | 
| 
      
 1917 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1918 
     | 
    
         
            +
             
     | 
| 
      
 1919 
     | 
    
         
            +
            ### Match variable
         
     | 
| 
      
 1920 
     | 
    
         
            +
             
     | 
| 
      
 1921 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1922 
     | 
    
         
            +
             
     | 
| 
      
 1923 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1924 
     | 
    
         
            +
            (match-var :foo)
         
     | 
| 
      
 1925 
     | 
    
         
            +
            "in foo"
         
     | 
| 
      
 1926 
     | 
    
         
            +
                ~~~ name
         
     | 
| 
      
 1927 
     | 
    
         
            +
                ~~~ expression
         
     | 
| 
      
 1928 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1929 
     | 
    
         
            +
             
     | 
| 
      
 1930 
     | 
    
         
            +
            ### Match rest
         
     | 
| 
      
 1931 
     | 
    
         
            +
             
     | 
| 
      
 1932 
     | 
    
         
            +
            #### With name
         
     | 
| 
      
 1933 
     | 
    
         
            +
             
     | 
| 
      
 1934 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1935 
     | 
    
         
            +
             
     | 
| 
      
 1936 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1937 
     | 
    
         
            +
            (match-rest
         
     | 
| 
      
 1938 
     | 
    
         
            +
              (match-var :foo))
         
     | 
| 
      
 1939 
     | 
    
         
            +
            "in *foo"
         
     | 
| 
      
 1940 
     | 
    
         
            +
                ~ operator
         
     | 
| 
      
 1941 
     | 
    
         
            +
                ~~~~ expression
         
     | 
| 
      
 1942 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1943 
     | 
    
         
            +
             
     | 
| 
      
 1944 
     | 
    
         
            +
            #### Without name
         
     | 
| 
      
 1945 
     | 
    
         
            +
             
     | 
| 
      
 1946 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1947 
     | 
    
         
            +
             
     | 
| 
      
 1948 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1949 
     | 
    
         
            +
            (match-rest)
         
     | 
| 
      
 1950 
     | 
    
         
            +
            "in *"
         
     | 
| 
      
 1951 
     | 
    
         
            +
                ~ operator
         
     | 
| 
      
 1952 
     | 
    
         
            +
                ~ expression
         
     | 
| 
      
 1953 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1954 
     | 
    
         
            +
             
     | 
| 
      
 1955 
     | 
    
         
            +
            ### Pin operator
         
     | 
| 
      
 1956 
     | 
    
         
            +
             
     | 
| 
      
 1957 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1958 
     | 
    
         
            +
             
     | 
| 
      
 1959 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1960 
     | 
    
         
            +
            (pin
         
     | 
| 
      
 1961 
     | 
    
         
            +
              (lvar :foo))
         
     | 
| 
      
 1962 
     | 
    
         
            +
            "in ^foo"
         
     | 
| 
      
 1963 
     | 
    
         
            +
                ~ selector
         
     | 
| 
      
 1964 
     | 
    
         
            +
                ~~~~ expression
         
     | 
| 
      
 1965 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1966 
     | 
    
         
            +
             
     | 
| 
      
 1967 
     | 
    
         
            +
            ### Match alternative
         
     | 
| 
      
 1968 
     | 
    
         
            +
             
     | 
| 
      
 1969 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1970 
     | 
    
         
            +
             
     | 
| 
      
 1971 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1972 
     | 
    
         
            +
            (match-alt
         
     | 
| 
      
 1973 
     | 
    
         
            +
              (pin
         
     | 
| 
      
 1974 
     | 
    
         
            +
                (lvar :foo))
         
     | 
| 
      
 1975 
     | 
    
         
            +
              (int 1))
         
     | 
| 
      
 1976 
     | 
    
         
            +
            "in ^foo | 1"
         
     | 
| 
      
 1977 
     | 
    
         
            +
                     ~ operator
         
     | 
| 
      
 1978 
     | 
    
         
            +
                ~~~~~~~~ expression
         
     | 
| 
      
 1979 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1980 
     | 
    
         
            +
             
     | 
| 
      
 1981 
     | 
    
         
            +
            ### Match with alias
         
     | 
| 
      
 1982 
     | 
    
         
            +
             
     | 
| 
      
 1983 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1984 
     | 
    
         
            +
             
     | 
| 
      
 1985 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1986 
     | 
    
         
            +
            (match-as
         
     | 
| 
      
 1987 
     | 
    
         
            +
              (int 1)
         
     | 
| 
      
 1988 
     | 
    
         
            +
              (match-var :foo))
         
     | 
| 
      
 1989 
     | 
    
         
            +
            "in 1 => foo"
         
     | 
| 
      
 1990 
     | 
    
         
            +
                  ~~ operator
         
     | 
| 
      
 1991 
     | 
    
         
            +
                ~~~~~~~~ expression
         
     | 
| 
      
 1992 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 1993 
     | 
    
         
            +
             
     | 
| 
      
 1994 
     | 
    
         
            +
            ### Match using array pattern
         
     | 
| 
      
 1995 
     | 
    
         
            +
             
     | 
| 
      
 1996 
     | 
    
         
            +
            #### Explicit
         
     | 
| 
      
 1997 
     | 
    
         
            +
             
     | 
| 
      
 1998 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 1999 
     | 
    
         
            +
             
     | 
| 
      
 2000 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2001 
     | 
    
         
            +
            (array-pattern
         
     | 
| 
      
 2002 
     | 
    
         
            +
              (pin
         
     | 
| 
      
 2003 
     | 
    
         
            +
                (lvar :foo))
         
     | 
| 
      
 2004 
     | 
    
         
            +
              (match-var :bar))
         
     | 
| 
      
 2005 
     | 
    
         
            +
            "in [^foo, bar]"
         
     | 
| 
      
 2006 
     | 
    
         
            +
                ~ begin   ~ end
         
     | 
| 
      
 2007 
     | 
    
         
            +
                ~~~~~~~~~~~ expression
         
     | 
| 
      
 2008 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2009 
     | 
    
         
            +
             
     | 
| 
      
 2010 
     | 
    
         
            +
            #### Explicit with tail
         
     | 
| 
      
 2011 
     | 
    
         
            +
             
     | 
| 
      
 2012 
     | 
    
         
            +
            Adding a trailing comma in the end works as `, *`
         
     | 
| 
      
 2013 
     | 
    
         
            +
             
     | 
| 
      
 2014 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2015 
     | 
    
         
            +
             
     | 
| 
      
 2016 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2017 
     | 
    
         
            +
            (array-pattern-with-tail
         
     | 
| 
      
 2018 
     | 
    
         
            +
              (pin
         
     | 
| 
      
 2019 
     | 
    
         
            +
                (lvar :foo))
         
     | 
| 
      
 2020 
     | 
    
         
            +
              (match-var :bar))
         
     | 
| 
      
 2021 
     | 
    
         
            +
            "in [^foo, bar,]"
         
     | 
| 
      
 2022 
     | 
    
         
            +
                ~ begin    ~ end
         
     | 
| 
      
 2023 
     | 
    
         
            +
                ~~~~~~~~~~~~ expression
         
     | 
| 
      
 2024 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2025 
     | 
    
         
            +
             
     | 
| 
      
 2026 
     | 
    
         
            +
            #### Implicit
         
     | 
| 
      
 2027 
     | 
    
         
            +
             
     | 
| 
      
 2028 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2029 
     | 
    
         
            +
             
     | 
| 
      
 2030 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2031 
     | 
    
         
            +
            (array-pattern
         
     | 
| 
      
 2032 
     | 
    
         
            +
              (pin
         
     | 
| 
      
 2033 
     | 
    
         
            +
                (lvar :foo))
         
     | 
| 
      
 2034 
     | 
    
         
            +
              (match-var :bar))
         
     | 
| 
      
 2035 
     | 
    
         
            +
            "in ^foo, bar"
         
     | 
| 
      
 2036 
     | 
    
         
            +
                ~~~~~~~~~ expression
         
     | 
| 
      
 2037 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2038 
     | 
    
         
            +
             
     | 
| 
      
 2039 
     | 
    
         
            +
            #### Implicit with tail
         
     | 
| 
      
 2040 
     | 
    
         
            +
             
     | 
| 
      
 2041 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2042 
     | 
    
         
            +
             
     | 
| 
      
 2043 
     | 
    
         
            +
            Adding a trailing comma in the end works as `, *`,
         
     | 
| 
      
 2044 
     | 
    
         
            +
            so a single item match with comma gets interpreted as an array.
         
     | 
| 
      
 2045 
     | 
    
         
            +
             
     | 
| 
      
 2046 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2047 
     | 
    
         
            +
            (array-pattern-with-tail
         
     | 
| 
      
 2048 
     | 
    
         
            +
              (match-var :foo))
         
     | 
| 
      
 2049 
     | 
    
         
            +
            "in foo,"
         
     | 
| 
      
 2050 
     | 
    
         
            +
                ~~~ expression
         
     | 
| 
      
 2051 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2052 
     | 
    
         
            +
             
     | 
| 
      
 2053 
     | 
    
         
            +
            ### Matching using hash pattern
         
     | 
| 
      
 2054 
     | 
    
         
            +
             
     | 
| 
      
 2055 
     | 
    
         
            +
            #### Explicit
         
     | 
| 
      
 2056 
     | 
    
         
            +
             
     | 
| 
      
 2057 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2058 
     | 
    
         
            +
             
     | 
| 
      
 2059 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2060 
     | 
    
         
            +
            (hash-pattern
         
     | 
| 
      
 2061 
     | 
    
         
            +
              (pair
         
     | 
| 
      
 2062 
     | 
    
         
            +
                (sym :a)
         
     | 
| 
      
 2063 
     | 
    
         
            +
                (int 10)))
         
     | 
| 
      
 2064 
     | 
    
         
            +
            "in { a: 10 }"
         
     | 
| 
      
 2065 
     | 
    
         
            +
                ~ begin ~ end
         
     | 
| 
      
 2066 
     | 
    
         
            +
                ~~~~~~~~~ expression
         
     | 
| 
      
 2067 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2068 
     | 
    
         
            +
             
     | 
| 
      
 2069 
     | 
    
         
            +
            #### Implicit
         
     | 
| 
      
 2070 
     | 
    
         
            +
             
     | 
| 
      
 2071 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2072 
     | 
    
         
            +
             
     | 
| 
      
 2073 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2074 
     | 
    
         
            +
            (hash-pattern
         
     | 
| 
      
 2075 
     | 
    
         
            +
              (pair
         
     | 
| 
      
 2076 
     | 
    
         
            +
                (sym :a)
         
     | 
| 
      
 2077 
     | 
    
         
            +
                (int 10)))
         
     | 
| 
      
 2078 
     | 
    
         
            +
            "in a: 10"
         
     | 
| 
      
 2079 
     | 
    
         
            +
                ~~~~~ expression
         
     | 
| 
      
 2080 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2081 
     | 
    
         
            +
             
     | 
| 
      
 2082 
     | 
    
         
            +
            #### Assignment using hash pattern
         
     | 
| 
      
 2083 
     | 
    
         
            +
             
     | 
| 
      
 2084 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2085 
     | 
    
         
            +
             
     | 
| 
      
 2086 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2087 
     | 
    
         
            +
            (hash-pattern
         
     | 
| 
      
 2088 
     | 
    
         
            +
              (match-var :a))
         
     | 
| 
      
 2089 
     | 
    
         
            +
            "in a:"
         
     | 
| 
      
 2090 
     | 
    
         
            +
                ~ name (match-var)
         
     | 
| 
      
 2091 
     | 
    
         
            +
                ~~ expression (match-var)
         
     | 
| 
      
 2092 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2093 
     | 
    
         
            +
             
     | 
| 
      
 2094 
     | 
    
         
            +
            #### Nil hash pattern
         
     | 
| 
      
 2095 
     | 
    
         
            +
             
     | 
| 
      
 2096 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2097 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2098 
     | 
    
         
            +
            (hash-pattern
         
     | 
| 
      
 2099 
     | 
    
         
            +
              (match-nil-pattern))
         
     | 
| 
      
 2100 
     | 
    
         
            +
            "in **nil"
         
     | 
| 
      
 2101 
     | 
    
         
            +
                ~~~~~ expression (match-nil-pattern)
         
     | 
| 
      
 2102 
     | 
    
         
            +
                  ~~~ name (match-nil-pattern)
         
     | 
| 
      
 2103 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2104 
     | 
    
         
            +
             
     | 
| 
      
 2105 
     | 
    
         
            +
            ### Matching using const pattern
         
     | 
| 
      
 2106 
     | 
    
         
            +
             
     | 
| 
      
 2107 
     | 
    
         
            +
            #### With array pattern
         
     | 
| 
      
 2108 
     | 
    
         
            +
             
     | 
| 
      
 2109 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2110 
     | 
    
         
            +
             
     | 
| 
      
 2111 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2112 
     | 
    
         
            +
            (const-pattern
         
     | 
| 
      
 2113 
     | 
    
         
            +
              (const nil :X)
         
     | 
| 
      
 2114 
     | 
    
         
            +
              (array-pattern
         
     | 
| 
      
 2115 
     | 
    
         
            +
                (pin
         
     | 
| 
      
 2116 
     | 
    
         
            +
                  (lvar :foo))
         
     | 
| 
      
 2117 
     | 
    
         
            +
                (match-var :bar)))
         
     | 
| 
      
 2118 
     | 
    
         
            +
            "in X[^foo bar]"
         
     | 
| 
      
 2119 
     | 
    
         
            +
                 ~ begin (const-pattern)
         
     | 
| 
      
 2120 
     | 
    
         
            +
                           ~ end (const-pattern)
         
     | 
| 
      
 2121 
     | 
    
         
            +
                 ~~~~~~~~~~~ expression (const-pattern)
         
     | 
| 
      
 2122 
     | 
    
         
            +
                ~ name (const-pattern.const)
         
     | 
| 
      
 2123 
     | 
    
         
            +
                ~ expression (const-pattern.const)
         
     | 
| 
      
 2124 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2125 
     | 
    
         
            +
             
     | 
| 
      
 2126 
     | 
    
         
            +
            #### With hash pattern
         
     | 
| 
      
 2127 
     | 
    
         
            +
             
     | 
| 
      
 2128 
     | 
    
         
            +
            Format:
         
     | 
| 
      
 2129 
     | 
    
         
            +
             
     | 
| 
      
 2130 
     | 
    
         
            +
            ~~~
         
     | 
| 
      
 2131 
     | 
    
         
            +
            (const-pattern
         
     | 
| 
      
 2132 
     | 
    
         
            +
              (const nil :X)
         
     | 
| 
      
 2133 
     | 
    
         
            +
              (hash-pattern
         
     | 
| 
      
 2134 
     | 
    
         
            +
                (match-var :foo)
         
     | 
| 
      
 2135 
     | 
    
         
            +
                (match-var :bar)))
         
     | 
| 
      
 2136 
     | 
    
         
            +
            "in X[foo:, bar:]"
         
     | 
| 
      
 2137 
     | 
    
         
            +
                 ~ begin (const-pattern)
         
     | 
| 
      
 2138 
     | 
    
         
            +
                            ~ end (const-pattern)
         
     | 
| 
      
 2139 
     | 
    
         
            +
                 ~~~~~~~~~~~~ expression (const-pattern)
         
     | 
| 
      
 2140 
     | 
    
         
            +
                ~ name (const-pattern.const)
         
     | 
| 
      
 2141 
     | 
    
         
            +
                ~ expression (const-pattern.const)
         
     | 
| 
      
 2142 
     | 
    
         
            +
            ~~~
         
     |