csyonghe / Spire

Other
174 stars 22 forks source link

Unify declaration parsing #76

Closed tangent-vector closed 7 years ago

tangent-vector commented 7 years ago

(Note: this PR builds on the earlier one for parser error recovery)

The basic idea here is to funnel all parsing of declarations through one place, so that the parser no longer enforces any restrictions on where declarations can appear, or how they can nest. As a result, it is now possible to syntactically represent things like:

Actually making any of those cases work is, of course, work for another day.

Probably the most contentious bits of this PR are:

tangent-vector commented 7 years ago

Never mind. There is some kind of memory corruption bug here. I need to fix that first.