Skip to content

Commit

Permalink
Raku: Fix Match hash access, $<variable><key>
Browse files Browse the repository at this point in the history
  • Loading branch information
CIAvash authored and alecthomas committed Aug 28, 2021
1 parent 2535d1a commit 22fac1f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lexers/r/raku.go
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ func rakuRules() Rules {
"variable": {
{variablePattern, NameVariable, Push("name-adverb")},
{globalVariablePattern, NameVariableGlobal, Push("name-adverb")},
{`[$@](?:<.*?>)+`, NameVariable, nil},
{`[$@]<[^>]+>`, NameVariable, nil},
{`\$/`, NameVariable, nil},
{`\$!`, NameVariable, nil},
{`[$@%]`, NameVariable, nil},
Expand Down
2 changes: 2 additions & 0 deletions lexers/testdata/raku.actual
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ rx/:i
\d ** 1..3 <?{ $/.Int <= 255 && $/.Int >= 0 }>
$/;

$<variable><key>;

constant \something:some<adverb> = 'something';

my %hash = %(
Expand Down
5 changes: 5 additions & 0 deletions lexers/testdata/raku.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2004,6 +2004,11 @@
{"type":"NameEntity","value":"$"},
{"type":"Punctuation","value":"/;"},
{"type":"Text","value":"\n\n"},
{"type":"NameVariable","value":"$\u003cvariable\u003e"},
{"type":"Punctuation","value":"\u003c"},
{"type":"LiteralString","value":"key"},
{"type":"Punctuation","value":"\u003e;"},
{"type":"Text","value":"\n\n"},
{"type":"Keyword","value":"constant"},
{"type":"Text","value":" "},
{"type":"NameVariable","value":"\\something"},
Expand Down

0 comments on commit 22fac1f

Please sign in to comment.