Mercurial > repos > tabletprog
annotate runtime/proghead.inc @ 229:7435367a932a
Allow newlines between binary operator and the right argument to the operator
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 02 Jan 2014 21:02:11 -0800 |
parents | ab7c142090a0 |
children | 632667d95d35 |
rev | line source |
---|---|
31
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #include "object.h" |
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #include <stddef.h> |
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 #include <stdlib.h> |
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdio.h> |
78
abc6f3d644a4
Use Boehm-GC for garbage collection. Also make no_impl print on stderr rather than standard in and return a non-zero error code.
Mike Pavone <pavone@retrodev.com>
parents:
45
diff
changeset
|
5 #include <gc/gc.h> |
31
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 |
34
a10f1b049193
Working closures, but need to rethink method call strategy
Mike Pavone <pavone@retrodev.com>
parents:
31
diff
changeset
|
7 object * main_module; |
a10f1b049193
Working closures, but need to rethink method call strategy
Mike Pavone <pavone@retrodev.com>
parents:
31
diff
changeset
|
8 |
182
ab7c142090a0
Make method names available at runtime so they can be included in method not implemented error messages
Mike Pavone <pavone@retrodev.com>
parents:
78
diff
changeset
|
9 char * methodNames[]; |
ab7c142090a0
Make method names available at runtime so they can be included in method not implemented error messages
Mike Pavone <pavone@retrodev.com>
parents:
78
diff
changeset
|
10 |
35
bf5e88f6419d
Use a function/method call strategy that actually works
Mike Pavone <pavone@retrodev.com>
parents:
34
diff
changeset
|
11 object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args) |
31
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 { |
182
ab7c142090a0
Make method names available at runtime so they can be included in method not implemented error messages
Mike Pavone <pavone@retrodev.com>
parents:
78
diff
changeset
|
13 fprintf(stderr, "method %s(%d) is not implemented on object %p\n", methodNames[method_id], method_id, self); |
78
abc6f3d644a4
Use Boehm-GC for garbage collection. Also make no_impl print on stderr rather than standard in and return a non-zero error code.
Mike Pavone <pavone@retrodev.com>
parents:
45
diff
changeset
|
14 fprintf(stderr, "main_module %p\n", main_module); |
abc6f3d644a4
Use Boehm-GC for garbage collection. Also make no_impl print on stderr rather than standard in and return a non-zero error code.
Mike Pavone <pavone@retrodev.com>
parents:
45
diff
changeset
|
15 exit(1); |
31
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 return NULL; |
668f533e5284
Add initial version of C backend
Mike Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 } |
78
abc6f3d644a4
Use Boehm-GC for garbage collection. Also make no_impl print on stderr rather than standard in and return a non-zero error code.
Mike Pavone <pavone@retrodev.com>
parents:
45
diff
changeset
|
18 |