Skip to content

Commit 22fac1f

Browse files
CIAvashalecthomas
authored andcommitted
Raku: Fix Match hash access, $<variable><key>
1 parent 2535d1a commit 22fac1f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Diff for: lexers/r/raku.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ func rakuRules() Rules {
10431043
"variable": {
10441044
{variablePattern, NameVariable, Push("name-adverb")},
10451045
{globalVariablePattern, NameVariableGlobal, Push("name-adverb")},
1046-
{`[$@](?:<.*?>)+`, NameVariable, nil},
1046+
{`[$@]<[^>]+>`, NameVariable, nil},
10471047
{`\$/`, NameVariable, nil},
10481048
{`\$!`, NameVariable, nil},
10491049
{`[$@%]`, NameVariable, nil},

Diff for: lexers/testdata/raku.actual

+2
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ rx/:i
261261
\d ** 1..3 <?{ $/.Int <= 255 && $/.Int >= 0 }>
262262
$/;
263263

264+
$<variable><key>;
265+
264266
constant \something:some<adverb> = 'something';
265267

266268
my %hash = %(

Diff for: lexers/testdata/raku.expected

+5
Original file line numberDiff line numberDiff line change
@@ -2004,6 +2004,11 @@
20042004
{"type":"NameEntity","value":"$"},
20052005
{"type":"Punctuation","value":"/;"},
20062006
{"type":"Text","value":"\n\n"},
2007+
{"type":"NameVariable","value":"$\u003cvariable\u003e"},
2008+
{"type":"Punctuation","value":"\u003c"},
2009+
{"type":"LiteralString","value":"key"},
2010+
{"type":"Punctuation","value":"\u003e;"},
2011+
{"type":"Text","value":"\n\n"},
20072012
{"type":"Keyword","value":"constant"},
20082013
{"type":"Text","value":" "},
20092014
{"type":"NameVariable","value":"\\something"},

0 commit comments

Comments
 (0)