Website Offer, and some rambling on Walnut
Unknown W. Brackets
unknown at simplemachines.org
Tue Jan 22 16:43:27 PST 2008
>From memory, not looking at the spec, aren't code blocks always proceeded by function () or similar?
Example:
var f = function ()
{
label:
"hello"
}
var o = {
label: "hello"
};
I may be wrong. But that's what I remember...
-[Unknown]
Daniel Lewis Wrote:
>
> Well, I haven't heard a word. I guess he figures he'll keep doing it himself.
>
> Last night I hacked on Walnut some more; removed the block allocator crap, reorganized the parser file, made it handle for() and automatic semicolon insertion, as well as escape characters in strings.
>
> Not much left to do before the parser is done; some tree shuffling and a few statements.
>
> A question; how does one differentiate between an object literal and a code block in ECMAScript?
>
> I find the following:
>
> { bob: "hello" }
>
> Is this:
> a) an object
> b) a code block with a label, bob, referring to a statement only containing a string?
>
> I can create more elaborate examples which could be either, and to be honest the best I can think to do is parse it as an Object literal unless we get an invalid token?
More information about the Digitalmars-d
mailing list