- Added ZCCCompiler class as a place to generate IR and symbols from an
AST. Right now, all it does is simplify constant expressions into
constant values.
- Do type promotion on the AST where appropriate.
- Added true and false tokens to the parser driver.
- PType::FindConversion() can find a path to convert one type to another.
This is completely generic and can handle any number of conversion
functions.
- Since the VM doesn't directly support the GT, GTEQ, and NEQ comparisons,
don't use them in the trees either. Instead, wrap them as LTEQ, LT, and
EQEQ inside a BoolNot operator.
- I can't believe I completely forgot to let the parser handle true and
false literals.
- Consolidate all the %include blocks in zcc-parse.lemon into a single
one, because Lemon all of a sudden decided it didn't like me having more
than one in the grammar file.
- Added a PBool type to represent boolean values with.
- This conversion has behavior similar to %g: It automatically behaves like
%f or %e based on the number of output characters. However, unlike %g,
this decision is also based on what will produce the smallest string
without truncating the output. The precision field (the * in %.*f) is
ignored. Converting a double to text with %H and then back to a double
should be lossless.
- Added TypeVoid for statements, which produce no type.
- Added TypeError for expressions whose arguments are incompatible.
- Pointers now derive from PBasicType instead of PInt. Since they have their own register sets in the VM, this seems to make more sense than treating them as integers.
- Since the tokenizer never gives the parser negative numbers but always a
unary minus followed by a positive number, it seems reasonable to make
the parser smart enough to turn these into negative constants without
generating extra tree nodes.
- And since we're doing it for unary -, we might as well do it for unary +
as well and avoid extra nodes when we know we don't need them.
- For an enum like this:
enum { value1 = SOME_NUM*2, value2 };
Generate an increment expression for value2 of the form
(add (id value1) 1)
and not
(add (* SOME_NUM 2) 1)
- Instead of representating enumeration values with a special node type,
use the same ZCC_ConstantDef nodes that const_def produces. These are
created at the same scope as the ZCC_Enum, rather than being contained
entirely within it. To mark the end of enums for a single instance of
ZCC_Enum, a ZCC_EnumTerminator node is now appended to the chain of
ZCC_ConstantDefs.
- Constants can be strings, but the existing PSymbolConst couldn't handle
them. The old PSymbolConst is now PSymbolConstNumeric, and the new
PSymbolConst is a now a baseclass for it and PSymbolConstString.
- Instead of having ZCC_ExprString, ZCC_ExprInt, and ZCC_ExprFloat,
just use a single ZCC_ExprConstant. It should simplify type
promotion and constant folding in the future.
- Constants can fill out the type field right away. Other expressions will need
to wait until a later pass, after names have been resolved, so they get
initialized to NULL.
- A texture defined in TEXTUREx without any patches isn't necessarily an
error, so accept. This also means they shouldn't be used for determining
if a TEXTURE directory belongs to Strife instead of Doom.
- When P_OpenMapData() is called by P_CheckMapData(), we don't actually
care if any required lumps are missing. This just means it isn't a valid
map, so don't abort with I_Error().
- Fixed: When an ACS string pool was read from a savegame, FirstFreeEntry
would not be updatedt, except by the Clear() function. This left FirstFreeEntry
at 0, which meant the next string added to the pool would always go in
slot 0, whether it was free or not.
- If a player is spying through another player, CheckPlayerCamera will
return the TID of the player you are "spying", but as coopspy isn't a
net command, this wont be reflected by all nodes. So to fix this,
CheckPlayerCamera now returns -1 if a player's camera is that of any
player at all. (thanks edward850)
- Added I_GetLongPathName(). It wraps the Win32 API's GetLongPathName().
DArgs::CollectFiles() now calls this for every argument it processes, so
any arguments passed using short file names will be converted to long
file names. This is mainly of interest so that savegames will never
record the short file name, which can change based on what else is in
the directory.