1 then join(altBranchesOf (contentOf t)#0, altBranchesOf (contentOf
2 else {t})
3
4-- a MetavarKind<Kind>( <name placeholder> ) call produced for a typed
5-- returns the named kind, or null when t is not such a call
6typedKindOf = t -> (
7 if delimiterOf t === spaceOperator and #contentOf t == 2 and isLea
8 and match("^" | metavarKindPrefix, leftOf (contentOf t)#0)
9 then substring(#metavarKindPrefix, leftOf (contentOf t)#0))
10
11-- convert pre-scanned placeholders into nodes: metavar leaves -> Meta
12-- calls -> Metavar with a kind, and RepPlus/RepStar calls -> Repetiti
13markNodes = t -> (
14 if isLeaf t then (
15 if leftOf t =!= null and match("^" | metavarPlaceholderPrefix,
16 then metavarNode substring(#metavarPlaceholderPrefix, leftOf t
17 else if typedKindOf t =!= null then (
18 kind := typedKindOf t;