1
0
mirror of https://github.com/alecthomas/chroma.git synced 2025-02-09 13:23:51 +02:00

Raku: Fix Match hash access, $<variable><key>

This commit is contained in:
Siavash Askari Nasr 2021-08-22 14:40:31 +04:30 committed by Alec Thomas
parent 2535d1a99e
commit 22fac1fc0f
3 changed files with 8 additions and 1 deletions

View File

@ -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},

View File

@ -261,6 +261,8 @@ rx/:i
\d ** 1..3 <?{ $/.Int <= 255 && $/.Int >= 0 }>
$/;
$<variable><key>;
constant \something:some<adverb> = 'something';
my %hash = %(

View File

@ -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"},