andreineculau/snowcrash — pull request #1 by andreineculau (2014-05-10 09:13:00+00:00)
Title: Patch 84

I'd have gone a different way - just creating references, i.e. mapping the semantics of markdown.
And then resolving those references only at the end of the blueprint parsing. On the line of lexing, parsing, validating.

But I want to keep this exercise limited in its footprint, so my approach is

- DONE amended the ResourceModel (Payload) with lazyReferences - a pointer collection of Payloads
- DONE a resourceModel is added to parser.symbolTable.resourceModels if one is not found, and should keep a pointer to payloads that reference it
- PLACEHOLDER when a resource model is about to be re-defined, check if it has any lazyReferences and resolve them, instead of failing with "already defined"
- TODO check for resourceModels with non-empty lazyReferences and throw errors for undefined symbols

/ping @zdne