Skip to content

Commit 72795c5

Browse files
CIAvashalecthomas
authored andcommitted
Add test for methodop .&
1 parent ad7162c commit 72795c5

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

Diff for: lexers/testdata/raku.actual

+12
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ fmt.Println("Hello from Go")
1616

1717
say $=pod[0].config<numbered>;
1818

19+
sub f1($a) {
20+
$a+1;
21+
}
22+
23+
2.&f1;
24+
25+
sub f2($a,$b) {
26+
$a+1;
27+
}
28+
29+
2.&f2(3);
30+
1931
#| Fibonacci with Multiple dispatch
2032
multi sub fib (0 --> 0) {}
2133
multi sub fib (1 --> 1) {}

Diff for: lexers/testdata/raku.expected

+46
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,52 @@
5151
{"type":"LiteralString","value":"numbered"},
5252
{"type":"Punctuation","value":"\u003e;"},
5353
{"type":"Text","value":"\n\n"},
54+
{"type":"Keyword","value":"sub"},
55+
{"type":"Text","value":" "},
56+
{"type":"NameFunction","value":"f1"},
57+
{"type":"Punctuation","value":"("},
58+
{"type":"NameVariable","value":"$a"},
59+
{"type":"Punctuation","value":")"},
60+
{"type":"Text","value":" "},
61+
{"type":"Punctuation","value":"{"},
62+
{"type":"Text","value":"\n "},
63+
{"type":"NameVariable","value":"$a"},
64+
{"type":"Operator","value":"+"},
65+
{"type":"LiteralNumberInteger","value":"1"},
66+
{"type":"Punctuation","value":";"},
67+
{"type":"Text","value":"\n"},
68+
{"type":"Punctuation","value":"}"},
69+
{"type":"Text","value":"\n\n"},
70+
{"type":"LiteralNumberInteger","value":"2"},
71+
{"type":"Operator","value":".\u0026"},
72+
{"type":"NameFunction","value":"f1"},
73+
{"type":"Punctuation","value":";"},
74+
{"type":"Text","value":"\n\n"},
75+
{"type":"Keyword","value":"sub"},
76+
{"type":"Text","value":" "},
77+
{"type":"NameFunction","value":"f2"},
78+
{"type":"Punctuation","value":"("},
79+
{"type":"NameVariable","value":"$a"},
80+
{"type":"Operator","value":","},
81+
{"type":"NameVariable","value":"$b"},
82+
{"type":"Punctuation","value":")"},
83+
{"type":"Text","value":" "},
84+
{"type":"Punctuation","value":"{"},
85+
{"type":"Text","value":"\n "},
86+
{"type":"NameVariable","value":"$a"},
87+
{"type":"Operator","value":"+"},
88+
{"type":"LiteralNumberInteger","value":"1"},
89+
{"type":"Punctuation","value":";"},
90+
{"type":"Text","value":"\n"},
91+
{"type":"Punctuation","value":"}"},
92+
{"type":"Text","value":"\n\n"},
93+
{"type":"LiteralNumberInteger","value":"2"},
94+
{"type":"Operator","value":".\u0026"},
95+
{"type":"NameFunction","value":"f2"},
96+
{"type":"Punctuation","value":"("},
97+
{"type":"LiteralNumberInteger","value":"3"},
98+
{"type":"Punctuation","value":");"},
99+
{"type":"Text","value":"\n\n"},
54100
{"type":"Keyword","value":"#| "},
55101
{"type":"LiteralStringDoc","value":"Fibonacci with Multiple dispatch\n"},
56102
{"type":"Keyword","value":"multi"},

0 commit comments

Comments
 (0)