Re: Lua syntax ambiguity
Sean Conner <[email protected]>
| Newsgroups | gmane.comp.lang.lua.general |
|---|---|
| Message-ID | <[email protected]> |
It was thus said that the Great 'Martin Eden' via lua-l once stated:
>
> But implementing it properly (emit only required separators) looks
> hard for me. Node serializers have no information about surroundings,
> and their caller don't know what serializer will emit.
>
> F.e. "t={['a']=1}": we emitted "[", we know we are just opened index.
> But to what "a" will be serialized is not our business. Maybe it will
> be ""a"", maybe "'a'", maybe "[[a]]", maybe '\097', maybe
> "(function()return 'a'end)()"...
What are you doing that requires this level of detail?
That aside, it sounds like you have some form of AST that you want to turn
into textual Lua (possibly with a minimum of extra space for some reason).
Per your example:
t={['a']=1}
At some point you have a string. By what criteria are you using to write
a string as [[...]]? Why not "..."? Or '...'? Avoid the issue entirely.
-spc
--
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20260818183627.GB13121%40brevard.conman.org.