kjs grammar change
Bernd Buschinski
b.buschinski at googlemail.com
Fri Mar 2 00:53:32 GMT 2012
new grammar.y diff
Added to Keywords:
+ NULLTOKEN
+ TRUETOKEN
+ FALSETOKEN
+ ELSE
Removed from Keywords:
- RESERVED
That makes all tests with "enum, export, extends, super"-reserved keywords
fail for propertynames, memberexpression, callexpression.
I do it on purpose, because every reserved keyword would be replaced with
"reserved". For cases like:
var tokenCodes = {};
tokenCodes.enum = 0; // tokenCodes.reserved = 0;
it would not matter.
But for something like:
var tokenCodes = {
enum : 0 // reserved : 0
};
var arr = [
'enum'
];
if (tokenCodes[arr[0]] !== 0) {
return false;
};
return true;
it would always fail, which would make laaaater kjs debugging for this case
more difficult.
If you disagree please tell me :)
And again it would also be possible to give the reserved keywords its own
name/value instead of RESERVED, if you prefer this way, tell me :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grammar.diff
Type: text/x-patch
Size: 5578 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20120302/1d8d4b79/attachment.bin>
More information about the kfm-devel
mailing list