mirror of
https://github.com/alecthomas/chroma.git
synced 2025-04-15 11:46:38 +02:00
Raku: Fix incorrectly matching closing brackets as opening
This commit is contained in:
parent
7966c29526
commit
b71f4c6607
@ -1156,12 +1156,11 @@ func rakuRules() Rules {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Joins keys and values of rune map
|
// Joins keys of rune map
|
||||||
func joinRuneMap(m map[rune]rune) string {
|
func joinRuneMap(m map[rune]rune) string {
|
||||||
runes := make([]rune, 0, len(m)*2)
|
runes := make([]rune, 0, len(m))
|
||||||
for k, v := range m {
|
for k := range m {
|
||||||
runes = append(runes, k)
|
runes = append(runes, k)
|
||||||
runes = append(runes, v)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return string(runes)
|
return string(runes)
|
||||||
|
2
lexers/testdata/raku.actual
vendored
2
lexers/testdata/raku.actual
vendored
@ -21,7 +21,7 @@ fmt.Println("Hello from Go")
|
|||||||
say $=pod[0].config<numbered>;
|
say $=pod[0].config<numbered>;
|
||||||
|
|
||||||
sub f1($a) {
|
sub f1($a) {
|
||||||
$a+1;
|
$a+1; #=> Comment looking like a pod declaration, but with a closing bracket!
|
||||||
}
|
}
|
||||||
|
|
||||||
2.&f1;
|
2.&f1;
|
||||||
|
2
lexers/testdata/raku.expected
vendored
2
lexers/testdata/raku.expected
vendored
@ -67,6 +67,8 @@
|
|||||||
{"type":"Operator","value":"+"},
|
{"type":"Operator","value":"+"},
|
||||||
{"type":"LiteralNumberInteger","value":"1"},
|
{"type":"LiteralNumberInteger","value":"1"},
|
||||||
{"type":"Punctuation","value":";"},
|
{"type":"Punctuation","value":";"},
|
||||||
|
{"type":"Text","value":" "},
|
||||||
|
{"type":"CommentSingle","value":"#=\u003e Comment looking like a pod declaration, but with a closing bracket!"},
|
||||||
{"type":"Text","value":"\n"},
|
{"type":"Text","value":"\n"},
|
||||||
{"type":"Punctuation","value":"}"},
|
{"type":"Punctuation","value":"}"},
|
||||||
{"type":"Text","value":"\n\n"},
|
{"type":"Text","value":"\n\n"},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user