root/trunk/orca/boot_str.r

Revision 1, 0.6 kB (checked in by krobillard, 3 years ago)

Import orca & thune.

Line 
1REBOL [
2    Purpose: {Creates C include for boot script.}
3]
4
5
6do %boot.r
7
8if exists? %func.r [ append boot load %func.r ]
9
10block_to_c: func [blk cvar /local str] [
11    str: mold blk
12    remove back tail str
13    str: trim/auto skip str 2
14
15    append out rejoin [{static char } cvar {[] =^/}]
16
17    blk: parse/all str "^/"
18    forall blk [
19        str: blk/1
20        replace/all str {\} {\\}
21        replace/all str {"} {\"}
22        append out rejoin [{  "} str {\n"^/}]
23    ]
24
25    append out ";^/^/"
26]
27
28
29out: {// Automatically created by boot.r^/^/}
30
31block_to_c natives "_natives"
32block_to_c boot    "_boot"
33
34write %boot.c out
35
36
37;eof
Note: See TracBrowser for help on using the browser.