mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
First-cut of fixes to make symbols work with libraries
This commit is contained in:
parent
1e297ec2fb
commit
695131a4d8
2 changed files with 9 additions and 3 deletions
9
cgen.scm
9
cgen.scm
|
@ -946,7 +946,7 @@
|
|||
(if program?
|
||||
(emit "#include \"runtime-main.h\""))
|
||||
|
||||
;; Emit symbols
|
||||
;; Emit symbol definitions
|
||||
(for-each
|
||||
(lambda (sym)
|
||||
(emit*
|
||||
|
@ -986,6 +986,13 @@
|
|||
; DEBUG (emit (string-append "printf(\"init " (lib:name->string lib-name) "\\n\");"))
|
||||
))
|
||||
|
||||
;; Initialize symbols
|
||||
(for-each
|
||||
(lambda (sym)
|
||||
(emit*
|
||||
" quote_" (mangle sym) " = find_or_add_symbol(\"" (symbol->string sym) "\");"))
|
||||
*symbols*)
|
||||
|
||||
;; Initialize global table
|
||||
(for-each
|
||||
(lambda (global)
|
||||
|
|
|
@ -145,8 +145,7 @@ typedef symbol_type *symbol;
|
|||
#define symbol_plist(x) (((symbol_type *) x)->plist)
|
||||
|
||||
#define defsymbol(name,pname) \
|
||||
static symbol_type name##_symbol = {symbol_tag, #pname, nil}; \
|
||||
static const object quote_##name = &name##_symbol
|
||||
static object quote_##name = nil;
|
||||
|
||||
/* Define numeric types */
|
||||
typedef struct {tag_type tag; int value;} integer_type;
|
||||
|
|
Loading…
Add table
Reference in a new issue