summaryrefslogtreecommitdiff
path: root/05/parse.b
diff options
context:
space:
mode:
Diffstat (limited to '05/parse.b')
-rw-r--r--05/parse.b11
1 files changed, 9 insertions, 2 deletions
diff --git a/05/parse.b b/05/parse.b
index fbdf955..fc67f64 100644
--- a/05/parse.b
+++ b/05/parse.b
@@ -32,6 +32,13 @@ function type_is_array
if *1p == TYPE_ARRAY goto return_1
return 0
+function type_is_function
+ argument type
+ local p
+ p = types + type
+ if *1p == TYPE_FUNCTION goto return_1
+ return 0
+
function functype_return_type
argument ftype
local type
@@ -3190,7 +3197,7 @@ function parse_expression
if c == 0 goto undeclared_variable
*1out = EXPRESSION_FUNCTION
out += 4
- *4out = c
+ *4out = type_create_pointer(c)
out += 4
*8out = a
out += 8
@@ -3360,7 +3367,7 @@ function type_sizeof
; - code generation reasons
if c == TYPE_VOID goto return_1
if c == TYPE_POINTER goto return_8
- if c == TYPE_FUNCTION goto return_8
+ if c == TYPE_FUNCTION goto return_1
if c == TYPE_ARRAY goto sizeof_array
if c == TYPE_STRUCT goto sizeof_struct