# Can child/sub tokens appear in the parse tree?

**URL:** https://discuss.codemirror.net/t/can-child-sub-tokens-appear-in-the-parse-tree/8033
**Category:** Uncategorized
**Created:** [March 24, 2024, 6:40pm UTC](https://discuss.codemirror.net/t/can-child-sub-tokens-appear-in-the-parse-tree/8033 "2024-03-24T18:40:01Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![AlexErrant](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/alexerrant/32/4287_2.png) [@AlexErrant](https://discuss.codemirror.net/u/AlexErrant)
#### Post date: [June 28, 2024, 2:49pm UTC](https://discuss.codemirror.net/t/can-child-sub-tokens-appear-in-the-parse-tree/8033/3 "2024-06-28T14:49:33Z")

</div>

If you’re desperate/creative you can used the `parseMixed` feature. First, create your base grammar which contains `Either`. Then define a second grammar that can parse the contents of Either; in this case `Number` and `Letter`. Finally, do something like

```auto
baseParser.configure({
	wrap: parseMixed((node) =>
		node.type.is(Either) ? { parser: eitherParser } : null,
	),
})

```

There is extra complexity when dealing with a mixed language, and it isn’t as powerful as an integrated grammar, but hey you’re desperate 🙂

---

_[View the full topic](https://discuss.codemirror.net/t/can-child-sub-tokens-appear-in-the-parse-tree/8033)._
