Skip to content

Commit

Permalink
Raku: Change the token type of builtin types to KeywordType (#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
CIAvash committed Mar 4, 2023
1 parent 96a518b commit 42c314d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lexers/raku.go
Expand Up @@ -655,7 +655,7 @@ func rakuRules() Rules {
// Substitution
{`(?<=^|\b|\s)(?<!\.)(ss|S|s|TR|tr)\b(\s*)`, ByGroups(Keyword, Text), Push("substitution")},
{keywordsPattern, Keyword, nil},
{builtinTypesPattern, NameBuiltin, nil},
{builtinTypesPattern, KeywordType, nil},
{builtinRoutinesPattern, NameBuiltin, nil},
// Class name
{
Expand Down
26 changes: 13 additions & 13 deletions lexers/testdata/raku/raku.expected
Expand Up @@ -519,14 +519,14 @@
{"type":"NameBuiltin","value":"MAIN"},
{"type":"Punctuation","value":"("},
{"type":"Text","value":"\n "},
{"type":"NameBuiltin","value":"Str"},
{"type":"KeywordType","value":"Str"},
{"type":"Text","value":" "},
{"type":"NameVariable","value":"$file"},
{"type":"Text","value":" "},
{"type":"Keyword","value":"where"},
{"type":"Text","value":" "},
{"type":"Operator","value":"*."},
{"type":"NameBuiltin","value":"IO"},
{"type":"KeywordType","value":"IO"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"f"},
{"type":"Text","value":" "},
Expand All @@ -540,7 +540,7 @@
{"type":"Keyword","value":"#= "},
{"type":"LiteralStringDoc","value":"an existing file to frobnicate\n"},
{"type":"Text","value":" "},
{"type":"NameBuiltin","value":"Int"},
{"type":"KeywordType","value":"Int"},
{"type":"Text","value":" "},
{"type":"Punctuation","value":":"},
{"type":"LiteralString","value":"size"},
Expand All @@ -557,7 +557,7 @@
{"type":"Keyword","value":"#= "},
{"type":"LiteralStringDoc","value":"length/size needed for frobnication\n"},
{"type":"Text","value":" "},
{"type":"NameBuiltin","value":"Bool"},
{"type":"KeywordType","value":"Bool"},
{"type":"Text","value":" "},
{"type":"Operator","value":":"},
{"type":"NameVariable","value":"$verbose"},
Expand Down Expand Up @@ -1696,7 +1696,7 @@
{"type":"Text","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"NameBuiltin","value":"Supplier"},
{"type":"KeywordType","value":"Supplier"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"new"},
{"type":"Punctuation","value":";"},
Expand All @@ -1707,7 +1707,7 @@
{"type":"Text","value":" "},
{"type":"Operator","value":"="},
{"type":"Text","value":" "},
{"type":"NameBuiltin","value":"Supplier"},
{"type":"KeywordType","value":"Supplier"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"new"},
{"type":"Punctuation","value":";"},
Expand All @@ -1726,7 +1726,7 @@
{"type":"Text","value":" "},
{"type":"NameVariable","value":"$bread-supplier"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"Supply"},
{"type":"KeywordType","value":"Supply"},
{"type":"Text","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"Text","value":"\n "},
Expand All @@ -1746,7 +1746,7 @@
{"type":"Text","value":" "},
{"type":"NameVariable","value":"$vegetable-supplier"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"Supply"},
{"type":"KeywordType","value":"Supply"},
{"type":"Text","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"Text","value":"\n "},
Expand Down Expand Up @@ -2810,7 +2810,7 @@
{"type":"Text","value":" "},
{"type":"NameVariable","value":"$/"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"Int"},
{"type":"KeywordType","value":"Int"},
{"type":"Text","value":" "},
{"type":"Operator","value":"\u003c="},
{"type":"Text","value":" "},
Expand All @@ -2820,7 +2820,7 @@
{"type":"Text","value":" "},
{"type":"NameVariable","value":"$/"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"Int"},
{"type":"KeywordType","value":"Int"},
{"type":"Text","value":" "},
{"type":"Operator","value":"\u003e="},
{"type":"Text","value":" "},
Expand Down Expand Up @@ -2898,7 +2898,7 @@
{"type":"Operator","value":","},
{"type":"Text","value":"\n "},
{"type":"Punctuation","value":"("},
{"type":"NameBuiltin","value":"Less"},
{"type":"KeywordType","value":"Less"},
{"type":"Punctuation","value":")"},
{"type":"Text","value":" "},
{"type":"Operator","value":"=\u003e"},
Expand Down Expand Up @@ -3618,7 +3618,7 @@
{"type":"NameVariable","value":"%a"},
{"type":"Punctuation","value":"{"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"Int"},
{"type":"KeywordType","value":"Int"},
{"type":"Text","value":" "},
{"type":"OperatorWord","value":"cmp"},
{"type":"Text","value":" "},
Expand Down Expand Up @@ -4153,7 +4153,7 @@
{"type":"Text","value":"\n\n"},
{"type":"NameBuiltin","value":"put"},
{"type":"Text","value":" "},
{"type":"NameBuiltin","value":"Date"},
{"type":"KeywordType","value":"Date"},
{"type":"Operator","value":"."},
{"type":"NameBuiltin","value":"today"},
{"type":"Operator","value":"."},
Expand Down

0 comments on commit 42c314d

Please sign in to comment.