mirror of
https://github.com/alecthomas/chroma.git
synced 2025-02-15 13:33:12 +02:00
Add test for methodop .&
This commit is contained in:
parent
ad7162c37b
commit
72795c5f9f
12
lexers/testdata/raku.actual
vendored
12
lexers/testdata/raku.actual
vendored
@ -16,6 +16,18 @@ fmt.Println("Hello from Go")
|
||||
|
||||
say $=pod[0].config<numbered>;
|
||||
|
||||
sub f1($a) {
|
||||
$a+1;
|
||||
}
|
||||
|
||||
2.&f1;
|
||||
|
||||
sub f2($a,$b) {
|
||||
$a+1;
|
||||
}
|
||||
|
||||
2.&f2(3);
|
||||
|
||||
#| Fibonacci with Multiple dispatch
|
||||
multi sub fib (0 --> 0) {}
|
||||
multi sub fib (1 --> 1) {}
|
||||
|
46
lexers/testdata/raku.expected
vendored
46
lexers/testdata/raku.expected
vendored
@ -51,6 +51,52 @@
|
||||
{"type":"LiteralString","value":"numbered"},
|
||||
{"type":"Punctuation","value":"\u003e;"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"sub"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameFunction","value":"f1"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"NameVariable","value":"$a"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"NameVariable","value":"$a"},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":";"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralNumberInteger","value":"2"},
|
||||
{"type":"Operator","value":".\u0026"},
|
||||
{"type":"NameFunction","value":"f1"},
|
||||
{"type":"Punctuation","value":";"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"sub"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"NameFunction","value":"f2"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"NameVariable","value":"$a"},
|
||||
{"type":"Operator","value":","},
|
||||
{"type":"NameVariable","value":"$b"},
|
||||
{"type":"Punctuation","value":")"},
|
||||
{"type":"Text","value":" "},
|
||||
{"type":"Punctuation","value":"{"},
|
||||
{"type":"Text","value":"\n "},
|
||||
{"type":"NameVariable","value":"$a"},
|
||||
{"type":"Operator","value":"+"},
|
||||
{"type":"LiteralNumberInteger","value":"1"},
|
||||
{"type":"Punctuation","value":";"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"LiteralNumberInteger","value":"2"},
|
||||
{"type":"Operator","value":".\u0026"},
|
||||
{"type":"NameFunction","value":"f2"},
|
||||
{"type":"Punctuation","value":"("},
|
||||
{"type":"LiteralNumberInteger","value":"3"},
|
||||
{"type":"Punctuation","value":");"},
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"Keyword","value":"#| "},
|
||||
{"type":"LiteralStringDoc","value":"Fibonacci with Multiple dispatch\n"},
|
||||
{"type":"Keyword","value":"multi"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user