I'm going to bail on this for now, I found some bugs in this approach (because we use "text" as an attribute type and it's also a class name). I think it would be better to deal with the issue of more complex types in LZX attribute declarations in a more complete manner.
I had better just revert Max's change to menu and menuitem, and figure out how to document them manually. On Thu, May 8, 2008 at 9:39 AM, Henry Minsky <[EMAIL PROTECTED]> wrote: > Change 20080508-hqm-6 by [EMAIL PROTECTED] on 2008-05-08 09:33:21 EDT > in /Users/hqm/openlaszlo/trunk5 > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: accept LZX tag class-names as types for attributes > > New Features: > > Bugs Fixed: > > Technical Reviewer: ptw > QA Reviewer: (pending) > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Details: > > Max recently changed menu.lzx to have an attribute which is of type > "command", in order to > fix the docs. > > This patch makes the tag compiler accept LZX class tag names as valid types > for attributes. It > treats them exactly as if they were of type "expression". So it isn't > really doing proper sub-type > checking, and it isn't emitting the type in the javascript attribute > declaration, but it at least > lets people document their LZX code as to the expected data type of an > attribute. > > Unfortunately, this will not support our new forward-reference ability for > class names; if you set > an attribtue to a type which is a class name which has not yet been > lexically defined, it will > complain about unknown type. To get that to work we'd have to make one pass > just defining class names, > and then another pass looking at their attribute types. > > > > Tests: > > lztest > smokecheck > examples/components/menu-example.lzx > ant runlzunit > > Files: > M WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassCompiler.java > M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java > > Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20080508-hqm-6.tar > -- Henry Minsky Software Architect [EMAIL PROTECTED]
