Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 22, 2021. It is now read-only.

Commit 9b4d86f

Browse files
committed
[spec] Replace some odd whitespace
1 parent efb35b2 commit 9b4d86f

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

document/core/appendix/algorithm.rst

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,24 @@ The control stack is likewise manipulated through auxiliary functions:
107107
.. code-block:: pseudo
108108
109109
func push_ctrl(opcode : opcode, in : list(val_type), out : list(val_type)) =
110-
 let frame = ctrl_frame(opcode, in, out, vals.size(), false)
111-
  ctrls.push(frame)
110+
let frame = ctrl_frame(opcode, in, out, vals.size(), false)
111+
ctrls.push(frame)
112112
push_vals(in)
113113
114114
func pop_ctrl() : ctrl_frame =
115-
 error_if(ctrls.is_empty())
116-
 let frame = ctrls[0]
117-
  pop_vals(frame.end_types)
118-
  error_if(vals.size() =/= frame.height)
115+
error_if(ctrls.is_empty())
116+
let frame = ctrls[0]
117+
pop_vals(frame.end_types)
118+
error_if(vals.size() =/= frame.height)
119119
ctrls.pop()
120-
  return frame
120+
return frame
121121
122122
func label_types(frame : ctrl_frame) : list(val_types) =
123123
return (if frame.opcode == loop then frame.start_types else frame.end_types)
124124
125125
func unreachable() =
126-
  vals.resize(ctrls[0].height)
127-
  ctrls[0].unreachable := true
126+
vals.resize(ctrls[0].height)
127+
ctrls[0].unreachable := true
128128
129129
Pushing a control frame takes the types of the label and result values.
130130
It allocates a new frame record recording them along with the current height of the operand stack and marks the block as reachable.
@@ -182,8 +182,8 @@ Other instructions are checked in a similar manner.
182182
pop_val(t)
183183
push_val(t)
184184
185-
   case (unreachable)
186-
      unreachable()
185+
case (unreachable)
186+
unreachable()
187187
188188
case (block t1*->t2*)
189189
pop_vals([t1*])
@@ -208,26 +208,26 @@ Other instructions are checked in a similar manner.
208208
push_ctrl(else, frame.start_types, frame.end_types)
209209
210210
case (br n)
211-
     error_if(ctrls.size() < n)
212-
      pop_vals(label_types(ctrls[n]))
213-
      unreachable()
211+
error_if(ctrls.size() < n)
212+
pop_vals(label_types(ctrls[n]))
213+
unreachable()
214214
215215
case (br_if n)
216-
     error_if(ctrls.size() < n)
216+
error_if(ctrls.size() < n)
217217
pop_val(I32)
218-
      pop_vals(label_types(ctrls[n]))
219-
      push_vals(label_types(ctrls[n]))
218+
pop_vals(label_types(ctrls[n]))
219+
push_vals(label_types(ctrls[n]))
220220
221-
   case (br_table n* m)
221+
case (br_table n* m)
222222
pop_val(I32)
223-
      error_if(ctrls.size() < m)
223+
error_if(ctrls.size() < m)
224224
let arity = label_types(ctrls[m]).size()
225-
      foreach (n in n*)
226-
        error_if(ctrls.size() < n)
227-
        error_if(label_types(ctrls[n]).size() =/= arity)
225+
foreach (n in n*)
226+
error_if(ctrls.size() < n)
227+
error_if(label_types(ctrls[n]).size() =/= arity)
228228
push_vals(pop_vals(label_types(ctrls[n])))
229229
pop_vals(label_types(ctrls[m]))
230-
      unreachable()
230+
unreachable()
231231
232232
233233
.. note::

0 commit comments

Comments
 (0)