Fixed a problem with sizeof(explicit type) not working.
Also fixed a problem with parsing some types in expressions. Issue #39 git-svn-id: http://picoc.googlecode.com/svn/trunk@390 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
09b2af4d16
commit
97ad53a6b2
|
@ -4,7 +4,7 @@
|
|||
/* whether evaluation is left to right for a given precedence level */
|
||||
#define IS_LEFT_TO_RIGHT(p) ((p) != 2 && (p) != 3 && (p) != 14)
|
||||
#define BRACKET_PRECEDENCE 20
|
||||
#define IS_TYPE_TOKEN(t) ((t) >= TokenIntType && (t) <= TokenEnumType)
|
||||
#define IS_TYPE_TOKEN(t) ((t) >= TokenIntType && (t) <= TokenUnsignedType)
|
||||
|
||||
#ifdef DEBUG_EXPRESSIONS
|
||||
#define debugf printf
|
||||
|
@ -924,7 +924,7 @@ int ExpressionParse(struct ParseState *Parser, struct Value **Result)
|
|||
{
|
||||
/* it's either a new bracket level or a cast */
|
||||
enum LexToken BracketToken = LexGetToken(Parser, &LexValue, FALSE);
|
||||
if (IS_TYPE_TOKEN(BracketToken))
|
||||
if (IS_TYPE_TOKEN(BracketToken) && StackTop != NULL && StackTop->Op != TokenSizeof)
|
||||
{
|
||||
/* it's a cast - get the new type */
|
||||
struct ValueType *CastType;
|
||||
|
|
Loading…
Reference in a new issue