the text value.
This means that FOREACH_Attr will iterate over the text value.
Compare with TEXT_ATTRIBUTE_NAME if you explicitly don't want
that.
This is simpler; an XNode branches out in two places--attributes
and children--instead of three.
It also means that nodes without any text data actually don't
have any text data--the attribute simply doesn't exist. The
*TextValue functions are also no longer needed, though some
are left in now for compatibility (and maybe convenience).
Each actor type needs to evaluate attributes; only a few do. Strings
are handled with the "@foo()" notation.
Instead, after loading an XML file for loading as an actor,
precompile all XML attributes as Lua expressions.
The primary difference to code is:
- previously, Attr="string" would act as a string if it was being
read as one. Now, specify Attr='"string"'. Attr="@string" is
a shorthand. (note that @strings will not be parsed as Lua
strings, so can not use Lua escape characters)
- previously, Attr="@func()" would evaluate func(), and the value
of the attribute would be the return value of the function. This
was only supported for a few attributes. Now, say Attr="func()",
and this will work for all fields.
- Attributes of other types are unchanged, except that all attributes
may be Lua expressions, eg. Width="SCREEN_WIDTH".
- Attributes names ending with "Command" are special, like metrics.
Prefix "%" to disable this.
This brings XML handling in line with metric handling. (This is an intermediary
step; I have another idea that follows from this that should eliminate the annoying
"'foo'"/"@foo".)
When used with a debug CRT library, isspace will display a CRT assert if passed a parameter that isn't EOF or in the range of 0 through 0xFF.
We don't care about EOF, so just check for positive values. (I'm not sure why casting didn't work and I don't have a windows machine to test with anyway.)