Repository: alecthomas/chroma
Pull request #542 (2021-08-28 11:33:55)

[Raku] Improvements and fixes
- Improve nested regex and code
- Improve functions design
- Add more test data
- Fix detecting adverbs
- Fix Match hash access, `$<variable><key>`
- Add escape character support to single quotes and regex
- Other fixes and cleanups


Patch:
diff --git a/lexers/r/raku.go b/lexers/r/raku.go
index 88d1f23..5c4fea3 100644
--- a/lexers/r/raku.go
+++ b/lexers/r/raku.go
@@ -33,26 +33,24 @@ func rakuRules() Rules {
 
 	const (
 		rakuQuote RakuToken = iota
-		rakuName
 		rakuNameAttribute
 		rakuPod
 		rakuPodFormatter
 		rakuPodDeclaration
 		rakuMultilineComment
-		rakuSlashRegex
 		rakuMatchRegex
 		rakuSubstitutionRegex
-		rakuSubstitutionSingleRegex
-		rakuRegexInsideToken
 	)
 
 	const (
 		colonPairOpeningBrackets = `(?:<<|<|«|\(|\[|\{)`
 		colonPairClosingBrackets = `(?:>>|>|»|\)|\]|\})`
-		colonPairPattern         = `(?<colon>:)(?<key>\w[\w'-]*)(?<opening_delimiters>` + colonPairOpeningBrackets + `)`
-		namePattern              = `((?:(?!` + colonPairPattern + `)[\w':-])+)`
-		variablePattern          = `[$@%&]+[.^:?=!~]?` + namePattern
-		globalVariablePattern    = `[$@%&]+\*` + namePattern
+		colonPairPattern         = `(?<!:)(?<colon>:)(?<key>\w[\w'-]*)(?<opening_delimiters>` + colonPairOpeningBrackets + `)`
+		colonPairLookahead       = `(?=(:['\w-]+` +
+			colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `)?`
+		namePattern           = `(?:(?!` + colonPairPattern + `)(?:::|[\w':-]))+`
+		variablePattern       = `[$@%&]+[.^:?=!~]?` + namePattern
+		globalVariablePattern = `[$@%&]+\*` + namePattern
 	)
 
 	keywords := []string{
@@ -339,13 +337,11 @@ func rakuRules() Rules {
 
 	// Finds opening brackets and their closing counterparts (including pod and heredoc)
 	// and modifies state groups and position accordingly
-	bracketsFinder := func(tokenClass RakuToken) MutatorFunc {
+	findBrackets := func(tokenClass RakuToken) MutatorFunc {
 		return func(state *LexerState) error {
 			var openingChars []rune
 			var adverbs []rune
 			switch tokenClass {
-			case rakuRegexInsideToken:
-				openingChars = []rune("{")
 			case rakuPod:
 				openingChars = []rune(strings.Join(state.Groups[1:5], ``))
 			default:
@@ -363,7 +359,6 @@ func rakuRules() Rules {
 
 			switch tokenClass {
 			case rakuPod:
-				closingChars = []rune(state.NamedGroups[`ws`] + `=end ` + state.NamedGroups[`name`])
 				closingCharExists = true
 			default:
 				closingChar, closingCharExists = brackets[openingChar]
@@ -371,17 +366,8 @@ func rakuRules() Rules {
 
 			switch tokenClass {
 			case rakuPodFormatter:
-				stack, ok := state.Get("pod_formatter_stack").([]RakuFormatterRules)
-				if !ok {
-					stack = []RakuFormatterRules{}
-				}
-				popRule := makeRuleAndPushMaybe(RuleMakingConfig{
-					delimiter:              []rune{closingChar},
-					numberOfDelimiterChars: nChars,
-					tokenType:              Punctuation,
-					mutator:                Mutators(Pop(1), MutatorFunc(podFormatterPopper)),
-				})
-				var formatter TokenType = StringOther
+				formatter := StringOther
+
 				switch state.NamedGroups[`keyword`] {
 				case "B":
 					formatter = GenericStrong
@@ -390,20 +376,34 @@ func rakuRules() Rules {
 				case "U":
 					formatter = GenericUnderline
 				}
-				formattingRule := makeRuleAndPushMaybe(RuleMakingConfig{
-					pattern:   `.+?`,
-					tokenType: formatter,
-					mutator:   nil,
-				})
-				state.Set("pod_formatter_stack",
-					append(stack, RakuFormatterRules{popRule, formattingRule}))
+
+				formatterRule := ruleReplacingConfig{
+					pattern:      `.+?`,
+					tokenType:    formatter,
+					mutator:      nil,
+					stateName:    `pod-formatter`,
+					rulePosition: bottomRule,
+				}
+
+				err := replaceRule(formatterRule)(state)
+				if err != nil {
+					panic(err)
+				}
+
+				err = replaceRule(ruleReplacingConfig{
+					delimiter:              []rune{closingChar},
+					tokenType:              Punctuation,
+					stateName:              `pod-formatter`,
+					pushState:              true,
+					numberOfDelimiterChars: nChars,
+					appendMutator:          popRule(formatterRule),
+				})(state)
+				if err != nil {
+					panic(err)
+				}
 
 				return nil
-			case rakuMatchRegex, rakuSubstitutionSingleRegex, rakuRegexInsideToken:
-				// We're inside a regex
-				// While matching a regex, the closing chars may have been used inside the regex
-				// so we have to push to regex state and pop on the matched closing chars
-				// and return
+			case rakuMatchRegex:
 				var delimiter []rune
 				if closingCharExists {
 					delimiter = []rune{closingChar}
@@ -411,16 +411,32 @@ func rakuRules() Rules {
 					delimiter = openingChars
 				}
 
-				makeRuleAndPushMaybe(RuleMakingConfig{
-					delimiter:              delimiter,
-					tokenType:              Punctuation,
-					mutator:                Pop(1),
-					rulePosition:           topRule,
-					state:                  state,
-					stateName:              "regex",
-					pushToStack:            true,
-					numberOfDelimiterChars: nChars,
-				})
+				err := replaceRule(ruleReplacingConfig{
+					delimiter: delimiter,
+					tokenType: Punctuation,
+					stateName: `regex`,
+					popState:  true,
+					pushState: true,
+				})(state)
+				if err != nil {
+					panic(err)
+				}
+
+				return nil
+			case rakuSubstitutionRegex:
+				delimiter := regexp2.Escape(string(openingChars))
+
+				err := replaceRule(ruleReplacingConfig{
+					pattern:      `(` + delimiter + `)` + `((?:\\\\|\\/|.)*?)` + `(` + delimiter + `)`,
+					tokenType:    ByGroups(Punctuation, UsingSelf(`qq`), Punctuation),
+					rulePosition: topRule,
+					stateName:    `regex`,
+					popState:     true,
+					pushState:    true,
+				})(state)
+				if err != nil {
+					panic(err)
+				}
 
 				return nil
 			}
@@ -434,10 +450,17 @@ func rakuRules() Rules {
 			if !closingCharExists {
 				// it's not a mirrored character, which means we
 				// just need to look for the next occurrence
-				nonMirroredOpeningCharPosition = indexAt(text, openingChars, state.Pos)
+				closingChars = openingChars
+				nonMirroredOpeningCharPosition = indexAt(text, closingChars, state.Pos)
 				endPos = nonMirroredOpeningCharPosition
 			} else {
-				if tokenClass != rakuPod {
+				var podRegex *regexp2.Regexp
+				if tokenClass == rakuPod {
+					podRegex = regexp2.MustCompile(
+						state.NamedGroups[`ws`]+`=end`+`\s+`+regexp2.Escape(state.NamedGroups[`name`]),
+						0,
+					)
+				} else {
 					closingChars = []rune(strings.Repeat(string(closingChar), nChars))
 				}
 
@@ -450,8 +473,19 @@ func rakuRules() Rules {
 				var nextClosePos int
 
 				for nestingLevel > 0 {
+					if tokenClass == rakuPod {
+						match, err := podRegex.FindRunesMatchStartingAt(text, searchPos+nChars)
+						if err == nil {
+							closingChars = match.Runes()
+							nextClosePos = match.Index
+						} else {
+							nextClosePos = -1
+						}
+					} else {
+						nextClosePos = indexAt(text, closingChars, searchPos+nChars)
+					}
+
 					nextOpenPos := indexAt(text, openingChars, searchPos+nChars)
-					nextClosePos = indexAt(text, closingChars, searchPos+nChars)
 
 					switch {
 					case nextClosePos == -1:
@@ -522,12 +556,17 @@ func rakuRules() Rules {
 	}
 
 	// Raku rules
-	// Empty capture groups are placeholders and will be replaced by bracketsFinder.
+	// Empty capture groups are placeholders and will be replaced by mutators
 	// DO NOT REMOVE THEM!
 	return Rules{
 		"root": {
+			// Placeholder, will be overwritten by mutators, DO NOT REMOVE!
+			{`\A\z`, nil, nil},
 			Include("common"),
-			{`[{}();]`, Punctuation, nil},
+			{`{`, Punctuation, Push(`root`)},
+			{`\(`, Punctuation, Push(`root`)},
+			{`[)}]`, Punctuation, Pop(1)},
+			{`;`, Punctuation, nil},
 			{`\[|\]`, Operator, nil},
 			{`.+?`, Text, nil},
 		},
@@ -538,14 +577,14 @@ func rakuRules() Rules {
 			{
 				"#`(?<opening_delimiters>(?<delimiter>" + bracketsPattern + `)\k<delimiter>*)`,
 				CommentMultiline,
-				bracketsFinder(rakuMultilineComment),
+				findBrackets(rakuMultilineComment),
 			},
 			{`#[^\n]*$`, CommentSingle, nil},
 			// /regex/
 			{
-				`(?<=(?:^|\(|=|:|~~|\[|,|=>)\s*)(/)(?!\]|\))((?:\\\\|\\/|.)*?)((?<!(?<!\\)\\)/(?!'|"))`,
+				`(?<=(?:^|\(|=|:|~~|\[|{|,|=>)\s*)(/)(?!\]|\))((?:\\\\|\\/|.)*?)((?<!(?<!\\)\\)/(?!'|"))`,
 				ByGroups(Punctuation, UsingSelf("regex"), Punctuation),
-				MutatorFunc(makeRegexPoppingRule),
+				nil,
 			},
 			Include("variable"),
 			// ::?VARIABLE
@@ -567,9 +606,9 @@ func rakuRules() Rules {
 			{`(>>)(\S+?)(>>)`, ByGroups(Operator, UsingSelf("root"), Operator), nil},
 			{`(»)(\S+?)(»)`, ByGroups(Operator, UsingSelf("root"), Operator), nil},
 			// <<quoted words>>
-			{`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%][\w':-]+\s+|[\])}]\s+)\s*)(<<)(?!(?:(?!>>)[^\n])+?[},;] *\n)(?!(?:(?!>>).)+?>>\S+?>>)`, Punctuation, Push("<<")},
+			{`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%]\*?[\w':-]+\s+|[\])}]\s+)\s*)(<<)(?!(?:(?!>>)[^\n])+?[},;] *\n)(?!(?:(?!>>).)+?>>\S+?>>)`, Punctuation, Push("<<")},
 			// «quoted words»
-			{`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%][\w':-]+\s+|[\])}]\s+)\s*)(«)(?![^»]+?[},;] *\n)(?![^»]+?»\S+?»)`, Punctuation, Push("«")},
+			{`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%]\*?[\w':-]+\s+|[\])}]\s+)\s*)(«)(?![^»]+?[},;] *\n)(?![^»]+?»\S+?»)`, Punctuation, Push("«")},
 			// [<]
 			{`(?<=\[\\?)<(?=\])`, Operator, nil},
 			// < and > operators | something < onething > something
@@ -580,39 +619,25 @@ func rakuRules() Rules {
 			},
 			// <quoted words>
 			{
-				`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%][\w':-]+\s+|[\])}]\s+)\s*)(<)((?:(?![,;)}] *(?:#[^\n]+)?\n)[^<>])+?)(>)(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%]\w[\w':-]*[^(]|\s+\[))`,
+				`(?<!(?:\d+|\.(?:Int|Numeric)|[$@%]\*?[\w':-]+\s+|[\])}]\s+)\s*)(<)((?:(?![,;)}] *(?:#[^\n]+)?\n)[^<>])+?)(>)(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%]\*?\w[\w':-]*[^(]|\s+\[))`,
 				ByGroups(Punctuation, String, Punctuation),
 				nil,
 			},
 			{`C?X::['\w:-]+`, NameException, nil},
 			Include("metaoperator"),
-			// Pair | (key) => value
-			{
-				`(\([^)]+\))(\s*)(=>)(\s*)([^,\n]+)(,?\n*)`,
-				ByGroups(UsingSelf("root"), Text, Operator, Text, UsingSelf("root"), Text),
-				nil,
-			},
 			// Pair | key => value
 			{
-				`(\w[\w'-]*)(\s*)(=>)(\s*)([^,\n]+)(,?\n*)`,
-				ByGroups(String, Text, Operator, Text, UsingSelf("root"), Text),
+				`(\w[\w'-]*)(\s*)(=>)`,
+				ByGroups(String, Text, Operator),
 				nil,
 			},
 			Include("colon-pair"),
 			// Token
 			{
-				// Token with adverbs
-				`(?<=(?:^|\s)(?:regex|token|rule)(\s+))(['\w:-]+)(?=:['\w-]+` +
-					colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `\s*[({])`,
+				`(?<=(?:^|\s)(?:regex|token|rule)(\s+))` + namePattern + colonPairLookahead + `\s*[({])`,
 				NameFunction,
 				Push("token", "name-adverb"),
 			},
-			{
-				// Token without adverbs
-				`(?<=(?:^|\s)(?:regex|token|rule)(?:\s+))(['\w:-]+)`,
-				NameFunction,
-				Push("token"),
-			},
 			// Substitution
 			{`(?<=^|\b|\s)(?<!\.)(ss|S|s|TR|tr)\b(\s*)`, ByGroups(Keyword, Text), Push("substitution")},
 			{keywordsPattern, Keyword, nil},
@@ -626,18 +651,10 @@ func rakuRules() Rules {
 			},
 			//  Routine
 			{
-				// Routine with adverbs
-				`(?<=(?:^|\s)(?:sub|method|multi sub|multi)\s+)!?['\w:-]+(?=:['\w-]+` +
-					colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `\s*[({])`,
+				`(?<=(?:^|\s)(?:sub|method|multi sub|multi)\s+)!?` + namePattern + colonPairLookahead + `\s*[({])`,
 				NameFunction,
 				Push("name-adverb"),
 			},
-			{
-				// Routine without adverbs
-				`(?<=(?:^|\s)(?:sub|submethod|method|multi)\s+)!?['\w:-]+`,
-				NameFunction,
-				nil,
-			},
 			// Constant
 			{`(?<=\bconstant\s+)` + namePattern, NameConstant, Push("name-adverb")},
 			// Namespace
@@ -651,26 +668,20 @@ func rakuRules() Rules {
 			{
 				`(?<=^|\b|\s)(?<keyword>(?:qq|q|Q))(?<adverbs>(?::?(?:heredoc|to|qq|ww|q|w|s|a|h|f|c|b|to|v|x))*)(?<ws>\s*)(?<opening_delimiters>(?<delimiter>[^0-9a-zA-Z:\s])\k<delimiter>*)`,
 				EmitterFunc(quote),
-				bracketsFinder(rakuQuote),
+				findBrackets(rakuQuote),
 			},
 			// Function
 			{
-				`\b(?:\w['\w:-]*)(?=:['\w-]+` +
-					colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `\()`,
+				`\b` + namePattern + colonPairLookahead + `\()`,
 				NameFunction,
 				Push("name-adverb"),
 			},
-			{`\b(?:\w['\w:-]*)(?=\()`, NameFunction, nil},
 			// Method
-			// Method with adverb
 			{
-				`(?<!\.\.[?^*+]?)(?<=(?:\.[?^*+&]?)|self!)['\w:-]+(?=:['\w-]+` +
-					colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `$)`,
+				`(?<!\.\.[?^*+]?)(?<=(?:\.[?^*+&]?)|self!)` + namePattern + colonPairLookahead + `\b)`,
 				NameFunction,
 				Push("name-adverb"),
 			},
-			// Method without adverb
-			{`(?<!\.\.[?^*+]?)(?<=(?:\.[?^*+&]?)|self!)['\w:-]+`, NameFunction, nil},
 			// Indirect invocant
 			{namePattern + `(?=\s+\W?['\w:-]+:\W)`, NameFunction, Push("name-adverb")},
 			{`(?<=\W)(?:∅|i|e|𝑒|tau|τ|pi|π|Inf|∞)(?=\W)`, NameConstant, nil},
@@ -688,11 +699,13 @@ func rakuRules() Rules {
 			Include("colon-pair-attribute"),
 			{
 				`(?<opening_delimiters>(?<delimiter>[^\w:\s])\k<delimiter>*)`,
-				ByGroupNames(map[string]Emitter{
-					`opening_delimiters`: Punctuation,
-					`delimiter`:          nil,
-				}),
-				Mutators(Pop(1), bracketsFinder(rakuMatchRegex)),
+				ByGroupNames(
+					map[string]Emitter{
+						`opening_delimiters`: Punctuation,
+						`delimiter`:          nil,
+					},
+				),
+				findBrackets(rakuMatchRegex),
 			},
 		},
 		"substitution": {
@@ -704,15 +717,13 @@ func rakuRules() Rules {
 					`opening_delimiters`: Punctuation,
 					`delimiter`:          nil,
 				}),
-				Mutators(Pop(1), bracketsFinder(rakuSubstitutionSingleRegex)),
+				findBrackets(rakuMatchRegex),
 			},
 			// Substitution | s/regex/string/
 			{
-				`([^\w:\s])((?:\\\\|\\/|.)*?)(\1)((?:\\\\|\\/|.)*?)(\1)`,
-				ByGroups(
-					Punctuation, UsingSelf("regex"), Punctuation, UsingSelf("qq"), Punctuation,
-				),
-				Mutators(Pop(1), MutatorFunc(makeRegexPoppingRule)),
+				`(?<opening_delimiters>[^\w:\s])`,
+				Punctuation,
+				findBrackets(rakuSubstitutionRegex),
 			},
 		},
 		"number": {
@@ -734,7 +745,7 @@ func rakuRules() Rules {
 		},
 		"colon-pair": {
 			// :key(value)
-			{colonPairPattern, colonPair(String), bracketsFinder(rakuNameAttribute)},
+			{colonPairPattern, colonPair(String), findBrackets(rakuNameAttribute)},
 			// :123abc
 			{
 				`(:)(\d+)(\w[\w'-]*)`,
@@ -742,12 +753,12 @@ func rakuRules() Rules {
 				nil,
 			},
 			// :key
-			{`(:!?)(\w[\w'-]*)`, ByGroups(Punctuation, String), nil},
+			{`(:)(!?)(\w[\w'-]*)`, ByGroups(Punctuation, Operator, String), nil},
 			{`\s+`, Text, nil},
 		},
 		"colon-pair-attribute": {
 			// :key(value)
-			{colonPairPattern, colonPair(NameAttribute), bracketsFinder(rakuNameAttribute)},
+			{colonPairPattern, colonPair(NameAttribute), findBrackets(rakuNameAttribute)},
 			// :123abc
 			{
 				`(:)(\d+)(\w[\w'-]*)`,
@@ -755,12 +766,12 @@ func rakuRules() Rules {
 				nil,
 			},
 			// :key
-			{`(:!?)(\w[\w'-]*)`, ByGroups(Punctuation, NameAttribute), nil},
+			{`(:)(!?)(\w[\w'-]*)`, ByGroups(Punctuation, Operator, NameAttribute), nil},
 			{`\s+`, Text, nil},
 		},
 		"colon-pair-attribute-keyvalue": {
 			// :key(value)
-			{colonPairPattern, colonPair(NameAttribute), bracketsFinder(rakuNameAttribute)},
+			{colonPairPattern, colonPair(NameAttribute), findBrackets(rakuNameAttribute)},
 		},
 		"escape-qq": {
 			{
@@ -769,6 +780,12 @@ func rakuRules() Rules {
 				nil,
 			},
 		},
+		`escape-char`: {
+			{`(?<!(?<!\\)\\)(\\[abfrnrt])`, StringEscape, nil},
+		},
+		`escape-single-quote`: {
+			{`(?<!(?<!\\)\\)(\\)(['\\])`, ByGroups(StringEscape, StringSingle), nil},
+		},
 		"escape-c-name": {
 			{
 				`(?<!(?<!\\)\\)(\\[c|C])(\[)(.+?)(\])`,
@@ -785,14 +802,20 @@ func rakuRules() Rules {
 			{`(\\[x|X])([0-9a-fA-F]+)`, ByGroups(StringEscape, NumberHex), nil},
 		},
 		"regex": {
-			// Placeholder, will be overwritten by bracketsFinder, DO NOT REMOVE!
-			{`^$`, nil, nil},
+			// Placeholder, will be overwritten by mutators, DO NOT REMOVE!
+			{`\A\z`, nil, nil},
 			Include("regex-escape-class"),
+			Include(`regex-character-escape`),
 			// $(code)
 			{
-				`(?<!(?<!\\)\\)([$@])(\()(.*?)(\))`,
-				ByGroups(Keyword, Punctuation, UsingSelf("root"), Punctuation),
-				nil,
+				`([$@])((?<!(?<!\\)\\)\()`,
+				ByGroups(Keyword, Punctuation),
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`)`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					pushState: true,
+				}),
 			},
 			// Exclude $/ from variables, because we can't get out of the end of the slash regex: $/;
 			{`\$(?=/)`, NameEntity, nil},
@@ -805,18 +828,28 @@ func rakuRules() Rules {
 			Include("single-quote"),
 			// :my variable code ...
 			{
-				`(?<!(?<!\\)\\)(:)(my|our|state|constant|temp|let)(.+?;)`,
-				ByGroups(Operator, KeywordDeclaration, UsingSelf("root")),
-				nil,
+				`(?<!(?<!\\)\\)(:)(my|our|state|constant|temp|let)`,
+				ByGroups(Operator, KeywordDeclaration),
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`;`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					pushState: true,
+				}),
 			},
 			// <{code}>
 			{
-				`(?<!(?<!\\)\\)(<)([?!])?((?<!(?<!\\)\\){)(.*?)(}>)`,
-				ByGroups(Punctuation, Operator, Punctuation, UsingSelf("root"), Punctuation),
-				nil,
+				`(?<!(?<!\\)\\)(<)([?!.]*)((?<!(?<!\\)\\){)`,
+				ByGroups(Punctuation, Operator, Punctuation),
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`}>`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					pushState: true,
+				}),
 			},
 			// {code}
-			{`(?<!(?<!\\)\\)({)(.*?)(})`, ByGroups(Punctuation, UsingSelf("root"), Punctuation), nil},
+			Include(`closure`),
 			// Properties
 			{`(:)(\w+)`, ByGroups(Punctuation, NameAttribute), nil},
 			// Operator
@@ -827,9 +860,14 @@ func rakuRules() Rules {
 			{`#[^\n]*\n`, CommentSingle, nil},
 			// Lookaround
 			{
-				`(?<!(?<!\\)\\)(<)(\s*)([?!.])(\s*)(after|before)`,
+				`(?<!(?<!\\)\\)(<)(\s*)([?!.]+)(\s*)(after|before)`,
 				ByGroups(Punctuation, Text, Operator, Text, OperatorWord),
-				Push("regex"),
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`>`),
+					tokenType: Punctuation,
+					stateName: `regex`,
+					pushState: true,
+				}),
 			},
 			{
 				`(?<!(?<!\\)\\)(<)([|!?.]*)(wb|ww|ws|w)(>)`,
@@ -838,15 +876,25 @@ func rakuRules() Rules {
 			},
 			// <$variable>
 			{
-				`(?<!(?<!\\)\\)(<)([$@]\w[\w-:]*)(>)`,
-				ByGroups(Punctuation, NameVariable, Punctuation),
+				`(?<!(?<!\\)\\)(<)([?!.]*)([$@]\w[\w:-]*)(>)`,
+				ByGroups(Punctuation, Operator, NameVariable, Punctuation),
 				nil,
 			},
 			// Capture markers
 			{`(?<!(?<!\\)\\)<\(|\)>`, Operator, nil},
+			{
+				`(?<!(?<!\\)\\)(<)(\w[\w:-]*)(=\.?)`,
+				ByGroups(Punctuation, NameVariable, Operator),
+				Push(`regex-variable`),
+			},
+			{
+				`(?<!(?<!\\)\\)(<)([|!?.&]*)(\w(?:(?!:\s)[\w':-])*)`,
+				ByGroups(Punctuation, Operator, NameFunction),
+				Push(`regex-function`),
+			},
 			{`(?<!(?<!\\)\\)<`, Punctuation, Push("regex-property")},
 			{`(?<!(?<!\\)\\)"`, Punctuation, Push("double-quotes")},
-			{`(?<!(?<!\\)\\)(?:\]|\)|>)`, Punctuation, Pop(1)},
+			{`(?<!(?<!\\)\\)(?:\]|\))`, Punctuation, Pop(1)},
 			{`(?<!(?<!\\)\\)(?:\[|\()`, Punctuation, Push("regex")},
 			{`.+?`, StringRegex, nil},
 		},
@@ -857,41 +905,85 @@ func rakuRules() Rules {
 				nil,
 			},
 		},
-		"regex-property": {
+		"regex-function": {
+			// <function>
 			{`(?<!(?<!\\)\\)>`, Punctuation, Pop(1)},
-			Include("regex-class-builtin"),
-			Include("variable"),
-			// <regexfunc> | <regexfunc(parameter)> | <variable=regexfunc>
+			// <function(parameter)>
 			{
-				`(?:(\w[\w-:]*)(=\.?))?(&?\w[\w'-:]+?)(\(.+?\))?(?=>)`,
-				ByGroups(
-					NameVariable, Operator, NameFunction, UsingSelf("root"),
-				),
-				nil,
+				`\(`,
+				Punctuation,
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`)>`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					popState:  true,
+					pushState: true,
+				}),
 			},
-			// <func: value>
+			// <function value>
 			{
-				`(&?\w[\w':-]*?)(:)((?:.*?(?:\$<\w[\w':-]*>)?.*?)*?)(?=>)`,
-				ByGroups(
-					NameFunction, Punctuation, UsingSelf("root"),
-				),
-				nil,
+				`\s+`,
+				StringRegex,
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`>`),
+					tokenType: Punctuation,
+					stateName: `regex`,
+					popState:  true,
+					pushState: true,
+				}),
+			},
+			// <function: value>
+			{
+				`:`,
+				Punctuation,
+				replaceRule(ruleReplacingConfig{
+					delimiter: []rune(`>`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					popState:  true,
+					pushState: true,
+				}),
 			},
+		},
+		"regex-variable": {
+			Include(`regex-starting-operators`),
+			// <var=function(
+			{
+				`(&)?(\w(?:(?!:\s)[\w':-])*)(?=\()`,
+				ByGroups(Operator, NameFunction),
+				Mutators(Pop(1), Push(`regex-function`)),
+			},
+			// <var=function>
+			{`(&)?(\w[\w':-]*)(>)`, ByGroups(Operator, NameFunction, Punctuation), Pop(1)},
+			// <var=
+			Default(Pop(1), Push(`regex-property`)),
+		},
+		"regex-property": {
+			{`(?<!(?<!\\)\\)>`, Punctuation, Pop(1)},
+			Include("regex-class-builtin"),
+			Include("variable"),
+			Include(`regex-starting-operators`),
 			Include("colon-pair-attribute"),
 			{`(?<!(?<!\\)\\)\[`, Punctuation, Push("regex-character-class")},
 			{`\+|\-`, Operator, nil},
-			{`@[\w'-:]+`, NameVariable, nil},
-			{`(?<=<)[|!?.]`, Operator, nil},
+			{`@[\w':-]+`, NameVariable, nil},
 			{`.+?`, StringRegex, nil},
 		},
+		`regex-starting-operators`: {
+			{`(?<=<)[|!?.]+`, Operator, nil},
+		},
 		"regex-escape-class": {
 			{`(?i)\\n|\\t|\\h|\\v|\\s|\\d|\\w`, StringEscape, nil},
 		},
+		`regex-character-escape`: {
+			{`(?<!(?<!\\)\\)(\\)(.)`, ByGroups(StringEscape, StringRegex), nil},
+		},
 		"regex-character-class": {
 			{`(?<!(?<!\\)\\)\]`, Punctuation, Pop(1)},
 			Include("regex-escape-class"),
 			Include("escape-c-name"),
 			Include("escape-hexadecimal"),
+			Include(`regex-character-escape`),
 			Include("number"),
 			{`\.\.`, Operator, nil},
 			{`.+?`, StringRegex, nil},
@@ -926,7 +1018,7 @@ func rakuRules() Rules {
 						`value`:              UsingSelf("pod-declaration"),
 						`closing_delimiters`: Punctuation,
 					}),
-				bracketsFinder(rakuPodDeclaration),
+				findBrackets(rakuPodDeclaration),
 			},
 			Include("pod-blocks"),
 		},
@@ -950,7 +1042,7 @@ func rakuRules() Rules {
 						`value`:              UsingSelf("pod-begin"),
 						`closing_delimiters`: Keyword,
 					}),
-				bracketsFinder(rakuPod),
+				findBrackets(rakuPod),
 			},
 			// =for ...
 			{
@@ -1047,25 +1139,21 @@ func rakuRules() Rules {
 			{
 				`(?<keyword>[CBIUDTKRPAELZVMSXN])(?<opening_delimiters><+|«)`,
 				ByGroups(Keyword, Punctuation),
-				Mutators(
-					bracketsFinder(rakuPodFormatter),
-					Push("pod-formatter"), MutatorFunc(podFormatter),
-				),
+				findBrackets(rakuPodFormatter),
 			},
 		},
 		"pod-formatter": {
-			// Placeholder rule, will be replaced by podFormatter. DO NOT REMOVE!
+			// Placeholder rule, will be replaced by mutators. DO NOT REMOVE!
 			{`>`, Punctuation, Pop(1)},
 			Include("pre-pod-formatter"),
-			// Placeholder rule, will be replaced by podFormatter. DO NOT REMOVE!
+			// Placeholder rule, will be replaced by mutators. DO NOT REMOVE!
 			{`.+?`, StringOther, nil},
 		},
 		"variable": {
 			{variablePattern, NameVariable, Push("name-adverb")},
 			{globalVariablePattern, NameVariableGlobal, Push("name-adverb")},
-			{`[$@](?:<.*?>)+`, NameVariable, nil},
-			{`\$/`, NameVariable, nil},
-			{`\$!`, NameVariable, nil},
+			{`[$@]<[^>]+>`, NameVariable, nil},
+			{`\$[/!¢]`, NameVariable, nil},
 			{`[$@%]`, NameVariable, nil},
 		},
 		"single-quote": {
@@ -1073,6 +1161,7 @@ func rakuRules() Rules {
 		},
 		"single-quote-inner": {
 			{`(?<!(?<!(?<!\\)\\)\\)'`, Punctuation, Pop(1)},
+			Include("escape-single-quote"),
 			Include("escape-qq"),
 			{`(?:\\\\|\\[^\\]|[^'\\])+?`, StringSingle, nil},
 		},
@@ -1081,11 +1170,11 @@ func rakuRules() Rules {
 			Include("qq"),
 		},
 		"<<": {
-			{`>>(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%][\w':-]+|\s+\[))`, Punctuation, Pop(1)},
+			{`>>(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%]\*?[\w':-]+|\s+\[))`, Punctuation, Pop(1)},
 			Include("ww"),
 		},
 		"«": {
-			{`»(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%][\w':-]+|\s+\[))`, Punctuation, Pop(1)},
+			{`»(?!\s*(?:\d+|\.(?:Int|Numeric)|[$@%]\*?[\w':-]+|\s+\[))`, Punctuation, Pop(1)},
 			Include("ww"),
 		},
 		"ww": {
@@ -1094,39 +1183,39 @@ func rakuRules() Rules {
 		},
 		"qq": {
 			Include("qq-variable"),
-			// Function with adverb
-			{
-				`\w[\w:'-]+(?=:['\w-]+` +
-					colonPairOpeningBrackets + `.+?` + colonPairClosingBrackets + `\()`,
-				NameFunction,
-				Push("qq-function", "name-adverb"),
-			},
-			// Function without adverb
-			{`\w[\w:'-]+(?=\((?!"))`, NameFunction, Push("qq-function")},
 			Include("closure"),
+			Include(`escape-char`),
 			Include("escape-hexadecimal"),
 			Include("escape-c-name"),
 			Include("escape-qq"),
 			{`.+?`, StringDouble, nil},
 		},
-		"qq-function": {
-			{`(\([^"]*?\))`, UsingSelf("root"), nil},
-			Default(Pop(1)),
-		},
 		"qq-variable": {
 			{
-				`(?<!(?<!\\)\\)(?:` + variablePattern + `|` + globalVariablePattern + `)`,
+				`(?<!(?<!\\)\\)(?:` + variablePattern + `|` + globalVariablePattern + `)` + colonPairLookahead + `)`,
 				NameVariable,
 				Push("qq-variable-extras", "name-adverb"),
 			},
 		},
 		"qq-variable-extras": {
-			{`(?:\[.*?\]|\{.*?\}|<<.*?>>|<.*?>|«.*?»)+`, UsingSelf("root"), nil},
 			// Method
 			{
-				`(\.)([^(\s]+)(\([^"]*?\))`,
-				ByGroups(Operator, NameFunction, UsingSelf("root")),
-				nil,
+				`(?<operator>\.)(?<method_name>` + namePattern + `)` + colonPairLookahead + `\()`,
+				ByGroupNames(map[string]Emitter{
+					`operator`:    Operator,
+					`method_name`: NameFunction,
+				}),
+				Push(`name-adverb`),
+			},
+			// Function/Signature
+			{
+				`\(`, Punctuation, replaceRule(
+					ruleReplacingConfig{
+						delimiter: []rune(`)`),
+						tokenType: Punctuation,
+						stateName: `root`,
+						pushState: true,
+					}),
 			},
 			Default(Pop(1)),
 		},
@@ -1145,13 +1234,36 @@ func rakuRules() Rules {
 			{`.+?`, String, nil},
 		},
 		"closure": {
-			{`(?<!(?<!\\)\\)\{.+?\}`, UsingSelf("root"), nil},
+			{`(?<!(?<!\\)\\){`, Punctuation, replaceRule(
+				ruleReplacingConfig{
+					delimiter: []rune(`}`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					pushState: true,
+				}),
+			},
 		},
 		"token": {
 			// Token signature
-			{`(\()(.+?)(\))`, ByGroups(Punctuation, UsingSelf("root"), Punctuation), nil},
-			{`\{`, Punctuation, Mutators(Pop(1), bracketsFinder(rakuRegexInsideToken))},
-			{`.+?`, Text, nil},
+			{`\(`, Punctuation, replaceRule(
+				ruleReplacingConfig{
+					delimiter: []rune(`)`),
+					tokenType: Punctuation,
+					stateName: `root`,
+					pushState: true,
+				}),
+			},
+			{`{`, Punctuation, replaceRule(
+				ruleReplacingConfig{
+					delimiter: []rune(`}`),
+					tokenType: Punctuation,
+					stateName: `regex`,
+					popState:  true,
+					pushState: true,
+				}),
+			},
+			{`\s*`, Text, nil},
+			Default(Pop(1)),
 		},
 	}
 }
@@ -1168,11 +1280,24 @@ func joinRuneMap(m map[rune]rune) string {
 
 // Finds the index of substring in the string starting at position n
 func indexAt(str []rune, substr []rune, pos int) int {
-	text := string(str[pos:])
+	strFromPos := str[pos:]
+	text := string(strFromPos)
 
 	idx := strings.Index(text, string(substr))
 	if idx > -1 {
 		idx = utf8.RuneCountInString(text[:idx])
+
+		// Search again if the substr is escaped with backslash
+		if (idx > 1 && strFromPos[idx-1] == '\\' && strFromPos[idx-2] != '\\') ||
+			(idx == 1 && strFromPos[idx-1] == '\\') {
+			idx = indexAt(str[pos:], substr, idx+1)
+
+			idx = utf8.RuneCountInString(text[:idx])
+
+			if idx < 0 {
+				return idx
+			}
+		}
 		idx += pos
 	}
 
@@ -1189,107 +1314,190 @@ func contains(s []string, e string) bool {
 	return false
 }
 
-type RakuFormatterRules struct {
-	pop, formatter *CompiledRule
+type rulePosition int
+
+const (
+	topRule    rulePosition = 0
+	bottomRule              = -1
+)
+
+type ruleMakingConfig struct {
+	delimiter              []rune
+	pattern                string
+	tokenType              Emitter
+	mutator                Mutator
+	numberOfDelimiterChars int
+}
+
+type ruleReplacingConfig struct {
+	delimiter              []rune
+	pattern                string
+	tokenType              Emitter
+	numberOfDelimiterChars int
+	mutator                Mutator
+	appendMutator          Mutator
+	rulePosition           rulePosition
+	stateName              string
+	pop                    bool
+	popState               bool
+	pushState              bool
 }
 
-// Pop from the pod_formatter_stack and reformat the pod code
-func podFormatterPopper(state *LexerState) error {
-	stack, ok := state.Get("pod_formatter_stack").([]RakuFormatterRules)
+// Pops rule from state-stack and replaces the rule with the previous rule
+func popRule(rule ruleReplacingConfig) MutatorFunc {
+	return func(state *LexerState) error {
+		stackName := genStackName(rule.stateName, rule.rulePosition)
 
-	if ok && len(stack) > 0 {
-		// Pop from stack
-		stack = stack[:len(stack)-1]
-		state.Set("pod_formatter_stack", stack)
-		// Call podFormatter to use the last formatter rules
-		err := podFormatter(state)
-		if err != nil {
-			panic(err)
+		stack, ok := state.Get(stackName).([]ruleReplacingConfig)
+
+		if ok && len(stack) > 0 {
+			// Pop from stack
+			stack = stack[:len(stack)-1]
+			lastRule := stack[len(stack)-1]
+			lastRule.pushState = false
+			lastRule.popState = false
+			lastRule.pop = true
+			state.Set(stackName, stack)
+
+			// Call replaceRule to use the last rule
+			err := replaceRule(lastRule)(state)
+			if err != nil {
+				panic(err)
+			}
 		}
-	}
 
-	return nil
+		return nil
+	}
 }
 
-// Use the rules from pod_formatter_stack to format the pod code
-func podFormatter(state *LexerState) error {
-	stack, ok := state.Get("pod_formatter_stack").([]RakuFormatterRules)
-	if ok && len(stack) > 0 {
-		rules := stack[len(stack)-1]
-		state.Rules["pod-formatter"][0] = rules.pop
-		state.Rules["pod-formatter"][len(state.Rules["pod-formatter"])-1] = rules.formatter
-	}
+// Replaces a state's rule based on the rule config and position
+func replaceRule(rule ruleReplacingConfig) MutatorFunc {
+	return func(state *LexerState) error {
+		stateName := rule.stateName
+		stackName := genStackName(rule.stateName, rule.rulePosition)
 
-	return nil
-}
+		stack, ok := state.Get(stackName).([]ruleReplacingConfig)
+		if !ok {
+			stack = []ruleReplacingConfig{}
+		}
 
-type RulePosition int
+		// If state-stack is empty fill it with the placeholder rule
+		if len(stack) == 0 {
+			stack = []ruleReplacingConfig{
+				{
+					// Placeholder, will be overwritten by mutators, DO NOT REMOVE!
+					pattern:      `\A\z`,
+					tokenType:    nil,
+					mutator:      nil,
+					stateName:    stateName,
+					rulePosition: rule.rulePosition,
+				},
+			}
+			state.Set(stackName, stack)
+		}
 
-const (
-	topRule RulePosition = iota + 1000
-	bottomRule
-)
+		var mutator Mutator
+		mutators := []Mutator{}
+
+		switch {
+		case rule.rulePosition == topRule && rule.mutator == nil:
+			// Default mutator for top rule
+			mutators = []Mutator{Pop(1), popRule(rule)}
+		case rule.rulePosition == topRule && rule.mutator != nil:
+			// Default mutator for top rule, when rule.mutator is set
+			mutators = []Mutator{rule.mutator, popRule(rule)}
+		case rule.mutator != nil:
+			mutators = []Mutator{rule.mutator}
+		}
 
-type RuleMakingConfig struct {
-	delimiter              []rune
-	pattern                string
-	tokenType              TokenType
-	mutator                Mutator
-	rulePosition           RulePosition
-	state                  *LexerState
-	stateName              string
-	pushToStack            bool
-	numberOfDelimiterChars int
+		if rule.appendMutator != nil {
+			mutators = append(mutators, rule.appendMutator)
+		}
+
+		if len(mutators) > 0 {
+			mutator = Mutators(mutators...)
+		} else {
+			mutator = nil
+		}
+
+		ruleConfig := ruleMakingConfig{
+			pattern:                rule.pattern,
+			delimiter:              rule.delimiter,
+			numberOfDelimiterChars: rule.numberOfDelimiterChars,
+			tokenType:              rule.tokenType,
+			mutator:                mutator,
+		}
+
+		cRule := makeRule(ruleConfig)
+
+		switch rule.rulePosition {
+		case topRule:
+			state.Rules[stateName][0] = cRule
+		case bottomRule:
+			state.Rules[stateName][len(state.Rules[stateName])-1] = cRule
+		}
+
+		// Pop state name from stack if asked. State should be popped first before Pushing
+		if rule.popState {
+			err := Pop(1)(state)
+			if err != nil {
+				panic(err)
+			}
+		}
+
+		// Push state name to stack if asked
+		if rule.pushState {
+			err := Push(stateName)(state)
+			if err != nil {
+				panic(err)
+			}
+		}
+
+		if !rule.pop {
+			state.Set(stackName, append(stack, rule))
+		}
+
+		return nil
+	}
+}
+
+// Generates rule replacing stack using state name and rule position
+func genStackName(stateName string, rulePosition rulePosition) (stackName string) {
+	switch rulePosition {
+	case topRule:
+		stackName = stateName + `-top-stack`
+	case bottomRule:
+		stackName = stateName + `-bottom-stack`
+	}
+	return
 }
 
-// Makes compiled rules and returns them, If rule position is given, rules are added to the state
-// If pushToStack is true, state name will be added to the state stack
-func makeRuleAndPushMaybe(config RuleMakingConfig) *CompiledRule {
+// Makes a compiled rule and returns it
+func makeRule(config ruleMakingConfig) *CompiledRule {
 	var rePattern string
+
 	if len(config.delimiter) > 0 {
-		delimiter := strings.Repeat(string(config.delimiter), config.numberOfDelimiterChars)
-		rePattern = regexp2.Escape(delimiter)
+		delimiter := string(config.delimiter)
+
+		if config.numberOfDelimiterChars > 1 {
+			delimiter = strings.Repeat(delimiter, config.numberOfDelimiterChars)
+		}
+
+		rePattern = `(?<!(?<!\\)\\)` + regexp2.Escape(delimiter)
 	} else {
 		rePattern = config.pattern
 	}
+
 	regex := regexp2.MustCompile(rePattern, regexp2.None)
 
 	cRule := &CompiledRule{
 		Rule:   Rule{rePattern, config.tokenType, config.mutator},
 		Regexp: regex,
 	}
-	state := config.state
-	stateName := config.stateName
-	switch config.rulePosition {
-	case topRule:
-		state.Rules[stateName] =
-			append([]*CompiledRule{cRule}, state.Rules[stateName][1:]...)
-	case bottomRule:
-		state.Rules[stateName] =
-			append(state.Rules[stateName][:len(state.Rules[stateName])-1], cRule)
-	}
-
-	// Push state name to stack if asked
-	if config.pushToStack {
-		state.Stack = append(state.Stack, config.stateName)
-	}
 
 	return cRule
 }
 
-// Used when the regex knows its own delimiter and uses `UsingSelf("regex")`,
-// it only puts a placeholder rule at the top of "regex" state
-func makeRegexPoppingRule(state *LexerState) error {
-	makeRuleAndPushMaybe(RuleMakingConfig{
-		pattern:      `^$`,
-		rulePosition: topRule,
-		state:        state,
-		stateName:    "regex",
-	})
-
-	return nil
-}
-
 // Emitter for colon pairs, changes token state based on key and brackets
 func colonPair(tokenClass TokenType) Emitter {
 	return EmitterFunc(func(groups []string, state *LexerState) Iterator {


Test patch:
diff --git a/lexers/testdata/raku.actual b/lexers/testdata/raku.actual
index 26b18e4..a3cc6d6 100644
--- a/lexers/testdata/raku.actual
+++ b/lexers/testdata/raku.actual
@@ -11,12 +11,17 @@ heading
 fmt.Println("Hello from Go")
 =end code
 
+    =begin DESCRIPTION
+    Some description
+    =item one item
+    =end DESCRIPTION
+
 =for defn :numbered
                We
                Need
                Numbers
 
-=end pod
+=end  pod
 
 say $=pod[0].config<numbered>;
 
@@ -32,6 +37,8 @@ sub f2($a,$b) {
 
 2.&f2(3);
 
+Module::function($var);
+
 #| Fibonacci with Multiple dispatch
 multi sub fib (0 --> 0) {}
 multi sub fib (1 --> 1) {}
@@ -41,7 +48,7 @@ multi sub fib (\n where * > 1) {
 say fib 10;
 # OUTPUT: 55
 
-#| C<Shape> role
+#| B<A C<<uh U<Shape> umm>> role>
 role Shape {
     method area { ... }
 
@@ -127,6 +134,82 @@ key2 = value2
 key3=value3
 END
 
+grammar Nested {
+    token TOP { <block> <section>* { if $/ { say $/ } } }
+    token block {
+        <?before <.[\)\]\}]>>
+    }
+
+    token you_are_here {
+    <?{ nqp::getlexdyn('$?FILES') ~~ /\.setting$/ }> ||
+    \w+ 'some text' \d+
+        { self.typed_panic('X::Syntax::Reserved',
+                reserved => 'use of {YOU_ARE_HERE} outside of a setting',
+                instead => ' (use whitespace if not a setting, or rename file with .setting extension?)');
+        }
+    }
+
+    rule statement_control:sym<if> {
+        $<sym>=[if|with]<.kok> {}
+        <xblock(~$<sym>[0] ~~ /with/ ?? $PBLOCK_REQUIRED_TOPIC !! $PBLOCK_NO_TOPIC)>
+        [
+            [
+            | 'else'\h*'if' <.typed_panic: 'X::Syntax::Malformed::Elsif'>
+            | 'elif' { $/.typed_panic('X::Syntax::Malformed::Elsif', what => "elif") }
+            | $<sym>='elsif'  <xblock>
+            | $<sym>='orwith' <xblock($PBLOCK_REQUIRED_TOPIC)>
+            ]
+        ]*
+        {}
+        [
+            'else'
+            <else=.pblock(~$<sym>[-1] ~~ /with/ ?? $PBLOCK_REQUIRED_TOPIC !! $PBLOCK_NO_TOPIC)>
+        ]?
+    }
+
+    token special_variable:sym<$\\> {
+        '$\\' <?before \s | ',' | '=' | <.terminator> >
+        <.obsvar('$\\')>
+    }
+
+    token type_declarator:sym<enum> {
+        :my %*MYSTERY;
+        [ <?[<(«]> <term> <.ws> || <.panic: 'An enum must supply an expression using <>, «», or ()'> ]
+        <.explain_mystery> <.cry_sorrows>
+        <?{
+            elsif !($text ~~ /^(\w|\:)+$/) {
+                $/.obs($bad, "$sigil\($text) for hard ref or $sigil\::($text) for symbolic ref");
+            }
+        }>
+    }
+
+    token rad_number {
+        :my $rad_digits := token rad_digits { <rad_digit>+ [ _ <rad_digit>+ ]* };
+        <O(|%methodcall)>
+        <O=.revO($<infixish>)>
+        <code=[A..Z]>
+    }
+
+    token pod_balanced_braces {
+        <?{ nqp::chars($<start>) == $*POD_ANGLE_COUNT || $*POD_ANGLE_COUNT < 0 }>
+    }
+
+    token routine_declarator:sym<macro> {
+        :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));
+        <!!{ nqp::rebless($/, self.slang_grammar('MAIN')); 1 }>
+        <sym> <.end_keyword> <macro_def()>
+    }
+
+    token routine_declarator:sym<macro> {
+        :my $*LINE_NO := HLL::Compiler.lineof(self.orig(), self.from(), :cache(1));
+        <sym> <.end_keyword> <macro_def()>
+    }
+
+    token integer {
+       <!!before ['.' <?before \s | ',' | '=' | ':' <!before  <coloncircumfix <OPER=prefix> > > | <.terminator> | $ > <.typed_sorry: 'X::Syntax::Number::IllegalDecimal'>]? >
+       [ <?before '_' '_'+\d> <.sorry: "Only isolated underscores are allowed inside numbers"> ]?
+    }
+}
 
 say $match<block><pair>[0]<value>;
 # OUTPUT: ｢value1｣
@@ -231,6 +314,12 @@ rx/:i
 
         $<myname> = [ \w+ ]
 
+        <!!{ $*LANG := $*LEAF := $/.clone_braid_from(self); 1 }>
+
+        <?before <.[\)\]\}]>>
+
+        \/
+
         $<string>=( [ $<part>=[abc] ]* % '-' )
         $<variable>=\w+ '=' $<value>=\w+
         a <( b )> c
@@ -255,6 +344,8 @@ rx/:i
         \d ** 1..3 <?{ $/.Int <= 255 && $/.Int >= 0 }>
         $/;
 
+$<variable><key>;
+
 constant \something:some<adverb> = 'something';
 
 my %hash = %(
@@ -308,6 +399,9 @@ say Q:b[Testing];
 "some $variable:some('adverb').method() testing";
 "some func() testing";
 "some func:some<adverb>() testing";
+"some &func() testing";
+"some &func($test) testing";
+"some &func:some<adverb>() testing";
 say "Something foo(2) $a.succ(2+3, $some_variable) $a.some-method()  @more $_.Str(2) $_: { $_ * 2 }";
 
 #`[[
@@ -376,7 +470,6 @@ for <a b c> {
 #|[[
 multiline pod declaration]
 ]]
-
 grammar Calculator {
     token TOP { <calc-op> }
 
diff --git a/lexers/testdata/raku.expected b/lexers/testdata/raku.expected
index 4ae4b69..b1a1745 100644
--- a/lexers/testdata/raku.expected
+++ b/lexers/testdata/raku.expected
@@ -33,6 +33,16 @@
   {"type":"Text","value":"\n"},
   {"type":"Keyword","value":"=end code"},
   {"type":"LiteralStringDoc","value":"\n\n"},
+  {"type":"Comment","value":"    "},
+  {"type":"Keyword","value":"=begin"},
+  {"type":"LiteralStringDoc","value":" "},
+  {"type":"Keyword","value":"DESCRIPTION"},
+  {"type":"LiteralStringDoc","value":"\n    Some description\n"},
+  {"type":"Comment","value":"    "},
+  {"type":"Keyword","value":"=item"},
+  {"type":"LiteralStringDoc","value":" one item\n"},
+  {"type":"Keyword","value":"    =end DESCRIPTION"},
+  {"type":"LiteralStringDoc","value":"\n\n"},
   {"type":"Keyword","value":"=for"},
   {"type":"LiteralStringDoc","value":" "},
   {"type":"Keyword","value":"defn"},
@@ -41,7 +51,7 @@
   {"type":"NameAttribute","value":"numbered"},
   {"type":"Text","value":"\n"},
   {"type":"LiteralStringDoc","value":"               We\n               Need\n               Numbers\n\n"},
-  {"type":"Keyword","value":"=end pod"},
+  {"type":"Keyword","value":"=end  pod"},
   {"type":"Text","value":"\n\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
@@ -102,6 +112,11 @@
   {"type":"LiteralNumberInteger","value":"3"},
   {"type":"Punctuation","value":");"},
   {"type":"Text","value":"\n\n"},
+  {"type":"NameFunction","value":"Module::function"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$var"},
+  {"type":"Punctuation","value":");"},
+  {"type":"Text","value":"\n\n"},
   {"type":"Keyword","value":"#| "},
   {"type":"LiteralStringDoc","value":"Fibonacci with Multiple dispatch\n"},
   {"type":"Keyword","value":"multi"},
@@ -188,11 +203,21 @@
   {"type":"Text","value":"\n"},
   {"type":"CommentSingle","value":"# OUTPUT: 55"},
   {"type":"Text","value":"\n\n"},
-  {"type":"Keyword","value":"#| C"},
+  {"type":"Keyword","value":"#| B"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"GenericStrong","value":"A "},
+  {"type":"Keyword","value":"C"},
+  {"type":"Punctuation","value":"\u003c\u003c"},
+  {"type":"LiteralStringOther","value":"uh "},
+  {"type":"Keyword","value":"U"},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"LiteralStringOther","value":"Shape"},
+  {"type":"GenericUnderline","value":"Shape"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringOther","value":" umm"},
+  {"type":"Punctuation","value":"\u003e\u003e"},
+  {"type":"GenericStrong","value":" role"},
   {"type":"Punctuation","value":"\u003e"},
-  {"type":"LiteralStringDoc","value":" role\n"},
+  {"type":"LiteralStringDoc","value":"\n"},
   {"type":"Keyword","value":"role"},
   {"type":"Text","value":" "},
   {"type":"NameClass","value":"Shape"},
@@ -290,7 +315,8 @@
   {"type":"Operator","value":"=\u003e"},
   {"type":"Text","value":" "},
   {"type":"LiteralNumberInteger","value":"5"},
-  {"type":"Text","value":", "},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
   {"type":"LiteralString","value":"height"},
   {"type":"Text","value":" "},
   {"type":"Operator","value":"=\u003e"},
@@ -612,159 +638,955 @@
   {"type":"Punctuation","value":"{"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"block"},
+  {"type":"NameFunction","value":"block"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"section"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"section"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"header"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"block"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"header"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"["},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"~"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"]"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\w"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\n"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"block"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"[\u003c"},
+  {"type":"NameFunction","value":"pair"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"comment"},
+  {"type":"Punctuation","value":"\u003e]"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"rule"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"pair"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"key"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"="},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"value"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"comment"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":";"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\N"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\n"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"key"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\w"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"value"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"-"},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringEscape","value":"\\n"},
+  {"type":"LiteralStringRegex","value":" ;"},
+  {"type":"Punctuation","value":"]\u003e"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n"},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n"},
+  {"type":"Keyword","value":"my"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$match"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"="},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"INIParser"},
+  {"type":"Operator","value":"."},
+  {"type":"NameBuiltin","value":"parse"},
+  {"type":"Operator","value":":"},
+  {"type":"Text","value":" "},
+  {"type":"Keyword","value":"q"},
+  {"type":"LiteralStringAffix","value":":to"},
+  {"type":"Punctuation","value":"/END/;"},
+  {"type":"LiteralString","value":"\n; Comment\nkey1=value1\nkey2 = value2\n\n; Section 1\n[section1]\nkey3=value3\n"},
+  {"type":"Punctuation","value":"END"},
+  {"type":"Text","value":"\n\n"},
+  {"type":"Keyword","value":"grammar"},
+  {"type":"Text","value":" "},
+  {"type":"NameClass","value":"Nested"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"TOP"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"block"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"section"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"Keyword","value":"if"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameBuiltin","value":"say"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"block"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"OperatorWord","value":"before"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":")"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"]"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"}"},
+  {"type":"Punctuation","value":"]\u003e\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"you_are_here"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"nqp::getlexdyn"},
+  {"type":"Punctuation","value":"('"},
+  {"type":"LiteralStringSingle","value":"$?FILES"},
+  {"type":"Punctuation","value":"')"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"~~"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"/"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":".setting"},
+  {"type":"NameEntity","value":"$"},
+  {"type":"Punctuation","value":"/"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"||"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"LiteralStringEscape","value":"\\w"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"some text"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\d"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"typed_panic"},
+  {"type":"Punctuation","value":"('"},
+  {"type":"LiteralStringSingle","value":"X::Syntax::Reserved"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n                "},
+  {"type":"LiteralString","value":"reserved"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"=\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"use of {YOU_ARE_HERE} outside of a setting"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n                "},
+  {"type":"LiteralString","value":"instead"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"=\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":" (use whitespace if not a setting, or rename file with .setting extension?)"},
+  {"type":"Punctuation","value":"');"},
+  {"type":"Text","value":"\n        "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"rule"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"statement_control"},
+  {"type":"Punctuation","value":":"},
+  {"type":"NameAttribute","value":"sym"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"LiteralString","value":"if"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"NameVariable","value":"$\u003csym\u003e"},
+  {"type":"Operator","value":"="},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"if"},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":"with"},
+  {"type":"Punctuation","value":"]\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"kok"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"{}"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"xblock"},
+  {"type":"Punctuation","value":"("},
+  {"type":"Operator","value":"~"},
+  {"type":"NameVariable","value":"$\u003csym\u003e"},
+  {"type":"Operator","value":"["},
+  {"type":"LiteralNumberInteger","value":"0"},
+  {"type":"Operator","value":"]"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"~~"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"/"},
+  {"type":"LiteralStringRegex","value":"with"},
+  {"type":"Punctuation","value":"/"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"??"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$PBLOCK_REQUIRED_TOPIC"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"!!"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$PBLOCK_NO_TOPIC"},
+  {"type":"Punctuation","value":")\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"else"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringEscape","value":"\\h"},
+  {"type":"Operator","value":"*"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"if"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"typed_panic"},
+  {"type":"Punctuation","value":":"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"X::Syntax::Malformed::Elsif"},
+  {"type":"Punctuation","value":"'\u003e"},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"elif"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"typed_panic"},
+  {"type":"Punctuation","value":"('"},
+  {"type":"LiteralStringSingle","value":"X::Syntax::Malformed::Elsif"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"LiteralString","value":"what"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"=\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"\""},
+  {"type":"LiteralStringDouble","value":"elif"},
+  {"type":"Punctuation","value":"\")"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"NameVariable","value":"$\u003csym\u003e"},
+  {"type":"Operator","value":"="},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"elsif"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":"  "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"xblock"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"NameVariable","value":"$\u003csym\u003e"},
+  {"type":"Operator","value":"="},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"orwith"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"xblock"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$PBLOCK_REQUIRED_TOPIC"},
+  {"type":"Punctuation","value":")\u003e"},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"{}"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"else"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":"\n            "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameVariable","value":"else"},
+  {"type":"Operator","value":"=."},
+  {"type":"NameFunction","value":"pblock"},
+  {"type":"Punctuation","value":"("},
+  {"type":"Operator","value":"~"},
+  {"type":"NameVariable","value":"$\u003csym\u003e"},
+  {"type":"Operator","value":"[-"},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Operator","value":"]"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"~~"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"/"},
+  {"type":"LiteralStringRegex","value":"with"},
+  {"type":"Punctuation","value":"/"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"??"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$PBLOCK_REQUIRED_TOPIC"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"!!"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$PBLOCK_NO_TOPIC"},
+  {"type":"Punctuation","value":")\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"Operator","value":"?"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"special_variable"},
+  {"type":"Punctuation","value":":"},
+  {"type":"NameAttribute","value":"sym"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"LiteralString","value":"$\\\\"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"$"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringSingle","value":"\\"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"OperatorWord","value":"before"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\s"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":","},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"="},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"terminator"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"obsvar"},
+  {"type":"Punctuation","value":"('"},
+  {"type":"LiteralStringSingle","value":"$"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringSingle","value":"\\"},
+  {"type":"Punctuation","value":"')\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"type_declarator"},
+  {"type":"Punctuation","value":":"},
+  {"type":"NameAttribute","value":"sym"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"LiteralString","value":"enum"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Operator","value":":"},
+  {"type":"KeywordDeclaration","value":"my"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"%*MYSTERY"},
+  {"type":"Punctuation","value":";"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"\u003c(«"},
+  {"type":"Punctuation","value":"]\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"term"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"OperatorWord","value":"ws"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"||"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"panic"},
+  {"type":"Punctuation","value":":"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"An enum must supply an expression using \u003c\u003e, «», or ()"},
+  {"type":"Punctuation","value":"'\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"explain_mystery"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"cry_sorrows"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":"\n            "},
+  {"type":"Keyword","value":"elsif"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"!"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$text"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"~~"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"/"},
+  {"type":"NameEntity","value":"^"},
+  {"type":"Punctuation","value":"("},
+  {"type":"LiteralStringEscape","value":"\\w"},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":":"},
+  {"type":"Punctuation","value":")"},
+  {"type":"Operator","value":"+"},
+  {"type":"NameEntity","value":"$"},
+  {"type":"Punctuation","value":"/)"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":"\n                "},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"obs"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$bad"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"\""},
+  {"type":"NameVariable","value":"$sigil"},
+  {"type":"LiteralStringDouble","value":"\\("},
+  {"type":"NameVariable","value":"$text"},
+  {"type":"LiteralStringDouble","value":") for hard ref or "},
+  {"type":"NameVariable","value":"$sigil"},
+  {"type":"LiteralStringDouble","value":"\\::("},
+  {"type":"NameVariable","value":"$text"},
+  {"type":"LiteralStringDouble","value":") for symbolic ref"},
+  {"type":"Punctuation","value":"\");"},
+  {"type":"Text","value":"\n            "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n        "},
+  {"type":"Punctuation","value":"}\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"rad_number"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Operator","value":":"},
+  {"type":"KeywordDeclaration","value":"my"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$rad_digits"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":":="},
+  {"type":"Text","value":" "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"rad_digits"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"rad_digit"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":" _ "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"rad_digit"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Operator","value":"+"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"Operator","value":"*"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"};"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"O"},
+  {"type":"Punctuation","value":"("},
+  {"type":"Operator","value":"|"},
+  {"type":"NameVariable","value":"%methodcall"},
+  {"type":"Punctuation","value":")\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameVariable","value":"O"},
+  {"type":"Operator","value":"=."},
+  {"type":"NameFunction","value":"revO"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$\u003cinfixish\u003e"},
+  {"type":"Punctuation","value":")\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameVariable","value":"code"},
+  {"type":"Operator","value":"="},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringRegex","value":"A"},
+  {"type":"Operator","value":".."},
+  {"type":"LiteralStringRegex","value":"Z"},
+  {"type":"Punctuation","value":"]\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"pod_balanced_braces"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"nqp::chars"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$\u003cstart\u003e"},
+  {"type":"Punctuation","value":")"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"=="},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*POD_ANGLE_COUNT"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"||"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*POD_ANGLE_COUNT"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":"\u003c"},
+  {"type":"Text","value":" "},
+  {"type":"LiteralNumberInteger","value":"0"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
+  {"type":"Punctuation","value":"}"},
+  {"type":"Text","value":"\n\n    "},
+  {"type":"Keyword","value":"token"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"routine_declarator"},
+  {"type":"Punctuation","value":":"},
+  {"type":"NameAttribute","value":"sym"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"LiteralString","value":"macro"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Operator","value":":"},
+  {"type":"KeywordDeclaration","value":"my"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*LINE_NO"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":":="},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"HLL::Compiler"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"lineof"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameBuiltin","value":"orig"},
+  {"type":"Punctuation","value":"()"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameBuiltin","value":"from"},
+  {"type":"Punctuation","value":"()"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":":"},
+  {"type":"LiteralString","value":"cache"},
+  {"type":"Punctuation","value":"("},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Punctuation","value":"));"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"!!"},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameFunction","value":"nqp::rebless"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"slang_grammar"},
+  {"type":"Punctuation","value":"('"},
+  {"type":"LiteralStringSingle","value":"MAIN"},
+  {"type":"Punctuation","value":"'));"},
+  {"type":"Text","value":" "},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}\u003e"},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"sym"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"section"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"end_keyword"},
   {"type":"Punctuation","value":"\u003e"},
-  {"type":"Operator","value":"*"},
   {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"macro_def"},
+  {"type":"Punctuation","value":"()\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
   {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
+  {"type":"Text","value":"\n\n    "},
   {"type":"Keyword","value":"token"},
   {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"section"},
+  {"type":"NameFunction","value":"routine_declarator"},
+  {"type":"Punctuation","value":":"},
+  {"type":"NameAttribute","value":"sym"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"LiteralString","value":"macro"},
+  {"type":"Punctuation","value":"\u003e"},
   {"type":"Text","value":" "},
   {"type":"Punctuation","value":"{"},
-  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringRegex","value":"\n        "},
+  {"type":"Operator","value":":"},
+  {"type":"KeywordDeclaration","value":"my"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*LINE_NO"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":":="},
+  {"type":"Text","value":" "},
+  {"type":"Name","value":"HLL::Compiler"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"lineof"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameBuiltin","value":"orig"},
+  {"type":"Punctuation","value":"()"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Operator","value":"."},
+  {"type":"NameBuiltin","value":"from"},
+  {"type":"Punctuation","value":"()"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":":"},
+  {"type":"LiteralString","value":"cache"},
+  {"type":"Punctuation","value":"("},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Punctuation","value":"));"},
+  {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"header"},
+  {"type":"NameFunction","value":"sym"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"block"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"end_keyword"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"macro_def"},
+  {"type":"Punctuation","value":"()\u003e"},
+  {"type":"LiteralStringRegex","value":"\n    "},
   {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
+  {"type":"Text","value":"\n\n    "},
   {"type":"Keyword","value":"token"},
   {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"header"},
+  {"type":"NameFunction","value":"integer"},
   {"type":"Text","value":" "},
   {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringRegex","value":"\n       "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"!!"},
+  {"type":"OperatorWord","value":"before"},
   {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"['"},
+  {"type":"LiteralStringSingle","value":"."},
   {"type":"Punctuation","value":"'"},
-  {"type":"LiteralStringSingle","value":"["},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"OperatorWord","value":"before"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"LiteralStringEscape","value":"\\s"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":","},
   {"type":"Punctuation","value":"'"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Operator","value":"~"},
+  {"type":"Operator","value":"|"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"'"},
-  {"type":"LiteralStringSingle","value":"]"},
+  {"type":"LiteralStringSingle","value":"="},
   {"type":"Punctuation","value":"'"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"LiteralStringEscape","value":"\\w"},
-  {"type":"Operator","value":"+"},
+  {"type":"Operator","value":"|"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"LiteralStringEscape","value":"\\n"},
-  {"type":"Operator","value":"+"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":":"},
+  {"type":"Punctuation","value":"'"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
-  {"type":"Keyword","value":"token"},
-  {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"block"},
-  {"type":"Text","value":" "},
-  {"type":"Punctuation","value":"{"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"!"},
+  {"type":"OperatorWord","value":"before"},
+  {"type":"LiteralStringRegex","value":"  "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameFunction","value":"coloncircumfix"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"[\u003c"},
-  {"type":"NameFunction","value":"pair"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"NameVariable","value":"OPER"},
+  {"type":"Operator","value":"="},
+  {"type":"NameFunction","value":"prefix"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Operator","value":"|"},
+  {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"comment"},
-  {"type":"Punctuation","value":"\u003e]"},
-  {"type":"Operator","value":"*"},
+  {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
-  {"type":"Keyword","value":"rule"},
-  {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"pair"},
-  {"type":"Text","value":" "},
-  {"type":"Punctuation","value":"{"},
+  {"type":"Operator","value":"|"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"key"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"terminator"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"'"},
-  {"type":"LiteralStringSingle","value":"="},
-  {"type":"Punctuation","value":"'"},
+  {"type":"Operator","value":"|"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"NameEntity","value":"$"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameFunction","value":"value"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
-  {"type":"Keyword","value":"token"},
-  {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"comment"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"typed_sorry"},
+  {"type":"Punctuation","value":":"},
   {"type":"Text","value":" "},
-  {"type":"Punctuation","value":"{"},
-  {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"'"},
-  {"type":"LiteralStringSingle","value":";"},
   {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"X::Syntax::Number::IllegalDecimal"},
+  {"type":"Punctuation","value":"'\u003e]"},
+  {"type":"Operator","value":"?"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"LiteralStringEscape","value":"\\N"},
-  {"type":"Operator","value":"*"},
+  {"type":"Punctuation","value":"\u003e"},
+  {"type":"LiteralStringRegex","value":"\n       "},
+  {"type":"Punctuation","value":"["},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"LiteralStringEscape","value":"\\n"},
-  {"type":"Operator","value":"+"},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"OperatorWord","value":"before"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
-  {"type":"Keyword","value":"token"},
-  {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"key"},
-  {"type":"Text","value":" "},
-  {"type":"Punctuation","value":"{"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"_"},
+  {"type":"Punctuation","value":"'"},
   {"type":"LiteralStringRegex","value":" "},
-  {"type":"LiteralStringEscape","value":"\\w"},
+  {"type":"Punctuation","value":"'"},
+  {"type":"LiteralStringSingle","value":"_"},
+  {"type":"Punctuation","value":"'"},
   {"type":"Operator","value":"+"},
-  {"type":"LiteralStringRegex","value":" "},
-  {"type":"Punctuation","value":"}"},
-  {"type":"Text","value":"\n    "},
-  {"type":"Keyword","value":"token"},
-  {"type":"Text","value":" "},
-  {"type":"NameFunction","value":"value"},
-  {"type":"Text","value":" "},
-  {"type":"Punctuation","value":"{"},
+  {"type":"LiteralStringEscape","value":"\\d"},
+  {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"Operator","value":"-"},
-  {"type":"Punctuation","value":"["},
-  {"type":"LiteralStringEscape","value":"\\n"},
-  {"type":"LiteralStringRegex","value":" ;"},
-  {"type":"Punctuation","value":"]\u003e"},
-  {"type":"Operator","value":"+"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"sorry"},
+  {"type":"Punctuation","value":":"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"\""},
+  {"type":"LiteralStringDouble","value":"Only isolated underscores are allowed inside numbers"},
+  {"type":"Punctuation","value":"\"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"]"},
+  {"type":"Operator","value":"?"},
+  {"type":"LiteralStringRegex","value":"\n    "},
   {"type":"Punctuation","value":"}"},
   {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":"}"},
   {"type":"Text","value":"\n\n"},
-  {"type":"Keyword","value":"my"},
-  {"type":"Text","value":" "},
-  {"type":"NameVariable","value":"$match"},
-  {"type":"Text","value":" "},
-  {"type":"Operator","value":"="},
-  {"type":"Text","value":" "},
-  {"type":"Name","value":"INIParser"},
-  {"type":"Operator","value":"."},
-  {"type":"NameBuiltin","value":"parse"},
-  {"type":"Operator","value":":"},
-  {"type":"Text","value":" "},
-  {"type":"Keyword","value":"q"},
-  {"type":"LiteralStringAffix","value":":to"},
-  {"type":"Punctuation","value":"/END/;"},
-  {"type":"LiteralString","value":"\n; Comment\nkey1=value1\nkey2 = value2\n\n; Section 1\n[section1]\nkey3=value3\n"},
-  {"type":"Punctuation","value":"END"},
-  {"type":"Text","value":"\n\n\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
   {"type":"NameVariable","value":"$match"},
@@ -1234,7 +2056,7 @@
   {"type":"Punctuation","value":"\""},
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameBuiltin","value":"alnum"},
+  {"type":"NameFunction","value":"alnum"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c:"},
@@ -1363,7 +2185,8 @@
   {"type":"Text","value":" "},
   {"type":"Operator","value":"+"},
   {"type":"Text","value":" "},
-  {"type":"Punctuation","value":":!"},
+  {"type":"Punctuation","value":":"},
+  {"type":"Operator","value":"!"},
   {"type":"NameAttribute","value":"N"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":"\n        "},
@@ -1460,7 +2283,8 @@
   {"type":"Operator","value":"|"},
   {"type":"OperatorWord","value":"w"},
   {"type":"Punctuation","value":"\u003e"},
-  {"type":"LiteralStringRegex","value":"\\-"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"-"},
   {"type":"Punctuation","value":"\u003c"},
   {"type":"Operator","value":"|"},
   {"type":"OperatorWord","value":"w"},
@@ -1496,7 +2320,7 @@
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"\u003c"},
   {"type":"Operator","value":"?"},
-  {"type":"NameBuiltin","value":"alnum"},
+  {"type":"NameFunction","value":"alnum"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":" "},
   {"type":"LiteralStringEscape","value":"\\d"},
@@ -1694,6 +2518,46 @@
   {"type":"LiteralStringRegex","value":" "},
   {"type":"Punctuation","value":"]"},
   {"type":"LiteralStringRegex","value":"\n\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"!!"},
+  {"type":"Punctuation","value":"{"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*LANG"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":":="},
+  {"type":"Text","value":" "},
+  {"type":"NameVariableGlobal","value":"$*LEAF"},
+  {"type":"Text","value":" "},
+  {"type":"Operator","value":":="},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"$/"},
+  {"type":"Operator","value":"."},
+  {"type":"NameFunction","value":"clone_braid_from"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameBuiltin","value":"self"},
+  {"type":"Punctuation","value":");"},
+  {"type":"Text","value":" "},
+  {"type":"LiteralNumberInteger","value":"1"},
+  {"type":"Text","value":" "},
+  {"type":"Punctuation","value":"}\u003e"},
+  {"type":"LiteralStringRegex","value":"\n\n        "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"?"},
+  {"type":"OperatorWord","value":"before"},
+  {"type":"LiteralStringRegex","value":" "},
+  {"type":"Punctuation","value":"\u003c"},
+  {"type":"Operator","value":"."},
+  {"type":"Punctuation","value":"["},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":")"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"]"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"}"},
+  {"type":"Punctuation","value":"]\u003e\u003e"},
+  {"type":"LiteralStringRegex","value":"\n\n        "},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringRegex","value":"/\n\n        "},
   {"type":"NameVariable","value":"$\u003cstring\u003e"},
   {"type":"Operator","value":"="},
   {"type":"Punctuation","value":"("},
@@ -1850,7 +2714,7 @@
   {"type":"Operator","value":"="},
   {"type":"Punctuation","value":"\u003c"},
   {"type":"Operator","value":"."},
-  {"type":"NameBuiltin","value":"ident"},
+  {"type":"NameFunction","value":"ident"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c"},
@@ -1859,7 +2723,8 @@
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameVariable","value":"\u0026named-regex"},
+  {"type":"Operator","value":"\u0026"},
+  {"type":"NameFunction","value":"named-regex"},
   {"type":"Punctuation","value":"\u003e"},
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Punctuation","value":"\u003c"},
@@ -1966,6 +2831,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"},
@@ -1995,7 +2865,8 @@
   {"type":"Operator","value":"=\u003e"},
   {"type":"Text","value":" "},
   {"type":"Name","value":"something"},
-  {"type":"Text","value":",\n    "},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n    "},
   {"type":"LiteralString","value":"qq"},
   {"type":"Text","value":" "},
   {"type":"Operator","value":"=\u003e"},
@@ -2003,7 +2874,8 @@
   {"type":"Punctuation","value":"'"},
   {"type":"LiteralStringSingle","value":"something"},
   {"type":"Punctuation","value":"'"},
-  {"type":"Text","value":",\n    "},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n    "},
   {"type":"Punctuation","value":":"},
   {"type":"LiteralNumberInteger","value":"23"},
   {"type":"LiteralString","value":"year"},
@@ -2014,12 +2886,14 @@
   {"type":"Operator","value":"=\u003e"},
   {"type":"Text","value":" "},
   {"type":"NameVariable","value":"$test"},
-  {"type":"Text","value":",\n    "},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n    "},
   {"type":"Punctuation","value":":"},
   {"type":"LiteralString","value":"yes"},
   {"type":"Operator","value":","},
   {"type":"Text","value":"\n    "},
-  {"type":"Punctuation","value":":!"},
+  {"type":"Punctuation","value":":"},
+  {"type":"Operator","value":"!"},
   {"type":"LiteralString","value":"yes"},
   {"type":"Operator","value":","},
   {"type":"Text","value":"\n    "},
@@ -2030,7 +2904,8 @@
   {"type":"Operator","value":"=\u003e"},
   {"type":"Text","value":" "},
   {"type":"NameVariable","value":"$test"},
-  {"type":"Text","value":",\n"},
+  {"type":"Operator","value":","},
+  {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":");"},
   {"type":"Text","value":"\n\n"},
   {"type":"Keyword","value":"my"},
@@ -2194,10 +3069,7 @@
   {"type":"Punctuation","value":"｢｢"},
   {"type":"LiteralString","value":"some "},
   {"type":"NameVariable","value":"@array"},
-  {"type":"Operator","value":"["},
-  {"type":"LiteralNumberInteger","value":"2"},
-  {"type":"Operator","value":"]"},
-  {"type":"LiteralString","value":" 'some text' { 2 + 1 } text"},
+  {"type":"LiteralString","value":"[2] 'some text' { 2 + 1 } text"},
   {"type":"Punctuation","value":"｣｣;"},
   {"type":"Text","value":"\n"},
   {"type":"NameBuiltin","value":"say"},
@@ -2256,9 +3128,8 @@
   {"type":"Punctuation","value":"'}"},
   {"type":"LiteralStringDouble","value":" "},
   {"type":"NameVariable","value":"%h"},
-  {"type":"Punctuation","value":"\u003c"},
-  {"type":"LiteralString","value":"one"},
-  {"type":"Punctuation","value":"\u003e｣;"},
+  {"type":"LiteralStringDouble","value":"\u003cone\u003e"},
+  {"type":"Punctuation","value":"｣;"},
   {"type":"Text","value":"\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
@@ -2271,11 +3142,8 @@
   {"type":"Punctuation","value":"'}"},
   {"type":"LiteralStringDouble","value":" "},
   {"type":"NameVariable","value":"%h"},
-  {"type":"Punctuation","value":"\u003c"},
-  {"type":"LiteralString","value":"one"},
-  {"type":"Punctuation","value":"\u003e\u003c"},
-  {"type":"LiteralString","value":"two"},
-  {"type":"Punctuation","value":"\u003e｣;"},
+  {"type":"LiteralStringDouble","value":"\u003cone\u003e\u003ctwo\u003e"},
+  {"type":"Punctuation","value":"｣;"},
   {"type":"Text","value":"\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
@@ -2288,9 +3156,8 @@
   {"type":"Punctuation","value":"'}"},
   {"type":"LiteralStringDouble","value":" "},
   {"type":"NameVariable","value":"%h"},
-  {"type":"Punctuation","value":"\u003c\u003c"},
-  {"type":"LiteralStringDouble","value":"one"},
-  {"type":"Punctuation","value":"\u003e\u003e｣;"},
+  {"type":"LiteralStringDouble","value":"\u003c\u003cone\u003e\u003e"},
+  {"type":"Punctuation","value":"｣;"},
   {"type":"Text","value":"\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
@@ -2303,9 +3170,8 @@
   {"type":"Punctuation","value":"'}"},
   {"type":"LiteralStringDouble","value":" "},
   {"type":"NameVariable","value":"%h"},
-  {"type":"Punctuation","value":"«"},
-  {"type":"LiteralStringDouble","value":"one"},
-  {"type":"Punctuation","value":"»｣;"},
+  {"type":"LiteralStringDouble","value":"«one»"},
+  {"type":"Punctuation","value":"｣;"},
   {"type":"Text","value":"\n"},
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
@@ -2327,7 +3193,9 @@
   {"type":"Punctuation","value":"';"},
   {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":"'"},
-  {"type":"LiteralStringSingle","value":"somes\\' testing"},
+  {"type":"LiteralStringSingle","value":"somes"},
+  {"type":"LiteralStringEscape","value":"\\"},
+  {"type":"LiteralStringSingle","value":"' testing"},
   {"type":"Punctuation","value":"';"},
   {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":"\""},
@@ -2379,15 +3247,32 @@
   {"type":"Punctuation","value":"\";"},
   {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":"\""},
+  {"type":"LiteralStringDouble","value":"some func() testing"},
+  {"type":"Punctuation","value":"\";"},
+  {"type":"Text","value":"\n"},
+  {"type":"Punctuation","value":"\""},
+  {"type":"LiteralStringDouble","value":"some func:some\u003cadverb\u003e() testing"},
+  {"type":"Punctuation","value":"\";"},
+  {"type":"Text","value":"\n"},
+  {"type":"Punctuation","value":"\""},
   {"type":"LiteralStringDouble","value":"some "},
-  {"type":"NameFunction","value":"func"},
+  {"type":"NameVariable","value":"\u0026func"},
   {"type":"Punctuation","value":"()"},
   {"type":"LiteralStringDouble","value":" testing"},
   {"type":"Punctuation","value":"\";"},
   {"type":"Text","value":"\n"},
   {"type":"Punctuation","value":"\""},
   {"type":"LiteralStringDouble","value":"some "},
-  {"type":"NameFunction","value":"func"},
+  {"type":"NameVariable","value":"\u0026func"},
+  {"type":"Punctuation","value":"("},
+  {"type":"NameVariable","value":"$test"},
+  {"type":"Punctuation","value":")"},
+  {"type":"LiteralStringDouble","value":" testing"},
+  {"type":"Punctuation","value":"\";"},
+  {"type":"Text","value":"\n"},
+  {"type":"Punctuation","value":"\""},
+  {"type":"LiteralStringDouble","value":"some "},
+  {"type":"NameVariable","value":"\u0026func"},
   {"type":"Punctuation","value":":"},
   {"type":"NameAttribute","value":"some"},
   {"type":"Punctuation","value":"\u003c"},
@@ -2399,12 +3284,7 @@
   {"type":"NameBuiltin","value":"say"},
   {"type":"Text","value":" "},
   {"type":"Punctuation","value":"\""},
-  {"type":"LiteralStringDouble","value":"Something "},
-  {"type":"NameFunction","value":"foo"},
-  {"type":"Punctuation","value":"("},
-  {"type":"LiteralNumberInteger","value":"2"},
-  {"type":"Punctuation","value":")"},
-  {"type":"LiteralStringDouble","value":" "},
+  {"type":"LiteralStringDouble","value":"Something foo(2) "},
   {"type":"NameVariable","value":"$a"},
   {"type":"Operator","value":"."},
   {"type":"NameFunction","value":"succ"},
@@ -2525,7 +3405,7 @@
   {"type":"NameVariable","value":"$\u003cvar\u003e"},
   {"type":"Operator","value":"="},
   {"type":"Punctuation","value":"\u003c"},
-  {"type":"NameBuiltin","value":"alnum"},
+  {"type":"NameFunction","value":"alnum"},
   {"type":"Punctuation","value":"\u003e/"},
   {"type":"LiteralStringDouble","value":"a "},
   {"type":"NameVariable","value":"$0"},
@@ -2778,8 +3658,8 @@
   {"type":"LiteralStringRegex","value":"\n        "},
   {"type":"Operator","value":":"},
   {"type":"KeywordDeclaration","value":"my"},
-  {"type":"Text","value":" \\"},
-  {"type":"Name","value":"var"},
+  {"type":"Text","value":" "},
+  {"type":"NameVariable","value":"\\var"},
   {"type":"Text","value":" "},
   {"type":"Operator","value":"="},
   {"type":"Text","value":" "},
@@ -2978,7 +3858,7 @@
   {"type":"Punctuation","value":"[["},
   {"type":"LiteralStringDoc","value":"\nmultiline pod declaration]\n"},
   {"type":"Punctuation","value":"]]"},
-  {"type":"Text","value":"\n\n"},
+  {"type":"Text","value":"\n"},
   {"type":"Keyword","value":"grammar"},
   {"type":"Text","value":" "},
   {"type":"NameClass","value":"Calculator"},