Yuichi Nishiwaki
e30529d629
Add experimental cmake support
2014-03-02 01:52:41 +09:00
Yuichi Nishiwaki
3b8868c577
typedef pic_value pic_list
2014-03-01 20:54:02 +09:00
Yuichi Nishiwaki
c357a9302d
remove pic_list, and add pic_listn
2014-03-01 20:46:08 +09:00
Yuichi Nishiwaki
dfb6eeb72d
cleanup
2014-03-01 20:25:58 +09:00
Yuichi Nishiwaki
6e7567a598
my own read impl.
2014-03-01 20:21:44 +09:00
Yuichi Nishiwaki
6cf6c72f84
change default library in repl
2014-03-01 19:55:52 +09:00
Yuichi Nishiwaki
6ddaa0eda0
use pic_deflibrary in init.c
2014-03-01 19:54:29 +09:00
Yuichi Nishiwaki
95dc14bac2
use yyfree/yyalloc during bytevector lex
2014-03-01 13:24:43 +09:00
Yuichi Nishiwaki
491fd81c97
add an alias 'yylval' linked to '*yylvalp'
2014-03-01 00:35:16 +09:00
Yuichi Nishiwaki
cbad58f560
remove useless includes
2014-03-01 00:24:23 +09:00
Yuichi Nishiwaki
3bedc65d2b
use yyrealloc
2014-03-01 00:20:19 +09:00
Yuichi Nishiwaki
a51dc51a09
use volatile string
2014-03-01 00:19:57 +09:00
Yuichi Nishiwaki
0b8c7a8ccb
add pic_intern
2014-03-01 00:13:11 +09:00
Yuichi Nishiwaki
81f839ea04
use yyget_extra function
2014-03-01 00:02:46 +09:00
Yuichi Nishiwaki
222c3bdcaa
use noyywrap option
2014-02-28 23:59:50 +09:00
Yuichi Nishiwaki
513727f94c
emit additional scanner header file
2014-02-28 22:38:12 +09:00
Yuichi Nishiwaki
e781a063f8
scan.l cleanup
2014-02-28 22:35:38 +09:00
Yuichi Nishiwaki
1f858f05e3
avoid implicit int -> size_t cast
2014-02-27 22:14:21 +09:00
Yuichi Nishiwaki
7a1c04f1fa
[bugfix] old proc#cfunc_p property remained in debug block
2014-02-27 22:00:48 +09:00
Yuichi Nishiwaki
8586dc9057
xrope is now the internal representation of pic_str
2014-02-27 21:54:37 +09:00
Yuichi Nishiwaki
8e511bc410
remove dependencies on pic_state from pic_strlen and pic_strcmp
2014-02-27 19:42:59 +09:00
Yuichi Nishiwaki
878370c29a
gurantee allocators return NULL given size is zero
2014-02-27 13:55:19 +09:00
Yuichi Nishiwaki
06a7b0f5f6
add pic_func struct to hold native function name
2014-02-26 00:39:16 +09:00
Yuichi Nishiwaki
bb93a8be14
catch up to XFILE changes
2014-02-25 21:07:32 +09:00
Yuichi Nishiwaki
9a73ba707c
add pic_strcmp
2014-02-23 17:45:34 +09:00
Yuichi Nishiwaki
0fa61b6a4a
change pic_get_args API. 'z' now returns a pointer to null terminated
...
cstr, 's' a pointer to pic_str
2014-02-23 11:52:15 +09:00
Yuichi Nishiwaki
9f240c191c
add pic_str_new_fill
2014-02-23 11:25:39 +09:00
Yuichi Nishiwaki
349d7f1799
don't take int arguments with size_t
2014-02-23 10:51:21 +09:00
Yuichi Nishiwaki
067a4756ff
fix #58
2014-02-23 09:16:29 +09:00
Yuichi Nishiwaki
7ac4cd9ded
add 'pic_' prefix to heap manipulte functions
2014-02-22 16:54:12 +09:00
Yuichi Nishiwaki
5175f0bb8d
change gc heap API and hide sturctures.
2014-02-22 15:53:59 +09:00
Yuichi Nishiwaki
56f5f4a1f5
move sturct definitions for basic types to type-specific headers respectively
2014-02-22 15:21:55 +09:00
Yuichi Nishiwaki
a8aa6b2c5e
add some string utility functions
2014-02-21 18:24:20 +09:00
Yuichi Nishiwaki
131440b1d0
s/struct pic_string/pic_str/g
2014-02-21 18:05:59 +09:00
Yuichi Nishiwaki
80a794310d
call/cc must save pic->ip
2014-02-20 20:59:35 +09:00
Yuichi Nishiwaki
078b72ff17
cleanup
2014-02-20 20:44:30 +09:00
Yuichi Nishiwaki
19f426a4f4
[bugfix] segv on pic_receive
2014-02-20 18:57:01 +09:00
Yuichi Nishiwaki
7c5d337119
support call-with-values in VM level
2014-02-20 18:38:09 +09:00
Yuichi Nishiwaki
942e053cde
compile values in tail position
2014-02-20 18:00:30 +09:00
Yuichi Nishiwaki
742be0b2c0
don't reset retc in pic_receive
2014-02-20 18:00:16 +09:00
Yuichi Nishiwaki
acc3afc120
don't emit debug message into stderr
2014-02-20 17:58:00 +09:00
Yuichi Nishiwaki
85a766a242
adjust stack pointer to the next to the initial position after calling function
2014-02-20 17:41:59 +09:00
Yuichi Nishiwaki
213177eb10
reset ci->retc when pic_receive is called
2014-02-20 17:19:40 +09:00
Yuichi Nishiwaki
bad8daa813
ci->retc is set to 1 by default
2014-02-20 17:19:28 +09:00
Yuichi Nishiwaki
c9331fb59e
[refactor] proceed return values from C functions in OP_RET block
2014-02-20 17:14:58 +09:00
Yuichi Nishiwaki
29b2d84268
show invalid application callee
2014-02-20 17:10:55 +09:00
Yuichi Nishiwaki
2d0faff732
VM end state shows info based on the position the VM entered
2014-02-20 17:09:55 +09:00
Yuichi Nishiwaki
82647584e8
[bugfix] handle 1-coarity native function
2014-02-20 16:50:14 +09:00
Yuichi Nishiwaki
7217baee0a
add coarity register to the VM
2014-02-20 16:33:18 +09:00
Yuichi Nishiwaki
0f75a1b7cb
let OP_RET take an argument
2014-02-20 16:01:29 +09:00
Yuichi Nishiwaki
16639a1764
fix #56 . thank you @justinethier
2014-02-20 11:58:27 +09:00
Yuichi Nishiwaki
d718490a03
(finally!) hunt the bug. no more segv on error in repl
2014-02-19 02:24:30 +09:00
Yuichi Nishiwaki
b69b549fca
delegate error handling to REPL when no exception handlers remain
2014-02-19 02:22:34 +09:00
Yuichi Nishiwaki
6e3a2b176a
split error and raise
2014-02-19 02:11:29 +09:00
Yuichi Nishiwaki
a1a0aff657
newlines are included in block comments
2014-02-19 01:58:40 +09:00
Yuichi Nishiwaki
a5f5eb3b06
skip block comments
2014-02-19 01:53:47 +09:00
Yuichi Nishiwaki
844f25b5c1
[workaround] traverse_seq is broken, use traverse_shared instead
2014-02-19 01:15:30 +09:00
Yuichi Nishiwaki
d5e27e0949
add char-ready?
2014-02-18 19:20:29 +09:00
Yuichi Nishiwaki
cc97f857e1
add read-line
2014-02-18 18:56:14 +09:00
Yuichi Nishiwaki
17ae669b30
support nested comments
2014-02-18 17:24:08 +09:00
Yuichi Nishiwaki
a078266c2d
add pic_raise_continuable
2014-02-18 16:58:51 +09:00
Yuichi Nishiwaki
c42090f0b7
cleanup
2014-02-18 04:40:19 +09:00
Yuichi Nishiwaki
80a7e31901
s/port_/write_/g
2014-02-18 04:24:41 +09:00
Yuichi Nishiwaki
26808c1f51
add write function in C level (must not enter into a infinite loop)
2014-02-18 04:22:58 +09:00
Yuichi Nishiwaki
52a89ef5c9
fix memory leak
2014-02-18 03:45:00 +09:00
Yuichi Nishiwaki
b4166dde71
refactor tagged expression checker
2014-02-18 03:42:33 +09:00
Yuichi Nishiwaki
cd34417c42
add write-shared
2014-02-18 03:40:03 +09:00
Yuichi Nishiwaki
c6c88e976f
add support for circular objects to write
2014-02-18 03:39:32 +09:00
Yuichi Nishiwaki
7358e0933c
fix segv in is_quote etc
2014-02-18 03:38:12 +09:00
Yuichi Nishiwaki
c3d221f2da
revert prev commit
2014-02-17 23:31:12 +09:00
Yuichi Nishiwaki
ad3aca95a3
[workaround] write function now stops in a certain recursion depth
2014-02-17 23:08:17 +09:00
Yuichi Nishiwaki
ceef33af8a
[bugfix] is_quote family don't stop when circular object is given
2014-02-17 23:07:46 +09:00
Yuichi Nishiwaki
3a8aa3e728
publish format function family
2014-02-15 19:53:16 +09:00
Yuichi Nishiwaki
c4473335b4
add macroexpand function. close #46 .
2014-02-15 13:02:06 +09:00
Yuichi Nishiwaki
da7ec5b64f
place `load` function under (scheme load) library
2014-02-15 12:53:07 +09:00
Yuichi Nishiwaki
95fae80658
pic->envp is nullable
2014-02-13 15:37:15 +09:00
Yuichi Nishiwaki
64cdd5f152
cleanup
2014-02-13 15:01:01 +09:00
Yuichi Nishiwaki
f9046cc614
improve export error message
2014-02-13 15:00:48 +09:00
Yuichi Nishiwaki
ac136bbc2e
add gensym function
2014-02-13 14:59:51 +09:00
Yuichi Nishiwaki
f32754c0f9
place define-macro syntax in (picrin macro) library
2014-02-13 14:59:17 +09:00
Yuichi Nishiwaki
e5a84e3f4c
refactor pic_gensym
2014-02-13 13:53:56 +09:00
Yuichi Nishiwaki
38bb76808b
small comment fix
2014-02-13 13:52:11 +09:00
Yuichi Nishiwaki
a5f93fbd30
Merge remote-tracking branch 'refs/remotes/origin/master'
2014-02-13 13:49:46 +09:00
Yuichi Nishiwaki
aa48198270
cosmetic changes
2014-02-13 13:44:30 +09:00
Yuichi Nishiwaki
6c849bbac9
defsyntax functon no longer used
2014-02-13 13:42:17 +09:00
Yuichi Nishiwaki
a16eee7e1e
improve hygiene on define-macro
2014-02-13 13:26:32 +09:00
Yuichi Nishiwaki
923a762411
save symbol names in xhash
2014-02-13 00:14:03 +09:00
Yuichi Nishiwaki
907a6a1207
save memory consumption in macroexpand_list
2014-02-12 23:25:37 +09:00
Yuichi Nishiwaki
170a20ef1d
write supports quote/quasiquote/unquote/unquote-splicing notations
2014-02-12 23:07:12 +09:00
Yuichi Nishiwaki
234c573bb6
add another debug print
2014-02-12 22:30:46 +09:00
Yuichi Nishiwaki
edc91bd588
remove unneeded include
2014-02-12 21:50:28 +09:00
Yuichi Nishiwaki
910e006dc3
resolve symbols bound by define-syntax
2014-02-12 21:49:28 +09:00
Yuichi Nishiwaki
03ef82fd16
defmacro takes a symbol for the name
2014-02-12 11:32:17 +09:00
Yuichi Nishiwaki
b24e1b05c4
cleanup
2014-02-12 11:30:32 +09:00
Yuichi Nishiwaki
a40c79116f
use symbol_rename function in macro transformers
2014-02-12 11:20:38 +09:00
Yuichi Nishiwaki
098d5dc022
s/syntax/macro/g
2014-02-12 11:13:29 +09:00
Yuichi Nishiwaki
8ea3a7b544
rename a property of pic_syntax s/macro/proc/g
2014-02-12 11:05:32 +09:00
Yuichi Nishiwaki
6b69e8e74b
stx->sym property is no longer used
2014-02-12 11:02:59 +09:00
Yuichi Nishiwaki
3d97e7f749
syntax_new is a private API
2014-02-12 10:59:10 +09:00
Yuichi Nishiwaki
25ae2ef6b0
add identifier_eq_p
2014-02-12 10:57:58 +09:00
Yuichi Nishiwaki
93a259870c
replace pic_syntax_new with pic_syntax_new_macro
2014-02-12 10:52:33 +09:00
Yuichi Nishiwaki
a18fe136e1
cosmetic fixes
2014-02-12 10:50:26 +09:00
Yuichi Nishiwaki
c759fee566
add new_senv
2014-02-12 10:48:44 +09:00
Yuichi Nishiwaki
9cf7d72e82
inline-expand a small function
2014-02-12 10:42:17 +09:00
Yuichi Nishiwaki
527f46480a
rename symbols before macro lookup
2014-02-12 10:39:20 +09:00
Yuichi Nishiwaki
9c278889fc
add partial apply funciton
2014-02-12 01:17:05 +09:00
Yuichi Nishiwaki
34c10b0054
unify includes of stdio and assert
2014-02-11 23:25:25 +09:00
Yuichi Nishiwaki
5be10aefc9
[bugfix] compiling big library faults with arena overflow
2014-02-11 22:44:04 +09:00
Yuichi Nishiwaki
855702716c
clarify some error messages
2014-02-11 21:36:11 +09:00
Yuichi Nishiwaki
c2a1ea6748
dont consume arena in pic_append
2014-02-11 16:22:17 +09:00
Yuichi Nishiwaki
93e7a1cf32
clarify wrong number of arguments error message
2014-02-11 13:52:03 +09:00
Yuichi Nishiwaki
7843dc1023
add pic_errorf
2014-02-11 13:47:11 +09:00
Yuichi Nishiwaki
fc7b59100d
add some user functions to manipulate ports
2014-02-11 13:45:41 +09:00
Yuichi Nishiwaki
b404f30a50
pic_debug family return obj
2014-02-11 13:38:42 +09:00
Yuichi Nishiwaki
372fd3157b
error report is propagated through pic->err
2014-02-11 13:21:00 +09:00
Yuichi Nishiwaki
468e1b4d1f
add pic_fdebug
2014-02-11 00:47:57 +09:00
Yuichi Nishiwaki
7fe109a998
include xfile in picirn.h
2014-02-09 14:52:53 +09:00
Yuichi Nishiwaki
687706eaee
fix error message
2014-02-09 14:29:51 +09:00
Yuichi Nishiwaki
241012d2f9
add output-bytevector
2014-02-09 14:29:28 +09:00
Yuichi Nishiwaki
49e5e3085b
pic_str_new may take a NULL ptr
2014-02-09 03:11:08 +09:00
Yuichi Nishiwaki
668ace7901
implement some string functions in c
2014-02-09 03:10:58 +09:00
Yuichi Nishiwaki
39af5ca254
implement string-append in C
2014-02-09 02:42:50 +09:00
Yuichi Nishiwaki
7187e4e982
add open-input-bytevector
2014-02-09 02:41:52 +09:00
Yuichi Nishiwaki
3d0657074f
first argument of get-output-string is optinoal
2014-02-09 02:41:20 +09:00
Yuichi Nishiwaki
a666951f21
add open-output-string and get-output-string
2014-02-09 01:49:55 +09:00
Yuichi Nishiwaki
0e464b2f75
[bugfix] write-string doesn't detect given port
2014-02-09 01:21:44 +09:00
Yuichi Nishiwaki
8d067f66ed
add open-input-string
2014-02-08 23:23:53 +09:00
Yuichi Nishiwaki
dd0ed6bfea
add write-string/write-u8/write-bytevector
2014-02-08 17:31:54 +09:00
Yuichi Nishiwaki
5efdf3cfcc
write-simple support optional output port
2014-02-08 17:15:34 +09:00
Yuichi Nishiwaki
93f7270ea3
auto export symbols defined by pic_defmacro
2014-02-08 15:24:27 +09:00
Yuichi Nishiwaki
4cb661c252
add 'include' macro
2014-02-08 15:05:28 +09:00
Yuichi Nishiwaki
b0d955c771
analyze in order
2014-02-08 03:17:49 +09:00
Yuichi Nishiwaki
d100dde6b1
Merge branch 'master' into trampoline
2014-02-07 10:05:31 +09:00
Yuichi Nishiwaki
1afbfcda23
add 'static'
2014-02-07 10:02:09 +09:00
Yuichi Nishiwaki
cd12977cfe
receive values by trampoline
2014-02-07 09:59:02 +09:00
Yuichi Nishiwaki
1208fc9f0e
execute procedure by trampoline in call/cc
2014-02-07 09:56:57 +09:00
Yuichi Nishiwaki
67a856b1db
[bugfix] pic_trampoline was broken
2014-02-07 09:49:49 +09:00
Yuichi Nishiwaki
1c633b3cda
cleanup
2014-02-07 02:23:55 +09:00
Yuichi Nishiwaki
7288cd0614
redefinition might be against a local variable
2014-02-07 02:15:08 +09:00
Yuichi Nishiwaki
c4040949ff
stop warning in macroexpand, and creating a duplicate slot
2014-02-07 02:14:39 +09:00
Yuichi Nishiwaki
fd0553ac25
warn variable redefinition in macroexpansion level
2014-02-07 02:13:16 +09:00
Yuichi Nishiwaki
d74b82b1a5
warn global variable redefinition
2014-02-07 02:12:43 +09:00
Yuichi Nishiwaki
620fee4236
refactor global_ref and global_def
2014-02-07 01:48:56 +09:00
Yuichi Nishiwaki
c75d6e5789
refactor global_def
2014-02-07 01:42:28 +09:00
Yuichi Nishiwaki
ae5acd005c
refactor global_ref
2014-02-07 01:42:15 +09:00
Yuichi Nishiwaki
e7d38ea165
rename scope_global_define -> global_def
2014-02-07 01:31:45 +09:00
Yuichi Nishiwaki
faac3f7e9d
include xhash in picrin.h
2014-02-07 01:24:51 +09:00
Yuichi Nishiwaki
53979bf848
prefer type alias to types with 'struct'
2014-02-07 01:15:17 +09:00
Yuichi Nishiwaki
1901a7ab30
e->key is no longer of const char * type
2014-02-07 01:09:05 +09:00
Yuichi Nishiwaki
a4062b5b76
use xh_new_int
2014-02-07 01:08:57 +09:00
Yuichi Nishiwaki
104fd823b2
use a pointer to newly allocated region to pass to xh_put
2014-02-06 22:13:42 +09:00
Yuichi Nishiwaki
66ac29519e
use pic_trampoline in pic_proc_apply
2014-02-06 14:22:42 +09:00
Yuichi Nishiwaki
2ef426d90b
add trampoline helper
2014-02-06 14:22:29 +09:00
Yuichi Nishiwaki
845961e7f9
adjust OP_CALL count
2014-02-06 13:18:39 +09:00
Yuichi Nishiwaki
613f692c09
apply is broken with arg_list is nil
2014-02-06 13:04:11 +09:00
Yuichi Nishiwaki
9f21c8d7b1
Merge branch 'master' into trampoline
2014-02-06 13:01:31 +09:00
Yuichi Nishiwaki
c1e5eefbbd
staticize compile function
2014-02-04 18:54:33 +09:00
Yuichi Nishiwaki
849746b919
remove redundant message
2014-02-04 18:54:01 +09:00
Yuichi Nishiwaki
f29f10ddd7
clenaup debug message format
2014-02-04 18:53:51 +09:00
Yuichi Nishiwaki
060fb227a7
refactor pic_compile
2014-02-04 18:53:40 +09:00
Yuichi Nishiwaki
0d33900745
delegate initial instruction fetch to VM_LOOP
2014-02-04 18:42:37 +09:00
Yuichi Nishiwaki
0e0cc96859
booting message completely useless, shrink.
2014-02-04 18:39:47 +09:00
Yuichi Nishiwaki
90713100c2
show argument values when entering OP_CALL
2014-02-04 18:38:32 +09:00
Yuichi Nishiwaki
2d544ffa01
toplevel expression can be considered tail expresssion
2014-02-04 18:23:37 +09:00
Yuichi Nishiwaki
ae2cae8a47
duplicate OP_RET
2014-02-04 18:22:18 +09:00
Yuichi Nishiwaki
3a4bf769ce
don't emit duplicate OP_RET in codegen_lambda
2014-02-04 18:20:51 +09:00
Yuichi Nishiwaki
f59ce74148
add RETURN node
2014-02-04 18:20:35 +09:00
Yuichi Nishiwaki
dd547ac093
add OP_NOP
2014-02-04 16:58:50 +09:00
Yuichi Nishiwaki
16466fd35c
use OP_NOP in pic_proc_apply
2014-02-04 16:20:49 +09:00
Yuichi Nishiwaki
7837a30d53
add OP_NOP
2014-02-04 16:20:17 +09:00
Yuichi Nishiwaki
c3b45c6d16
'apply' calls given procedure by trampoline
2014-02-04 15:46:52 +09:00
Yuichi Nishiwaki
2ed2b503a6
apply' argument treatment was broken
2014-02-04 14:33:36 +09:00
Yuichi Nishiwaki
96fc08dd0b
[bugfix] close only closed variables...
2014-02-04 14:20:01 +09:00
Yuichi Nishiwaki
a3b0fa701b
rename pic_callinfo.pc -> ip
2014-02-04 10:46:36 +09:00
Yuichi Nishiwaki
f090eae241
restore ip when returned from c function
2014-02-04 10:40:16 +09:00
Yuichi Nishiwaki
018db310d3
save instruction pointer to pic_state
2014-02-04 10:40:03 +09:00
Yuichi Nishiwaki
08337f1ed1
use 'pc' as little as possible
2014-02-04 10:28:40 +09:00
Yuichi Nishiwaki
0947173c32
small optimize
2014-02-04 10:28:22 +09:00
Yuichi Nishiwaki
2022fa163b
fix #26
2014-02-04 10:18:31 +09:00
Yuichi Nishiwaki
a99cf8458a
implement ir-macro-transformer with C
2014-01-19 01:14:32 -08:00
Yuichi Nishiwaki
ce90e4a2a6
compare int and size_t warning when DEBUG is on
2014-01-19 00:54:56 -08:00
Yuichi Nishiwaki
ab411cc298
gcc complains that he can't assure if switch-enum is complete
2014-01-19 00:32:43 -08:00
Yuichi Nishiwaki
7bfe165a73
[bugfix] compiler complains fileno is not declared but used in lex.yy.c.
2014-01-19 00:31:03 -08:00
Yuichi Nishiwaki
9b31e5bd2f
refactor list_by_array
2014-02-02 21:16:45 +09:00
Yuichi Nishiwaki
b66021c042
print bytecode index in hex
2014-02-02 21:16:23 +09:00
Yuichi Nishiwaki
4a01b8296f
emit OP_NOT
2014-02-02 14:55:46 +09:00
Yuichi Nishiwaki
0fec56362d
add OP_NOT instruction
2014-02-02 14:54:47 +09:00
Yuichi Nishiwaki
0425dbdd1e
implement values and call-with-values with C
2014-02-02 14:26:58 +09:00
Yuichi Nishiwaki
778ee89dfe
fix pic_receive
2014-02-02 14:23:58 +09:00
Yuichi Nishiwaki
116a65cdee
add pic_receive
2014-02-02 12:38:46 +09:00
Yuichi Nishiwaki
19db4bb6b2
rest array got by pic_get_args has a dynamic extent; that is, we cannot
...
store it to a heap object when we are going to rewind that stack and
restore an old continuation.
2014-02-02 12:27:48 +09:00
Yuichi Nishiwaki
cb3128d241
refactor values functions
2014-02-02 12:27:24 +09:00
Yuichi Nishiwaki
f2507b5cbf
rename ..._from_... to ..._by_...
2014-02-02 12:26:43 +09:00
Yuichi Nishiwaki
2373e7a067
continuation now can take more than 1 arguments
2014-02-02 12:11:15 +09:00
Yuichi Nishiwaki
7547b83515
add pic_values functions
2014-02-02 12:10:31 +09:00
Yuichi Nishiwaki
ae85bbf60e
refactor std port
2014-02-02 11:23:23 +09:00
Yuichi Nishiwaki
b19631f18f
use submodule
2014-02-01 22:16:09 +09:00
Yuichi Nishiwaki
c5c3f4c1f5
use newer API of xhash
2014-02-01 20:01:26 +09:00
Yuichi Nishiwaki
6a8a0dc8cb
use picrin's allocator in lexer
2014-02-01 19:33:38 +09:00
Yuichi Nishiwaki
c68a7c41c7
use pic_strdup in lexer and parser
2014-02-01 19:33:23 +09:00
Yuichi Nishiwaki
1746243b15
use picrin's strdup impl if possible
2014-02-01 19:32:39 +09:00
Yuichi Nishiwaki
d48ae9227a
impl strdup and strndup by myself
2014-02-01 19:31:59 +09:00
Yuichi Nishiwaki
2f50f92ddc
use pic_for_each
2014-02-01 16:05:29 +09:00
Yuichi Nishiwaki
47f4060086
rewrite deflibrary using gensym
2014-02-01 15:41:30 +09:00
Yuichi Nishiwaki
5080294472
change return value of pic_get_args
2014-02-01 14:23:21 +09:00
Yuichi Nishiwaki
54b318f3e1
remove new_irep
2014-02-01 13:44:43 +09:00
Yuichi Nishiwaki
53fe18a94e
delete OP_PUSHFLOAT
2014-01-31 03:11:28 +09:00
Yuichi Nishiwaki
9172dc9f31
remove old pic_symbol_p macro
2014-01-31 03:03:36 +09:00
Yuichi Nishiwaki
f7a871b1e8
delete value.c
2014-01-30 21:52:10 +09:00
Yuichi Nishiwaki
2dd8d2746d
move all contents in value.c to value.h
2014-01-30 21:51:26 +09:00
Yuichi Nishiwaki
f29e7b9cf1
inline definitions for pic_*_value()s
2014-01-30 20:58:27 +09:00
Yuichi Nishiwaki
173d4dcf07
use UNUSED macro
2014-01-30 18:15:59 +09:00
Yuichi Nishiwaki
8ae55bd9b6
unification uses of int and size_t. use size_t for every variable that
...
can possibly be used as an array index.
2014-01-30 18:14:33 +09:00
Yuichi Nishiwaki
c1e2528395
depress warnings about unused variables in scan.l
2014-01-30 18:10:56 +09:00
Yuichi Nishiwaki
1d2fa33372
some of global tables are missed to free
2014-01-30 14:34:09 +09:00
Yuichi Nishiwaki
e8258edfa7
remove use of typo'd name function
2014-01-30 14:33:16 +09:00
Yuichi Nishiwaki
4d95707db5
add FALLTHROUGH macro
2014-01-30 14:13:01 +09:00
Yuichi Nishiwaki
7c35e50260
add NORETURN macro
2014-01-30 14:08:36 +09:00
Yuichi Nishiwaki
75037adfaa
hide debug prints
2014-01-30 13:50:47 +09:00
Yuichi Nishiwaki
f32e542392
analyze should not emit raw self-evaluating values
2014-01-30 13:47:58 +09:00
Yuichi Nishiwaki
64038fae02
unwrap begin expression if it contains 1 or 0 expressions inside
2014-01-30 13:36:49 +09:00
Yuichi Nishiwaki
d471dba322
current codegen not supporting env chain short cut
2014-01-27 22:24:12 +09:00
Yuichi Nishiwaki
055272f0d5
arena management in pic_list
2014-01-27 22:20:46 +09:00
Yuichi Nishiwaki
b5cf174b5c
wrong FOLD_ARGS impl
2014-01-27 22:20:31 +09:00
Yuichi Nishiwaki
8255e11486
gc management
2014-01-27 22:20:18 +09:00
Yuichi Nishiwaki
8343ccd675
[bugfix] lset never be emit
2014-01-27 22:20:08 +09:00
Yuichi Nishiwaki
82ea416c34
get rid of redundant code in is_closed function
2014-01-27 22:19:33 +09:00
Yuichi Nishiwaki
2f8b016d86
improve debug prints
2014-01-27 22:18:49 +09:00
Yuichi Nishiwaki
30fcd6468f
reverse condition for tail position marking
2014-01-27 21:24:10 +09:00
Yuichi Nishiwaki
3418aebe3f
remove unused properties
2014-01-27 21:20:12 +09:00
Yuichi Nishiwaki
c3fd4addc3
change AST format
2014-01-27 21:20:00 +09:00
Yuichi Nishiwaki
a2d9d2f93a
resolve TODOs
2014-01-27 21:18:03 +09:00
Yuichi Nishiwaki
52927ac452
gc resolver
2014-01-27 21:17:24 +09:00
Yuichi Nishiwaki
244ec06953
add implicit casts from void *
2014-01-27 21:17:04 +09:00
Yuichi Nishiwaki
26544ff6fd
dump ireps recursively
2014-01-27 21:14:59 +09:00
Yuichi Nishiwaki
15ca95eb8f
improve debug prints
2014-01-27 21:14:41 +09:00
Yuichi Nishiwaki
09840601c4
fflush buffer in pic_debug
2014-01-24 17:11:52 +09:00
Yuichi Nishiwaki
9dd04fd3b3
impl resolver
2014-01-24 17:11:37 +09:00
Yuichi Nishiwaki
6b20e004e5
[bugfix] var must be a symbol
2014-01-24 17:11:15 +09:00
Yuichi Nishiwaki
237e8c26a6
wrong length for call operation
2014-01-24 17:10:51 +09:00
Yuichi Nishiwaki
2126f5b453
rename local variables
2014-01-24 17:10:19 +09:00
Yuichi Nishiwaki
f3e2321679
add missing returns
2014-01-24 17:09:51 +09:00
Yuichi Nishiwaki
a35606dc16
gref/cref/lref are not used by analyzer
2014-01-24 17:09:06 +09:00
Yuichi Nishiwaki
cfdf1ceaf8
cleaning up
2014-01-24 17:08:35 +09:00
Yuichi Nishiwaki
56e90f564c
quote everything
2014-01-23 19:21:37 +09:00
Yuichi Nishiwaki
03e21218a5
remove depth property
2014-01-23 19:21:17 +09:00
Yuichi Nishiwaki
b2c5f5cb6d
change ast format
2014-01-23 18:57:18 +09:00
Yuichi Nishiwaki
66a7e653ba
change analyze_args API
2014-01-23 18:56:52 +09:00
Yuichi Nishiwaki
801c04788f
add cv_foo properties to codegen_context
2014-01-23 18:55:39 +09:00
Yuichi Nishiwaki
75167697f0
start using pic_list_ref and pic_list_tail
2014-01-23 16:32:20 +09:00
Yuichi Nishiwaki
2e28f604a6
Merge branch 'master' into analyzer
...
Conflicts:
include/picrin/pair.h
src/pair.c
2014-01-23 16:21:10 +09:00
Yuichi Nishiwaki
c7811f0c39
add depth property
2014-01-23 16:17:52 +09:00
Yuichi Nishiwaki
6d346fef87
unify the names of IR reference nodes to a name 'ref'
2014-01-23 15:18:41 +09:00
Yuichi Nishiwaki
3dbafd58be
cleanup
2014-01-23 15:03:43 +09:00
Yuichi Nishiwaki
95c5361197
rewrite min/max/gcd/lcm with C
2014-01-22 23:47:33 +09:00
Yuichi Nishiwaki
2f965fa809
replace some number predicates with c imples
2014-01-22 22:58:08 +09:00
Yuichi Nishiwaki
5dd66cbcd1
replace list-copy and make-list impls by scheme with ones by C
2014-01-22 22:37:27 +09:00
Yuichi Nishiwaki
c539f889cd
native implementatino of for-each
2014-01-22 22:21:48 +09:00
Yuichi Nishiwaki
85a5745716
native implmentation of map
2014-01-22 22:18:25 +09:00
Yuichi Nishiwaki
74088d0130
replace list-set! impl with C impl
2014-01-22 21:35:13 +09:00
Yuichi Nishiwaki
d07456466d
replace cxxr and list? impls by scheme with ones by C
2014-01-22 21:29:11 +09:00
Yuichi Nishiwaki
7fc2885fad
replace list impl by scheme with impl by C
2014-01-22 21:20:13 +09:00
Yuichi Nishiwaki
bbd1ec3fbb
replace length/reverse/append impls with c functions
2014-01-22 21:14:10 +09:00
Yuichi Nishiwaki
67d4d28d19
impl list-ref and list-tail as C functions
2014-01-22 21:00:29 +09:00
Yuichi Nishiwaki
7865cfe9b3
add pic_append
2014-01-22 20:57:14 +09:00
Yuichi Nishiwaki
a443d9e3f6
add pic_list_ref and pic_list_tail
2014-01-22 20:57:05 +09:00
Yuichi Nishiwaki
655eb7a3bd
add pic_compile
2014-01-20 16:57:39 +09:00
Yuichi Nishiwaki
293fef5235
add pic_list_ref
2014-01-20 16:43:54 +09:00
Yuichi Nishiwaki
78420ef042
remove unused properties
2014-01-20 13:22:45 +09:00
Yuichi Nishiwaki
35cf4e1fcd
initialize with global scope
2014-01-20 13:15:09 +09:00
Yuichi Nishiwaki
b2c74552f2
change lookup_var API
2014-01-20 13:04:21 +09:00
Yuichi Nishiwaki
fbeb32ee83
typo
2014-01-20 11:16:52 +09:00
Yuichi Nishiwaki
6dcf04d50c
fix some bugs
2014-01-18 22:36:02 -08:00
Yuichi Nishiwaki
14eb6b334d
arena management
2014-01-18 22:35:36 -08:00
Yuichi Nishiwaki
ae933252c9
add analyzer prototype
2014-01-18 20:20:28 -08:00
Yuichi Nishiwaki
0ceb9c9953
add sSYMBOLs to pic_state
2014-01-18 11:47:32 -08:00
Yuichi Nishiwaki
395f48bc81
move rSYMBOLs from pic_state to codegen_state
2014-01-18 11:47:18 -08:00
Yuichi Nishiwaki
9495e9bf5c
alloc functions may take 0 for the size
2014-01-18 07:33:51 -08:00
Yuichi Nishiwaki
1aa35891ad
[bugfix] must multiply the size by sizeof(struct) when using realloc function
2014-01-18 23:01:11 +09:00
Yuichi Nishiwaki
a315f518d2
auto-extend constant pool array
2014-01-18 22:56:43 +09:00
Yuichi Nishiwaki
9fadf16fdb
make iseq length configurable
2014-01-18 22:54:28 +09:00
Yuichi Nishiwaki
494989ff3e
embed constant pool into irep object
2014-01-18 22:32:41 +09:00
Yuichi Nishiwaki
a0f27a68cd
grammartical fix
2014-01-18 22:31:40 +09:00
Yuichi Nishiwaki
fdac5061fd
free irep->irep
2014-01-18 22:31:25 +09:00
Yuichi Nishiwaki
5e616e7774
store irep objects inside parent irep object
2014-01-18 21:48:50 +09:00
Yuichi Nishiwaki
4f5743ad0f
shrink code size
2014-01-18 21:47:52 +09:00
Yuichi Nishiwaki
53e3e019de
ccapa property no longer used
2014-01-18 21:03:12 +09:00
Yuichi Nishiwaki
d3412deae1
duplicate variable binding
2014-01-18 20:53:16 +09:00
Yuichi Nishiwaki
801d92e0a4
store constructing iseq in scope object, not pic_irep
2014-01-18 20:49:01 +09:00
Yuichi Nishiwaki
05a69d10dd
cosmetic changes
2014-01-18 17:19:46 +09:00
Yuichi Nishiwaki
a9574155b8
do not free objects in pic->irep by hands
2014-01-18 16:59:43 +09:00
Yuichi Nishiwaki
82e205bbd0
Merge branch 'master' into irep-gc
2014-01-18 16:58:24 +09:00
Yuichi Nishiwaki
9d18af51da
some global stacks are missed to free
2014-01-18 16:58:14 +09:00
Yuichi Nishiwaki
0db09b146c
ireps generated by top codegen are not registered to pic->irep. get them
...
marked manually.
2014-01-18 16:56:20 +09:00
Yuichi Nishiwaki
42c097a91f
pic->irep is a root marker
2014-01-18 16:55:11 +09:00
Yuichi Nishiwaki
11e4f1644b
irep object is now controlled under GC
2014-01-18 16:53:39 +09:00
Yuichi Nishiwaki
586b228156
add PIC_TT_IREP
2014-01-18 16:51:54 +09:00
Yuichi Nishiwaki
b62374b4b4
s/print_irep/pic_dump_irep/g
2014-01-18 16:23:12 +09:00
Yuichi Nishiwaki
acb513aa16
publish pic_callcc
2014-01-18 16:08:07 +09:00
Yuichi Nishiwaki
3ff7d5b208
grammatical fix
2014-01-18 16:06:59 +09:00
Yuichi Nishiwaki
ee4cb87083
impl pic_unwrap_var
2014-01-18 12:58:00 +09:00
Yuichi Nishiwaki
a16dcb9931
impl pic_set
2014-01-18 12:55:44 +09:00
Yuichi Nishiwaki
4522dd47af
do not put includes in header, but put it in c file
2014-01-18 12:43:38 +09:00
Yuichi Nishiwaki
ca068f560b
clarify license information
2014-01-17 20:58:31 +09:00
Yuichi Nishiwaki
ecaf96ea14
add missing break statement
2014-01-17 13:16:55 +09:00
Yuichi Nishiwaki
43f3f6d0ce
impl pic_close
2014-01-16 22:02:50 +09:00
Yuichi Nishiwaki
db75df2624
add heap finializer
2014-01-16 22:02:30 +09:00
Yuichi Nishiwaki
8f2f1faf63
use shorter name for library external representation
2014-01-16 21:32:38 +09:00
Yuichi Nishiwaki
5929020429
reordering functions
2014-01-16 21:32:22 +09:00
Yuichi Nishiwaki
41dea6c5d2
split functions related to 'write' procedure into files
2014-01-16 21:31:46 +09:00
Yuichi Nishiwaki
73ad915fcf
set 0 to file->flags by default
2014-01-16 21:00:45 +09:00
Yuichi Nishiwaki
8709ada140
replace fpos_t with long since old versions of clang and gcc seem claim
...
that fpos_t and long are not convertible
2014-01-16 20:13:13 +09:00
Yuichi Nishiwaki
31adf248af
suppress warnings
2014-01-16 20:08:22 +09:00
Yuichi Nishiwaki
6f32cbdea3
handle end-of-file while reading file object
2014-01-16 19:56:45 +09:00
Yuichi Nishiwaki
74be43195d
cosmetic fixes
2014-01-16 19:56:02 +09:00
Yuichi Nishiwaki
1b45536fe2
[bugfix] ungetc enters infinite loop
2014-01-16 19:54:19 +09:00
Yuichi Nishiwaki
44be26b36f
want reader and writer to return the actual byte count, not item count
2014-01-16 19:53:46 +09:00
Yuichi Nishiwaki
2ff0a5061b
wrong timing and offset for buffer shifting in reading
2014-01-16 19:52:42 +09:00
Yuichi Nishiwaki
9aef0cdac0
get rid of a small redundant code
2014-01-16 19:51:40 +09:00
Yuichi Nishiwaki
f564626556
pic_fflush and pic_ffill should change cursor positions
2014-01-16 19:51:03 +09:00
Yuichi Nishiwaki
a5f478a7d5
currently pic_file don't support _IONBF mode
2014-01-16 19:49:41 +09:00
Yuichi Nishiwaki
5ee9539e9b
impl pic_ungetc
2014-01-16 18:42:25 +09:00
Yuichi Nishiwaki
4e495c6fcc
[WIP] add a buffer for ungetc
2014-01-16 18:42:10 +09:00
Yuichi Nishiwaki
9897f7581f
impl pic_fread with buffering
2014-01-16 18:41:10 +09:00
Yuichi Nishiwaki
fc506674c0
add missing includes
2014-01-16 18:39:38 +09:00
Yuichi Nishiwaki
ce21353d50
impl pic_fwrite with simple buffering
2014-01-16 18:39:03 +09:00
Yuichi Nishiwaki
14b73501c4
[bugfix] call setvbuf in pic_file constructor
2014-01-16 18:37:54 +09:00
Yuichi Nishiwaki
3d72464e80
impl pic_fflush
2014-01-16 18:36:59 +09:00
Yuichi Nishiwaki
eca456f875
add IO buffering (setvbuf)
2014-01-16 18:36:47 +09:00
Yuichi Nishiwaki
4d0a448a44
impl char/string IO functions
2014-01-16 18:35:22 +09:00
Yuichi Nishiwaki
f043fbb0a7
impl pic_fopen and pic_close. add FILE*-pic_file* adapter functions.
2014-01-16 18:34:04 +09:00
Yuichi Nishiwaki
392549b315
replace old stdio functions with picrin's wrapper impls
2014-01-16 18:32:05 +09:00
Yuichi Nishiwaki
63d23bdeda
[WIP] add generic file object constructor (pic_funopen)
2014-01-16 18:27:05 +09:00
Yuichi Nishiwaki
34d52e1a51
use pic_load to load built-in.scm
2014-01-13 14:52:19 +09:00
Yuichi Nishiwaki
0753b12f60
[bugfix] native operators such as = or + are not inline-expanded
2014-01-13 14:39:21 +09:00
Yuichi Nishiwaki
daf67c34d9
= procedure is brokwn
2014-01-13 13:55:08 +09:00
Yuichi Nishiwaki
5b068d7cc7
implement load procedure
2014-01-13 13:54:52 +09:00
Yuichi Nishiwaki
9d54244424
match the order of functions with R7RS
2014-01-13 02:07:38 +09:00
Yuichi Nishiwaki
4a14531702
add write-char and flush-output-port
2014-01-13 02:06:09 +09:00
Yuichi Nishiwaki
a232defd00
newline can take an optional argument
2014-01-13 01:47:46 +09:00
Yuichi Nishiwaki
19a561132e
fix assert_port_profile to show clearer error message
2014-01-13 01:47:15 +09:00
Yuichi Nishiwaki
ec9305e9a5
current write implementation in fact behaves as same as write-simple
2014-01-13 01:34:59 +09:00
Yuichi Nishiwaki
70f6b59856
add peek-char
2014-01-13 01:34:26 +09:00
Yuichi Nishiwaki
4a87120eb6
add read-char procedure
2014-01-13 00:51:30 +09:00
Yuichi Nishiwaki
1c14feffa4
add accessors of stdio ports
2014-01-13 00:51:19 +09:00
Yuichi Nishiwaki
3fb407329f
implement missing pic_ref definition
2014-01-13 00:50:45 +09:00
Yuichi Nishiwaki
4a7a32829d
use the new feature of pic_get_args (port specifier)
2014-01-13 00:50:18 +09:00
Yuichi Nishiwaki
d9911cabc8
publish pic_eof_object()
2014-01-13 00:49:25 +09:00
Yuichi Nishiwaki
322021e5d5
pic_get_args supports port object
2014-01-13 00:48:00 +09:00
Yuichi Nishiwaki
6b808354c0
global variable accessors don't require library object
2014-01-13 00:45:49 +09:00
Yuichi Nishiwaki
dbf73ecd7a
refactor std ports
2014-01-13 00:02:58 +09:00
Yuichi Nishiwaki
0af0ecafb6
add standard io ports
2014-01-12 23:57:50 +09:00
Yuichi Nishiwaki
f4202a7555
don't need to strip syntactic information away from quoted expressions
2014-01-12 20:21:07 +09:00
Yuichi Nishiwaki
b70c689b1f
keep track of xhash's HEAD
2014-01-12 19:53:20 +09:00
Yuichi Nishiwaki
a6fafd6422
add missing 'static' modifier
2014-01-12 16:15:04 +09:00
Yuichi Nishiwaki
d6abb5c0ba
add defvar
2014-01-12 16:09:27 +09:00
Yuichi Nishiwaki
10e5546a53
functions defined by pic_defun will be implicitly renamed
2014-01-12 16:09:19 +09:00
Yuichi Nishiwaki
11ead27614
wrapper/unwrapper for var-proc conversion
2014-01-12 16:08:27 +09:00
Yuichi Nishiwaki
133e4c00bd
leave a comment about conv parameter of pic_new_var is nullable
2014-01-12 16:05:42 +09:00
Yuichi Nishiwaki
944111ba09
make gensym API public
2014-01-12 16:03:36 +09:00
Yuichi Nishiwaki
825cde998b
s/pic_proc_cv_reserve/pic_proc_cv_init/g
2014-01-12 13:02:16 +09:00
Yuichi Nishiwaki
45c49fdec3
don't rename each symbol more than a time
2014-01-10 17:55:58 +09:00
Yuichi Nishiwaki
62e52be061
[bugfix] macroexpand may return a non-symbol value even if passed a symbol.
2014-01-10 17:55:13 +09:00
Yuichi Nishiwaki
57253f9a6c
compare is allowed to take non-symbol values
2014-01-10 17:52:31 +09:00
Yuichi Nishiwaki
a159e52ae6
[bugfix] wrong error message
2014-01-10 17:49:27 +09:00
Yuichi Nishiwaki
6bdc9b360e
[bugfix] wrong external representation for syntax type
2014-01-10 16:22:36 +09:00
Yuichi Nishiwaki
2e66b533c1
fix a small bug in a comment
2014-01-10 16:22:07 +09:00
Yuichi Nishiwaki
9b02247082
initial explicit renaming macro prototype
2014-01-09 16:34:22 +09:00
Yuichi Nishiwaki
8e4e226bd3
pic_get_args supports symbol
2014-01-09 16:33:38 +09:00
Yuichi Nishiwaki
e8a50410a5
suppress unreachable warnings
2014-01-09 00:42:23 +09:00
Yuichi Nishiwaki
76f8916dca
show debug print when a library is reopened
2014-01-09 00:40:13 +09:00
Yuichi Nishiwaki
a9f4eff13e
add parameter primitives: (picrin parameter) library
2014-01-09 00:39:13 +09:00
Yuichi Nishiwaki
d7c510ae40
parameter implementation prototype
2014-01-09 00:38:09 +09:00
Yuichi Nishiwaki
92ceedbd15
add accessor functions to modify closed variables
2014-01-08 22:45:28 +09:00
Yuichi Nishiwaki
e3e1ba4c11
rename procedure creation functions
2014-01-08 22:44:53 +09:00
Yuichi Nishiwaki
e7f765d218
pic_get_args supports pic_procs
2014-01-08 20:53:28 +09:00
Yuichi Nishiwaki
b9ef51530f
don't intern symbols newly generated by new_uniq_sym
2014-01-08 20:41:29 +09:00
Yuichi Nishiwaki
dccc234fd9
add pic_import
2014-01-08 15:38:31 +09:00
Yuichi Nishiwaki
33cbf5ff6a
configurable none value
2014-01-08 15:22:23 +09:00
OGINO Masanori
ceffd8a3bd
Cast to `void *` for '%p' format specifiers.
...
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-05 18:10:33 +09:00
OGINO Masanori
da1eb0bc10
Remove '\e'. The escape sequence is not in ISO C.
...
Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2014-01-05 18:00:02 +09:00
Yuichi Nishiwaki
76f5cbf0b3
ENDLIBRARY requires a trailing semicolon
2013-12-10 07:26:43 -08:00
Yuichi Nishiwaki
d23f686485
newline is not an element of (scheme write)
2013-12-10 05:59:03 -08:00
Yuichi Nishiwaki
cdb1911f9f
define (scheme inexact) library
2013-12-10 05:40:44 -08:00
Yuichi Nishiwaki
6dc66d354c
add missing finite? function
2013-12-10 05:40:26 -08:00
Yuichi Nishiwaki
afe630bc42
use find_library inside in_library
2013-12-10 05:40:03 -08:00
Yuichi Nishiwaki
fb34b71de1
[bugfix] identifier=? dies when take auxiliary syntax (because they emit
...
errors during expansion)
2013-12-10 01:50:53 -08:00
Yuichi Nishiwaki
41ffd0d7e5
define macro primitives (such as make-syntactic-closure) in (picrin macro)
2013-12-10 01:49:48 -08:00
Yuichi Nishiwaki
fd8c551159
use print_code for CODE_EXECUTE_HOOK
2013-12-10 01:47:45 -08:00
Yuichi Nishiwaki
e021ac52ac
identifier=? dons not necessarily take identifiers
2013-12-10 00:22:34 -08:00
Yuichi Nishiwaki
038020ff9f
sequentially evaluate programs declared in library at the macroexpansion phase
2013-12-09 23:00:13 -08:00
Yuichi Nishiwaki
bae4e6974b
[bugfix] create a new senv before allocate a library
2013-12-09 22:59:27 -08:00
Yuichi Nishiwaki
74feec78f1
always emit the same unique symbol for unbound variable
2013-12-09 09:32:30 -08:00
Yuichi Nishiwaki
725297384a
define-syntax is now capable of takeing a synclo object at the position
...
of the syntax name
2013-12-09 09:26:28 -08:00
Yuichi Nishiwaki
d871c6f06c
import and export take multiple spec in a time
2013-12-09 09:22:38 -08:00
Yuichi Nishiwaki
39b28fa674
debug print might cause segv
2013-12-09 09:09:24 -08:00
Yuichi Nishiwaki
eeb09f336e
Merge branch 'master' into libraries
...
Conflicts:
src/macro.c
src/pair.c
2013-12-09 08:27:29 -08:00
Yuichi Nishiwaki
e05a469a06
fix ir-macro-transformer
2013-12-09 07:27:11 -08:00
Yuichi Nishiwaki
0dddddab55
ir-macro-transformer was broken
2013-12-09 07:26:51 -08:00
Yuichi Nishiwaki
d21db9ae81
execute winded handlers when exit is called
2013-12-09 13:51:34 +09:00
Yuichi Nishiwaki
5035831d84
[bugfix] syntax objects should be brought to imported library's
...
senv->stx holder
2013-12-08 00:52:34 -08:00
Yuichi Nishiwaki
dda8ad367c
split built-in functins into libraries
2013-12-07 23:17:28 -08:00
Yuichi Nishiwaki
906f2c8a93
make-library returns existing library if name conflicts
2013-12-07 23:15:16 -08:00
Yuichi Nishiwaki
fabe70aaf2
[bugfix] assq and assoc should return false if key is not found
2013-12-07 23:13:45 -08:00
Yuichi Nishiwaki
bea04325e5
define arithmetic operators as c functions
2013-12-07 20:55:04 -08:00
Yuichi Nishiwaki
8720ffa0c5
s/DEFINE_MATH_PRED/DEFINE_ARITH_CMP/g
2013-12-07 20:55:04 -08:00
Yuichi Nishiwaki
617ee5aa68
add pic_parse
2013-12-07 20:54:23 -08:00
Yuichi Nishiwaki
24a41d8e27
add pic_assoc
2013-12-07 20:52:58 -08:00
Yuichi Nishiwaki
28da6d71ba
add pic_equal_p
2013-12-07 20:52:58 -08:00
Yuichi Nishiwaki
fb2e7ac498
declare all built-in functions and variables in (scheme base) library
2013-12-07 20:48:24 -08:00
Yuichi Nishiwaki
47dd186535
do not include core syntaces in the default library environment
2013-12-07 20:47:55 -08:00
Yuichi Nishiwaki
7f5a4c34a3
register and export to library functions defined by pic_defun
2013-12-07 20:47:09 -08:00
Yuichi Nishiwaki
e71c5abfdb
rename unbound symbols by default
2013-12-07 20:45:47 -08:00
Yuichi Nishiwaki
01e60b5d8e
add pic_export and pic_export_as
2013-12-07 20:44:39 -08:00
Yuichi Nishiwaki
0110370cc4
improve reusability
2013-12-07 20:43:57 -08:00
Yuichi Nishiwaki
57ca3174aa
define arithmetic operators as c functions
2013-12-07 20:43:36 -08:00
Yuichi Nishiwaki
629ee06b5f
s/DEFINE_MATH_PRED/DEFINE_ARITH_CMP/g
2013-12-07 20:42:10 -08:00
Yuichi Nishiwaki
791ab95219
[bugfix] taking a wrong symbol for exporting
2013-12-07 19:03:18 -08:00
Yuichi Nishiwaki
0f491adc73
select library during macroexpanding define-library
2013-12-07 18:59:35 -08:00
Yuichi Nishiwaki
7cdcbd4604
set name to each library
2013-12-07 18:59:13 -08:00
Yuichi Nishiwaki
35b99d11a8
let make_library return a library
2013-12-07 18:44:14 -08:00
Yuichi Nishiwaki
c764d28878
add pic_parse
2013-12-07 18:38:47 -08:00
Yuichi Nishiwaki
6b2d6a98eb
Revert "change APIs of library functions"
...
This reverts commit 0115ede4de
.
Conflicts:
include/picrin.h
2013-12-07 18:27:08 -08:00
Yuichi Nishiwaki
818430bb81
implement import/export syntax
2013-12-07 09:42:34 -08:00
Yuichi Nishiwaki
c989687564
[workaround] load core syntaces initially
2013-12-07 07:14:35 -08:00
Yuichi Nishiwaki
0115ede4de
change APIs of library functions
2013-12-07 07:11:22 -08:00
Yuichi Nishiwaki
9cb777eec3
select the minimal library at first
2013-12-07 07:05:22 -08:00
Yuichi Nishiwaki
7c6ba80581
add library operation methods
2013-12-07 07:05:06 -08:00
Yuichi Nishiwaki
1ac5b6458c
add pic_null_syntactic_env and pic_minimal_syntactic_env
2013-12-07 07:04:26 -08:00
Yuichi Nishiwaki
aac2082991
add pic_assoc
2013-12-07 06:30:21 -08:00
Yuichi Nishiwaki
dcb5b448cd
add pic_equal_p
2013-12-07 06:29:29 -08:00
Yuichi Nishiwaki
381ed58bff
add global library table
2013-12-07 05:36:14 -08:00
Yuichi Nishiwaki
931565d4ce
add pic_lib
2013-12-07 03:58:18 -08:00
Yuichi Nishiwaki
acbcde3b6a
initial library support
2013-12-07 03:04:27 -08:00
Yuichi Nishiwaki
a1e2e41840
add some symbols about library
2013-12-07 02:31:04 -08:00
Yuichi Nishiwaki
25378e3813
cosmetic changes
2013-12-06 07:51:32 -08:00
Yuichi Nishiwaki
b3a2da1079
Merge remote-tracking branch 'origin/master'
2013-12-06 04:48:10 -08:00
Yuichi Nishiwaki
ef04e3f02c
add pic_core_syntactic_env
2013-12-06 18:04:36 +09:00
Yuichi Nishiwaki
4d8ffa43c8
delete auto resource releasing facility
2013-12-03 08:16:53 -08:00
Yuichi Nishiwaki
7e69ae1878
add port-close procedure
2013-12-03 08:16:13 -08:00
Yuichi Nishiwaki
afffa20785
pic_apply supports multiple arguments
2013-12-03 06:40:50 -08:00
Yuichi Nishiwaki
a7df867a55
suppress gcc's warnings
2013-12-03 06:10:46 -08:00
Yuichi Nishiwaki
4e98d37ab1
remove old debug prints
2013-12-03 13:08:23 +09:00
Yuichi Nishiwaki
dc7c801c38
exprs during macroexpansion may have syntactic-closure in the tail position
2013-12-03 13:08:00 +09:00
Yuichi Nishiwaki
761deffe1f
macroexpand_list supports any kind of improper list
2013-12-03 13:07:25 +09:00
Yuichi Nishiwaki
b5b30de05a
remove a field for debug of union header
2013-12-03 11:49:32 +09:00
Yuichi Nishiwaki
7685afdb79
fix logic flaw in GC
2013-12-03 11:45:38 +09:00
Yuichi Nishiwaki
704b2d148b
rewrite pic_type_repr
2013-12-02 13:39:11 +09:00
Yuichi Nishiwaki
a43e3248e8
calloc should take size_t
2013-12-01 12:44:43 +09:00
Yuichi Nishiwaki
04434f44fd
cosmetic changes
2013-11-30 00:07:49 +09:00
Yuichi Nishiwaki
21f2c58a53
[gc][bugfix] sweeping failed when the heap gets completely
...
exhausted (i.e. all blocks' size are zero)
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
f03a153774
add freed object counter
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
4c5d3b4257
Revert "[bugfix] do not fuse end-of-page block into other blocks"
...
This reverts commit 5656590fa0
.
2013-11-29 12:10:10 +09:00
Yuichi Nishiwaki
ab5de1c0c4
fix #6
2013-11-29 12:10:02 +09:00
Yuichi Nishiwaki
5656590fa0
[bugfix] do not fuse end-of-page block into other blocks
2013-11-28 21:58:25 +09:00
Yuichi Nishiwaki
e10bbac8e5
accept injected symbols (syntactic-closures) at the places of lambda formals
2013-11-28 18:40:31 +09:00
Yuichi Nishiwaki
3266ae7d3c
[bugfix] missed to mark stx->senv
2013-11-28 13:15:27 +09:00
Yuichi Nishiwaki
c2d7f3d1f2
[bugfix] wrong size for pic_proc allocation
2013-11-27 06:31:49 -08:00
Yuichi Nishiwaki
49caf79ce6
[bugfix] new_uniq_sym must take one more byte chunk for new string
2013-11-27 06:31:12 -08:00
Yuichi Nishiwaki
7b8ee3eb97
add er-macro-transformer
2013-11-27 17:26:07 +09:00
Yuichi Nishiwaki
1ab588d21f
added hygienic macro facility! Fooo!
2013-11-27 15:58:28 +09:00
Yuichi Nishiwaki
9a027dae6e
add error guard
2013-11-27 15:57:23 +09:00
Yuichi Nishiwaki
bedc5dc6be
revise output format of syntactic closure object
2013-11-27 15:56:29 +09:00
Yuichi Nishiwaki
ceedd05ef0
[bugfix] pic_apply_argv concatenated args in reverse order
2013-11-27 15:55:54 +09:00
Yuichi Nishiwaki
78cafe3db7
add make-syntactic-closure function
2013-11-27 15:04:44 +09:00
Yuichi Nishiwaki
ab74920a6f
add pic_sc (syntactic closure) structure
2013-11-27 15:04:02 +09:00
Yuichi Nishiwaki
a7a3bfc270
[CSE] add new_global_senv and new_local_senv
2013-11-27 14:19:46 +09:00
Yuichi Nishiwaki
b4218a7a03
cosmetic changes
2013-11-27 14:00:23 +09:00
Yuichi Nishiwaki
73831283b6
cleanup
2013-11-27 13:51:24 +09:00
Yuichi Nishiwaki
c1788d31b0
Merge branch 'master' into syntactic-closure
2013-11-27 13:06:37 +09:00
Yuichi Nishiwaki
bbe3e990e4
Revert "pluggable heap pages"
...
This reverts commit e6523730a4
.
2013-11-27 13:04:12 +09:00
Yuichi Nishiwaki
5e3f2dacf4
Revert "add_heap_page should not be invoked in gc_alloc, but should be in obj_alloc"
...
This reverts commit f11623f075
.
2013-11-27 13:04:03 +09:00
Yuichi Nishiwaki
94aac37443
macros must be added to var_tbl
2013-11-26 17:43:59 -08:00
Yuichi Nishiwaki
d2af692280
add a fixme comment
2013-11-26 17:43:49 -08:00
Yuichi Nishiwaki
d7f8d67bf2
debug-print when unbound symbol is found
2013-11-26 16:52:30 -08:00
Yuichi Nishiwaki
38ab43d7fc
[bugfix] binding leak
2013-11-26 16:51:48 -08:00
Yuichi Nishiwaki
3710d5feea
support varg lambda
2013-11-26 16:51:17 -08:00
Yuichi Nishiwaki
b2704fb123
increment xlen in the end
2013-11-26 16:50:38 -08:00
Yuichi Nishiwaki
c336a354e4
publish pic_defmacro as a public API
2013-11-26 09:09:15 -08:00
Yuichi Nishiwaki
2dee30a0b5
macroexpand_list supports improper list
2013-11-26 09:07:57 -08:00
Yuichi Nishiwaki
43d449d2aa
s/define_macro/pic_defmacro/g
2013-11-26 09:07:06 -08:00
Yuichi Nishiwaki
cbd636e0a7
[bugfix] do not release pic->var_tbl when a senv holding it is dead
2013-11-26 09:00:16 -08:00
Yuichi Nishiwaki
e7673c65bd
[bugfix] syntaces should be registered to var_tbl, not global_tbl
2013-11-26 08:59:16 -08:00
Yuichi Nishiwaki
be311cb96f
replace old macroexpand facility with new renamer implementation
2013-11-26 08:43:58 -08:00
Yuichi Nishiwaki
1f3f7c99a2
save macro procesures in each syntax object
2013-11-26 08:42:13 -08:00
Yuichi Nishiwaki
3d1f74d8f5
add 'define-macro' core syntax
2013-11-26 08:41:01 -08:00
Yuichi Nishiwaki
ddbc2c83a2
add missing core symbol registration
2013-11-26 08:39:37 -08:00
Yuichi Nishiwaki
3009473d52
debug prints for macroexpand
2013-11-26 08:38:26 -08:00
Yuichi Nishiwaki
f6bc51d16d
add xlen/xcapa member to pic_senv
2013-11-26 08:36:58 -08:00
Yuichi Nishiwaki
a32473ae92
add core syntaces in pic_open
2013-11-26 08:35:35 -08:00
Yuichi Nishiwaki
a2e1f21b29
add global identifier table
2013-11-26 08:30:30 -08:00
Yuichi Nishiwaki
673b66a723
use register_core_symbol macro to initialize pic_state
2013-11-26 06:40:48 -08:00
Yuichi Nishiwaki
ad3c268f81
insert renamer pass after old macroexpansion phase
2013-11-26 04:08:46 -08:00
Yuichi Nishiwaki
1ad562f1a8
[wip] add renamer
2013-11-26 04:06:46 -08:00
Yuichi Nishiwaki
573ba79782
[bugfix] log10 must not be given 0
2013-11-26 04:06:03 -08:00
Yuichi Nishiwaki
b7f0f3dfb3
[bugfix] get rid of a comma
2013-11-26 04:05:37 -08:00
Yuichi Nishiwaki
c59d8f601b
add PIC_TT_SENV and PIC_TT_SYNTAX
2013-11-26 04:05:02 -08:00
Yuichi Nishiwaki
3c65025394
add macro.h
2013-11-26 04:03:52 -08:00
Yuichi Nishiwaki
bf6a337a5f
add pic_cxxr functions
2013-11-26 02:42:13 -08:00
Yuichi Nishiwaki
72cf45d4ea
add `new_uniq_sym` function
2013-11-25 23:38:39 -08:00
Yuichi Nishiwaki
4701f86ff0
fix a grammar error
2013-11-26 16:22:49 +09:00
Yuichi Nishiwaki
52f1776b22
cleanup
2013-11-25 11:10:57 +09:00
Yuichi Nishiwaki
f11623f075
add_heap_page should not be invoked in gc_alloc, but should be in obj_alloc
2013-11-25 00:24:03 +09:00
Yuichi Nishiwaki
df20de5285
push back dead objects to free list
2013-11-25 00:22:32 +09:00
Yuichi Nishiwaki
40bfe13895
add a comment to sweep algorithm
2013-11-22 07:30:29 -08:00
Yuichi Nishiwaki
563b65efde
s/expand.c/macro.c/
2013-11-22 07:22:52 -08:00
Yuichi Nishiwaki
579735d16e
s/heap_page/pic_heap/g
2013-11-22 07:19:31 -08:00
Yuichi Nishiwaki
e6523730a4
pluggable heap pages
2013-11-22 07:12:03 -08:00
Yuichi Nishiwaki
1be72f1e18
rewrite gc!
2013-11-22 06:38:29 -08:00
Yuichi Nishiwaki
2dd293c0f9
[workaround] add stack overflow detector
2013-11-22 06:37:57 -08:00
Yuichi Nishiwaki
0a521c2314
add overflow guards to some global stacks (or value pools)
2013-11-22 06:35:51 -08:00
Yuichi Nishiwaki
23b806cc41
print propagated error messages when stdlib failed to build
2013-11-22 06:34:34 -08:00
Yuichi Nishiwaki
4b326e4f6e
add new compilation flag GC_DEBUG_DETAIL
2013-11-22 03:29:05 -08:00
Yuichi Nishiwaki
4004282e50
alloc stacks by calloc, not malloc
2013-11-22 03:28:09 -08:00
Yuichi Nishiwaki
626c0adb3a
fix broken pic_type_repr
2013-11-22 03:27:09 -08:00
Yuichi Nishiwaki
f610424ae5
remove unnecessary protect
2013-11-22 01:53:22 -08:00
Yuichi Nishiwaki
05b2717b9e
less memory usage of pic_reverse
2013-11-21 06:32:56 -08:00
Yuichi Nishiwaki
00fc0ee931
protect more objects during expansion
2013-11-21 06:31:32 -08:00
Yuichi Nishiwaki
f146287eff
load_stdlib releases arena objects every time evaluating exprssion
2013-11-21 06:30:33 -08:00
Yuichi Nishiwaki
6581177ec5
realloc pic->irep when exhausted
2013-11-21 06:28:43 -08:00
Yuichi Nishiwaki
58b9e2cb60
debug prints when a global stack is realloc'ed
2013-11-21 06:28:06 -08:00
Yuichi Nishiwaki
e49ddbd13b
[bugfix] makeing a shared library failure under the version 3 of bison
2013-11-18 20:47:20 +09:00
Yuichi Nishiwaki
ed0b02ecfa
fixed #5 (again)
2013-11-18 20:38:03 +09:00
Yuichi Nishiwaki
d2bb4ad4f2
Revert "(maybe) fix #5 "
...
This reverts commit a3ac65a75f
.
2013-11-18 20:36:30 +09:00
Yuichi Nishiwaki
a3ac65a75f
(maybe) fix #5
2013-11-18 20:35:27 +09:00
Yuichi Nishiwaki
d5f01595b0
fixed #4
2013-11-18 20:24:09 +09:00
Yuichi Nishiwaki
6f94202e13
s/pic_expand/pic_macroexpand/g
2013-11-18 16:36:44 +09:00
Yuichi Nishiwaki
a3c2dabcc7
add feature function
2013-11-18 01:46:28 +09:00
Yuichi Nishiwaki
0d952d3639
add string functions
2013-11-18 01:09:54 +09:00
Yuichi Nishiwaki
6cfbe51c87
pic_get_args: change type of argc
2013-11-18 01:07:51 +09:00
Yuichi Nishiwaki
6ac3055816
change return type of pic_str_new to struct pic_string *
2013-11-18 00:28:42 +09:00
Yuichi Nishiwaki
d4188e0969
add error function
2013-11-17 18:16:03 +09:00
Yuichi Nishiwaki
5ffb4eb6c9
add string?
2013-11-17 17:42:52 +09:00
Yuichi Nishiwaki
9526ca789a
free as many as possible!
2013-11-17 17:33:28 +09:00
Yuichi Nishiwaki
fdc9bfea4e
initial exception handling support
2013-11-17 17:25:26 +09:00
Yuichi Nishiwaki
5668ae1b29
[bugfix] local variables should be initialized before copied to env object
2013-11-17 17:24:37 +09:00
Yuichi Nishiwaki
737f916a8c
add pic_errorf
2013-11-17 17:23:13 +09:00
Yuichi Nishiwaki
224b08fb92
[bugfix] after save_cont any local variable must not be modified!
...
If save_cont returns a cont object, a local variable will receive the
object and the machine stack state will have just been changed then.
To avoid that, we need set cont object to the local before the machine
stack is copied.
2013-11-17 17:20:19 +09:00
Yuichi Nishiwaki
38988b7770
add global exception handler stack
2013-11-17 16:02:58 +09:00
Yuichi Nishiwaki
c79e08632c
when restoring continuation sp and ci must be re-allocated
2013-11-17 15:58:53 +09:00
Yuichi Nishiwaki
5947240614
[bugfix] fix crash on deeply nested lambdas
2013-11-17 13:12:59 +09:00
Yuichi Nishiwaki
14ad038051
wipe reallocated cv_tbl
2013-11-17 13:10:36 +09:00
Yuichi Nishiwaki
242a366cbf
check vector index out of range
2013-11-17 02:32:27 +09:00
Yuichi Nishiwaki
1ef3ed91a2
fix for-each compilation bug
2013-11-16 23:32:34 +09:00
Yuichi Nishiwaki
a68b470e06
pic_get_args can parse '*'
2013-11-15 22:53:41 +09:00
Yuichi Nishiwaki
c57f1bfbe1
define math comp predicates as C functions
2013-11-15 22:51:51 +09:00
Yuichi Nishiwaki
e94aaffd34
shrink default arena size!
2013-11-15 19:54:47 +09:00
Yuichi Nishiwaki
9cdca8bc70
implement yy arena gc
2013-11-15 19:40:31 +09:00
Yuichi Nishiwaki
690f66dd76
s/is_marked/gc_is_marked/g
2013-11-15 19:32:01 +09:00
Yuichi Nishiwaki
f506eac3dd
add pic_obj_alloc_unsafe; preparation for yy_arena
2013-11-15 19:31:17 +09:00