To make it more clear that the Pattern data structure is internal to this implementation, would it make sense to rename the fields of syntax nodes? E.g. {type: "var", name: "userName"} could become {_type: "var", _name: "userName"} or {$$type: "var", $$name: "userName"}.