@@ -164,17 +164,16 @@ emit-line: func [prefix word cmt /var /define /code /decl /up1 /local str][
164
164
165
165
str: any [
166
166
if define [rejoin [prefix str]]
167
- if code [rejoin [" " prefix str cmt]]
167
+ if code [rejoin [tab prefix str cmt]]
168
168
if decl [rejoin [prefix str cmt]]
169
- rejoin [" " prefix str "," ]
169
+ rejoin [tab prefix str "," ]
170
170
]
171
171
if any [code decl] [cmt: none]
172
172
if cmt [
173
- len: 31 - length? str
174
- loop to-integer len / 4 [append str tab]
173
+ append /dup str #" " (31 - length? str)
175
174
any [
176
175
if define [repend str cmt]
177
- if cmt [repend str ["// " cmt]]
176
+ if cmt [repend str ["// " cmt]]
178
177
]
179
178
]
180
179
append str newline
@@ -187,7 +186,7 @@ emit-head: func [title [string!] file [file!]] [
187
186
]
188
187
189
188
emit-end : func [ /easy ] [
190
- if not easy [remove find/last out #"," ]
189
+ if not easy [change find/last out #"," #" " ]
191
190
append out {^} ;^/ }
192
191
]
193
192
@@ -720,9 +719,13 @@ emit {
720
719
SYM_NOT_USED = 0,
721
720
}
722
721
722
+ used-words: copy []
723
+
723
724
n: 1
724
725
foreach :type-record boot-types [
725
- emit-line "SYM_" join type "_type" n
726
+ word: join type "_type"
727
+ append used-words to-c-name word
728
+ emit-line "SYM_" word n
726
729
n: n + 1
727
730
]
728
731
@@ -731,9 +734,25 @@ boot-words: load %words.r
731
734
replace boot-words '*port-modes* load %modes.r
732
735
733
736
foreach word boot-words [
737
+ append used-words to-c-name word
734
738
emit-line "SYM_" word reform [n "-" word]
735
739
n: n + 1
736
740
]
741
+
742
+ if exists? %../boot/tmp-symbols.r [
743
+ emit {^/ // follows symbols used in C sources, but not defined in %words.r list...^/ }
744
+
745
+ foreach word load %../boot/tmp-symbols.r [
746
+ if not find used-words word [
747
+ append boot-words to word! lowercase word
748
+ emit-line "SYM_" word form n
749
+ n: n + 1
750
+ ]
751
+ ]
752
+
753
+ delete %../boot/tmp-symbols.r
754
+ ]
755
+
737
756
emit-end
738
757
739
758
;-- Generate Action Constants ------------------------------------------------
0 commit comments