mirror of
https://github.com/KarolS/millfork.git
synced 2024-06-29 15:29:28 +00:00
Undo the sizeof change for now
This commit is contained in:
parent
38e4dd14a6
commit
68fcf8f2d7
|
@ -292,7 +292,7 @@ but not
|
||||||
some enum → `word`
|
some enum → `word`
|
||||||
|
|
||||||
* `sizeof`: size of the argument in bytes; the argument can be an expression or a type,
|
* `sizeof`: size of the argument in bytes; the argument can be an expression or a type,
|
||||||
and the result is a constant of type `word`
|
and the result is a constant of either `byte` or `word` type, depending on the actual value
|
||||||
|
|
||||||
* `call`: calls a function via a pointer;
|
* `call`: calls a function via a pointer;
|
||||||
the first argument is the pointer to the function;
|
the first argument is the pointer to the function;
|
||||||
|
|
|
@ -453,7 +453,10 @@ object AbstractExpressionCompiler {
|
||||||
case FunctionCallExpression("sin", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
case FunctionCallExpression("sin", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
||||||
case FunctionCallExpression("cos", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
case FunctionCallExpression("cos", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
||||||
case FunctionCallExpression("tan", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
case FunctionCallExpression("tan", params) => if (params.size < 2) b else getExpressionTypeImpl(env, log, params(1), loosely)
|
||||||
case FunctionCallExpression("sizeof", _) => w
|
case FunctionCallExpression("sizeof", params) => env.evalSizeof(params.head).requiredSize match {
|
||||||
|
case 1 => b
|
||||||
|
case 2 => w
|
||||||
|
}
|
||||||
case FunctionCallExpression("%%", params) => params.map { e => getExpressionTypeImpl(env, log, e, loosely).size } match {
|
case FunctionCallExpression("%%", params) => params.map { e => getExpressionTypeImpl(env, log, e, loosely).size } match {
|
||||||
case List(1, 1) | List(2, 1) => b
|
case List(1, 1) | List(2, 1) => b
|
||||||
case List(1, 2) | List(2, 2) => w
|
case List(1, 2) | List(2, 2) => w
|
||||||
|
|
Loading…
Reference in New Issue
Block a user