Skip to content

Commit

Permalink
CLAIRE 4.12 August 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ycaseau committed Aug 25, 2024
1 parent ea37ec4 commit f24e70d
Show file tree
Hide file tree
Showing 60 changed files with 49,922 additions and 46,801 deletions.
238 changes: 120 additions & 118 deletions compile/goexp.cl

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions compile/gogen.cl
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,4 @@ build_Variable(s:string,t:any) : Variable
-> if (g_clean(x) & c_type(x) != void) true
else false ]

// atIndex : print an integer "minus one"
[at_index(x:any) : void
-> case x (integer princ(x - 1), any (g_expression(x, integer), princ("-1"))) ]

8 changes: 7 additions & 1 deletion compile/gomain.cl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
about(),
printf("\noptions -s <int> : set memory allocation size \n"),
printf(" -f <filename> : load <filename> \n"),
printf(" -e \"<call>\" : evaluate expression such as <p(listargs)> \n"),
printf(" -n : do not load the init file \n"),
printf(" -m <module> : load <module> \n"),
printf(" -mx <module> : load <module> and launch main() \n"),
Expand Down Expand Up @@ -84,6 +85,11 @@
{"-s"} (if (length(l) >= 2) l :<< 2 else error("option: -s <s1> <s2>")),
{"-f"} (if (length(l) >= 2) (load(l[2]), l :<< 2)
else error("option: -f <filename>")),
{"-e"} (if (length(l) >= 2)
let c := read(l[2]) in
(l :<< 2,
case c (Call eval(c), any error("-e arg ~S is not a call",c)))
else error("option: -e <call>")),
{"-m"} (if (length(l) >= 2)
(if %init? (load("init"), %init? := false),
let m := string2module(l[2]) in
Expand Down Expand Up @@ -146,7 +152,7 @@
compile_dir(m),
compile(m),
if (%exe)
(//[0] ==== create the systel file for module ~S // %out,
(//[0] ==== create the system file for module ~S // %out,
claire/system_file(m,%out,%main), // v3.2.12: level = 0 => do nothing ....
compile_exe(%out)),
exit(0))
Expand Down
5 changes: 2 additions & 3 deletions compile/gostat.cl
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
// this reintrant compiling (calling g_statement on a expanded Let) works because Let checks if g_expression can be used
// the same pattern is used for call_slot/call_table


// this function is used to unfold complex expressions that should be compiled as
// expressions and not statements. It takes a list of arguments l and returns the
// embedded Lets that defines the necessary variable or nil (nothing is needed)
Expand Down Expand Up @@ -375,7 +374,7 @@ unfold_eid(ldef:list,self:any,s:class, v:any,err:boolean,loop:any) : void
[g_statement(self:If,s:class,v:string,err:boolean,loop:any) : void
-> let try? := g_throw(self.test) in
(if g_clean(self.test) // easy case
(printf("if ~I ", bool_exp(self.test, true)),
(printf("if ~I ", b_expression(PRODUCER,self.test, true)),
new_block("If"))
else let v2 := c_string(PRODUCER,gensym() /+ "I") in // use intermediary variable
(var_declaration(v2, boolean, 1),
Expand Down Expand Up @@ -615,7 +614,7 @@ unfold_eid(ldef:list,self:any,s:class, v:any,err:boolean,loop:any) : void
cast_prefix(boolean,s),
cast_post(boolean,s),
breakline()),
if f? printf("for ~I ",bool_exp(self.iClaire/test, true)) // while self.test = true ...
if f? printf("for ~I ",b_expression(PRODUCER,self.iClaire/test, true)) // while self.test = true ...
else
(if try? g_try(self.iClaire/test,v2,boolean,v,false)
else statement((if self.iClaire/other false else self.iClaire/test), boolean, v2,false),
Expand Down
352 changes: 202 additions & 150 deletions compile/gosystem.cl

Large diffs are not rendered by default.

Loading

0 comments on commit f24e70d

Please sign in to comment.