Skip to content

Commit 0713085

Browse files
Uniform code indentation
1 parent d7f0909 commit 0713085

File tree

4 files changed

+219
-219
lines changed

4 files changed

+219
-219
lines changed

xml/chapter5/section4/subsection1.xml

Lines changed: 97 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,30 @@
5151
</SCHEME>
5252
<JAVASCRIPT>
5353
<!-- \indcode*{eval-dispatch} -->
54-
"eval_dispatch",
55-
test(op("is_self_evaluating"), reg("exp")),
56-
branch(label("ev_self_eval")),
57-
test(op("is_name"), reg("exp")),
58-
branch(label("ev_name")),
59-
60-
test(op("is_variable_declaration"), reg("exp")),
61-
branch(label("ev_variable_declaration")),
62-
test(op("is_constant_declaration"), reg("exp")),
63-
branch(label("ev_constant_declaration")),
64-
test(op("is_assignment"), reg("exp")),
65-
branch(label("ev_assignment")),
66-
67-
test(op("is_conditional_expression"), reg("exp")),
68-
branch(label("ev_if")),
69-
test(op("is_function_definition"), reg("exp")),
70-
branch(label("ev_lambda")),
71-
test(op("is_sequence"), reg("exp")),
72-
branch(label("ev_seq")),
73-
test(op("is_block"), reg("exp")),
74-
branch(label("ev_block")),
75-
test(op("is_application"), reg("exp")),
76-
branch(label("ev_application")),
77-
go_to(label("unknown_expression_type")),
54+
"eval_dispatch",
55+
test(op("is_self_evaluating"), reg("exp")),
56+
branch(label("ev_self_eval")),
57+
test(op("is_name"), reg("exp")),
58+
branch(label("ev_name")),
59+
60+
test(op("is_variable_declaration"), reg("exp")),
61+
branch(label("ev_variable_declaration")),
62+
test(op("is_constant_declaration"), reg("exp")),
63+
branch(label("ev_constant_declaration")),
64+
test(op("is_assignment"), reg("exp")),
65+
branch(label("ev_assignment")),
66+
67+
test(op("is_conditional_expression"), reg("exp")),
68+
branch(label("ev_if")),
69+
test(op("is_function_definition"), reg("exp")),
70+
branch(label("ev_lambda")),
71+
test(op("is_sequence"), reg("exp")),
72+
branch(label("ev_seq")),
73+
test(op("is_block"), reg("exp")),
74+
branch(label("ev_block")),
75+
test(op("is_application"), reg("exp")),
76+
branch(label("ev_application")),
77+
go_to(label("unknown_expression_type")),
7878
</JAVASCRIPT>
7979
</SNIPPET>
8080
</TEXT>
@@ -215,14 +215,14 @@
215215
(goto (label eval-dispatch))
216216
</SCHEME>
217217
<JAVASCRIPT>
218-
"ev_application",
219-
save("continue"),
220-
save("env"),
221-
assign("unev", list(op("operands"), reg("exp"))),
222-
save("unev"),
223-
assign("exp", list(op("operator"), reg("exp"))),
224-
assign("continue", label("ev_appl_did_operator")),
225-
go_to(label("eval_dispatch")),
218+
"ev_application",
219+
save("continue"),
220+
save("env"),
221+
assign("unev", list(op("operands"), reg("exp"))),
222+
save("unev"),
223+
assign("exp", list(op("operator"), reg("exp"))),
224+
assign("continue", label("ev_appl_did_operator")),
225+
go_to(label("eval_dispatch")),
226226
</JAVASCRIPT>
227227
</SNIPPET>
228228
</TEXT>
@@ -294,14 +294,14 @@ function is_last_operand(ops) {
294294
(save proc)
295295
</SCHEME>
296296
<JAVASCRIPT>
297-
"ev_appl_did_operator",
298-
restore("unev"), // the operands
299-
restore("env"),
300-
assign("argl", list(op("empty_arglist"))),
301-
assign("fun", list(reg("val"))), // the operator
302-
test(op("has_no_operands"), reg("unev")),
303-
branch(label("apply_dispatch")),
304-
save("fun"),
297+
"ev_appl_did_operator",
298+
restore("unev"), // the operands
299+
restore("env"),
300+
assign("argl", list(op("empty_arglist"))),
301+
assign("fun", list(reg("val"))), // the operator
302+
test(op("has_no_operands"), reg("unev")),
303+
branch(label("apply_dispatch")),
304+
save("fun"),
305305
</JAVASCRIPT>
306306
</SNIPPET>
307307
</TEXT>
@@ -330,15 +330,15 @@ function is_last_operand(ops) {
330330
(goto (label eval-dispatch))
331331
</SCHEME>
332332
<JAVASCRIPT>
333-
"ev_appl_operand_loop",
334-
save("argl"),
335-
assign("exp", list(op("first_operand"), reg("unev"))),
336-
test(op("is_last_operand"), reg("unev")),
337-
branch(label("ev_appl_last_arg")),
338-
save("env"),
339-
save("unev"),
340-
assign("continue", label("ev_appl_accumulate_arg")),
341-
go_to(label("eval_dispatch")),
333+
"ev_appl_operand_loop",
334+
save("argl"),
335+
assign("exp", list(op("first_operand"), reg("unev"))),
336+
test(op("is_last_operand"), reg("unev")),
337+
branch(label("ev_appl_last_arg")),
338+
save("env"),
339+
save("unev"),
340+
assign("continue", label("ev_appl_accumulate_arg")),
341+
go_to(label("eval_dispatch")),
342342
</JAVASCRIPT>
343343
</SNIPPET>
344344
</TEXT>
@@ -359,13 +359,13 @@ function is_last_operand(ops) {
359359
(goto (label ev-appl-operand-loop))
360360
</SCHEME>
361361
<JAVASCRIPT>
362-
"ev_appl_accumulate_arg",
363-
restore("unev"),
364-
restore("env"),
365-
restore("argl"),
366-
assign("argl", list(op("adjoin_arg"), reg("val"), reg("argl"))),
367-
assign("unev", list(op("rest_operands"), reg("unev"))),
368-
go_to(label("ev_appl_operand_loop")),
362+
"ev_appl_accumulate_arg",
363+
restore("unev"),
364+
restore("env"),
365+
restore("argl"),
366+
assign("argl", list(op("adjoin_arg"), reg("val"), reg("argl"))),
367+
assign("unev", list(op("rest_operands"), reg("unev"))),
368+
go_to(label("ev_appl_operand_loop")),
369369
</JAVASCRIPT>
370370
</SNIPPET>
371371
</TEXT>
@@ -407,15 +407,15 @@ function is_last_operand(ops) {
407407
(goto (label apply-dispatch))
408408
</SCHEME>
409409
<JAVASCRIPT>
410-
"ev_appl_last_arg",
411-
assign("continue", label("ev_appl_accum_last_arg")),
412-
go_to(label("eval_dispatch")),
410+
"ev_appl_last_arg",
411+
assign("continue", label("ev_appl_accum_last_arg")),
412+
go_to(label("eval_dispatch")),
413413

414-
"ev_appl_accum_last_arg",
415-
restore("argl"),
416-
assign("argl", list(op("adjoin_arg"), reg("val"), reg("argl"))),
417-
restore("fun"),
418-
go_to(label("apply_dispatch")),
414+
"ev_appl_accum_last_arg",
415+
restore("argl"),
416+
assign("argl", list(op("adjoin_arg"), reg("val"), reg("argl"))),
417+
restore("fun"),
418+
go_to(label("apply_dispatch")),
419419
</JAVASCRIPT>
420420
</SNIPPET>
421421
</TEXT>
@@ -477,12 +477,12 @@ function is_last_operand(ops) {
477477
(goto (label unknown-procedure-type))
478478
</SCHEME>
479479
<JAVASCRIPT>
480-
"apply_dispatch",
481-
test(op("is_primitive_function"), reg("fun")),
482-
branch(label("primitive_apply")),
483-
test(op("is_compound_function"), reg("fun")),
484-
branch(label("compound_apply")),
485-
go_to(label("unknown_procedure_type")),
480+
"apply_dispatch",
481+
test(op("is_primitive_function"), reg("fun")),
482+
branch(label("primitive_apply")),
483+
test(op("is_compound_function"), reg("fun")),
484+
branch(label("compound_apply")),
485+
go_to(label("unknown_procedure_type")),
486486
</JAVASCRIPT>
487487
</SNIPPET>
488488
</TEXT>
@@ -533,13 +533,13 @@ function is_last_operand(ops) {
533533
(goto (reg continue))
534534
</SCHEME>
535535
<JAVASCRIPT>
536-
"primitive_apply",
537-
assign(
538-
"val",
539-
list(op("apply_primitive_function"), reg("fun"), reg("argl"))
540-
),
541-
restore("continue"),
542-
go_to(reg("continue")),
536+
"primitive_apply",
537+
assign(
538+
"val",
539+
list(op("apply_primitive_function"), reg("fun"), reg("argl"))
540+
),
541+
restore("continue"),
542+
go_to(reg("continue")),
543543
</JAVASCRIPT>
544544
</SNIPPET>
545545
</TEXT>
@@ -571,26 +571,26 @@ function is_last_operand(ops) {
571571
(goto (label ev-sequence))
572572
</SCHEME>
573573
<JAVASCRIPT>
574-
"compound_apply",
575-
assign("unev", list(op("function_parameters"), reg("fun"))), // params
576-
// FIXME: A QUICK HACK HERE, UNSURE WHY IT'S NEEDED
577-
assign("unev", list(op("all_names_of_names"), reg("unev"))), // params destructured
578-
579-
assign("temp", list(op("function_body"), reg("fun"))), // body
580-
assign("temp", list(op("local_names"), reg("unev"))), // locals
581-
582-
assign("unev", list(op("insert_all"), reg("unev"), reg("temp"))), //names
583-
assign("temp", list(op("get_temp_block_values"), reg("temp"))), // temp_values
584-
585-
assign("temp", list(op("append"), reg("argl"), reg("temp"))), // values
586-
assign("env", list(op("function_environment"), reg("fun"))),
587-
588-
assign(
589-
"env",
590-
list(op("extend_environment"), reg("unev"), reg("temp"), reg("env"))
591-
),
592-
assign("unev", list(op("function_body"), reg("fun"))),
593-
go_to(label("ev_sequence")),
574+
"compound_apply",
575+
assign("unev", list(op("function_parameters"), reg("fun"))), // params
576+
// FIXME: A QUICK HACK HERE, UNSURE WHY IT'S NEEDED
577+
assign("unev", list(op("all_names_of_names"), reg("unev"))), // params destructured
578+
579+
assign("temp", list(op("function_body"), reg("fun"))), // body
580+
assign("temp", list(op("local_names"), reg("unev"))), // locals
581+
582+
assign("unev", list(op("insert_all"), reg("unev"), reg("temp"))), //names
583+
assign("temp", list(op("get_temp_block_values"), reg("temp"))), // temp_values
584+
585+
assign("temp", list(op("append"), reg("argl"), reg("temp"))), // values
586+
assign("env", list(op("function_environment"), reg("fun"))),
587+
588+
assign(
589+
"env",
590+
list(op("extend_environment"), reg("unev"), reg("temp"), reg("env"))
591+
),
592+
assign("unev", list(op("function_body"), reg("fun"))),
593+
go_to(label("ev_sequence")),
594594
</JAVASCRIPT>
595595
</SNIPPET>
596596
</TEXT>

xml/chapter5/section4/subsection2.xml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,28 @@
8686
(goto (label eval-dispatch))
8787
</SCHEME>
8888
<JAVASCRIPT>
89-
"ev_seq", //FIXME: not part of original book -- explain why needed
90-
save("continue"),
91-
assign("unev", list(op("sequence_statements"), reg("exp"))),
92-
93-
"ev_sequence",
94-
assign("exp", list(op("first_statement"), reg("unev"))),
95-
test(op("is_last_statement"), reg("unev")),
96-
branch(label("ev_sequence_last_exp")),
97-
save("unev"),
98-
save("env"),
99-
assign("continue", label("ev_sequence_continue")),
100-
go_to(label("eval_dispatch")),
101-
102-
"ev_sequence_continue",
103-
restore("env"),
104-
restore("unev"),
105-
assign("unev", list(op("rest_statements"), reg("unev"))),
106-
go_to(label("ev_sequence")),
107-
108-
"ev_sequence_last_exp",
109-
restore("continue"),
110-
go_to(label("eval_dispatch")),
89+
"ev_seq", //FIXME: not part of original book -- explain why needed
90+
save("continue"),
91+
assign("unev", list(op("sequence_statements"), reg("exp"))),
92+
93+
"ev_sequence",
94+
assign("exp", list(op("first_statement"), reg("unev"))),
95+
test(op("is_last_statement"), reg("unev")),
96+
branch(label("ev_sequence_last_exp")),
97+
save("unev"),
98+
save("env"),
99+
assign("continue", label("ev_sequence_continue")),
100+
go_to(label("eval_dispatch")),
101+
102+
"ev_sequence_continue",
103+
restore("env"),
104+
restore("unev"),
105+
assign("unev", list(op("rest_statements"), reg("unev"))),
106+
go_to(label("ev_sequence")),
107+
108+
"ev_sequence_last_exp",
109+
restore("continue"),
110+
go_to(label("eval_dispatch")),
111111
</JAVASCRIPT>
112112
</SNIPPET>
113113
</TEXT>
@@ -132,11 +132,11 @@
132132
x)))
133133
</SCHEME>
134134
<JAVASCRIPT>
135-
function sqrt_iter(guess, x) {
136-
return is_good_enough(guess, x)
137-
? guess
138-
: sqrt_iter(improve(guess, x), x);
139-
}
135+
function sqrt_iter(guess, x) {
136+
return is_good_enough(guess, x)
137+
? guess
138+
: sqrt_iter(improve(guess, x), x);
139+
}
140140
</JAVASCRIPT>
141141
</SNIPPET>
142142
is an iterative process. Even though the
@@ -234,23 +234,23 @@ function has_no_more_exps(seq) {
234234
(goto (reg continue))
235235
</SCHEME>
236236
<JAVASCRIPT>
237-
<!-- \indcode*{ev-sequence}[without tail recursion] -->
238-
"ev_sequence",
239-
test(op("has_no_more_exps"), reg("unev")),
240-
branch(label("ev_sequence_end")),
241-
assign(exp(op("first_exp"), reg("unev")),
242-
save("unev"),
243-
save("env"),
244-
assign(continue(label("ev_sequence_continue"))),
245-
go_to(label("eval_dispatch")),
246-
"ev_sequence_continue",
247-
restore("env"),
248-
restore("unev"),
249-
assign("unev", op("rest_exps"), reg("unev")),
250-
go_to(label("ev_sequence")),
251-
"ev_sequence_end",
252-
restore("continue"),
253-
go_to(reg("continue")),
237+
<!-- \indcode*{ev-sequence}[without tail recursion] -->
238+
"ev_sequence",
239+
test(op("has_no_more_exps"), reg("unev")),
240+
branch(label("ev_sequence_end")),
241+
assign(exp(op("first_exp"), reg("unev")),
242+
save("unev"),
243+
save("env"),
244+
assign(continue(label("ev_sequence_continue"))),
245+
go_to(label("eval_dispatch")),
246+
"ev_sequence_continue",
247+
restore("env"),
248+
restore("unev"),
249+
assign("unev", op("rest_exps"), reg("unev")),
250+
go_to(label("ev_sequence")),
251+
"ev_sequence_end",
252+
restore("continue"),
253+
go_to(reg("continue")),
254254
</JAVASCRIPT>
255255
</SNIPPET>
256256
</TEXT>

0 commit comments

Comments
 (0)