-
Notifications
You must be signed in to change notification settings - Fork 8
Parser protocol #39
Comments
Edited to add the |
Hmmm, shouldn't that be the other way around? The |
How is that the other way around? Sure I didn't add it to the init (because I feel that handler should be optional, thus the default implementation for it) but the way I've written it it's stiff the main app which provides the warningHandler to the parser as you describe, right? (sorry, I edited the comment once again I forgot to add class FooParser: Parser { … }
let p = FooParser(options: [])
p.warningHandler = { (message, file, line) in print("\(file):\(line): warning: \(message)" }
p.parseFile(at: somePath)
let ctx = p.stencilContext() |
A reason to pass the |
We should unify the interface of the parsers to one common protocol, that they should all support. This will be needed when we eventually want to support a plugin system.
I propose something like the following:
Missing from this is a way to pass parameters (not template parameters) to the parser implementations. Maybe an
options
dictionary?The text was updated successfully, but these errors were encountered: