> The lexical grammars of Python and Haskell are not regular. What does that
> mean, and why aren’t they?
Regular languages can be parsed with an FSM, but Python and Haskell's grammars
more context than that to be determined.
> Aside from separating tokens—distinguishing `print foo` from
> `printfoo`—spaces aren’t used for much in most languages. However, in a
> couple of dark corners, a space does affect how code is parsed in
> CoffeeScript, Ruby, and the C preprocessor. Where and what effect does it
> have in each of those languages?
Spaces do matter for the closing of heredocs in Ruby...
> Our scanner here, like most, discards comments and whitespace since those
> aren’t needed by the parser. Why might you want to write a scanner that does
> not discard those? What would it be useful for?
Formatting or documentation generation?
FossilOrigin-Name: 5738a38b8f15d1aca61212966ff990de59a03502f183a7400bf4f2ea14ae5af6