|
Hi,Just a question: why the DSL has side effects on the upper scope?I understand that the idea is to use the keywords without scoping. I tend not to do this anymore rather using scope: that allows having a local context. This is not so unusual with XML schemas, xs:...If I don't need these contexts, I still scope the language and use local var to unscope rather than using env.local mydsl= require'my.dsl.grammar'local kw1, kw2 = mydsl.kw1, mydsl.kw2 -- easy copy/pasteHow your grammar looks like?
From: Marc LepageSent: mardi 20 mai 2014 07:32To: Lua mailing listReply To: Lua mailing listSubject: Loading DSL DataHi, looking for some thoughts on loading DSL style data.I have it working but would like to swap out the environment when doing so, so it doesn't trample on the global environment.