Unfortunately, parsing is an inherently type unstable task.
If you think about it, what parsing is doing is turning an unstructured piece of data (e.g. a String or a Vector{UInt8}) into a structured piece of data, i.e. typed data. So inherently, you have a mapping of String to multiple different potential output types, the definition of type instability. You can alleviate it by hiding the type instability from the compiler by having a single type represent your parsed+typed token and more or less doing a version of dispatch yourself (either via branching or some other approach, e.g. with FunctionWrappers.jl). The cleanest version of this I’ve seen in julia so far is how parsing is done in the upcoming JuliaSyntax.