Mercurial > repos > tabletprog
comparison modules/ast.tp @ 257:be224817a14b
Fix fold on ast nodes so that all nodes get visited
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 01 Jun 2014 17:20:29 -0700 |
parents | 004946743678 |
children | 98147071baf6 |
comparison
equal
deleted
inserted
replaced
256:03a07e540b9f | 257:be224817a14b |
---|---|
155 stringIndent: "" | 155 stringIndent: "" |
156 } | 156 } |
157 fold:with <- :acc :fun { | 157 fold:with <- :acc :fun { |
158 acc <- fun: acc self | 158 acc <- fun: acc self |
159 _args fold: acc with: :acc el { | 159 _args fold: acc with: :acc el { |
160 fun: acc el | 160 el fold: acc with: fun |
161 } | 161 } |
162 } | 162 } |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
177 stringIndent: "" | 177 stringIndent: "" |
178 } | 178 } |
179 fold:with <- :acc :fun { | 179 fold:with <- :acc :fun { |
180 acc <- fun: acc self | 180 acc <- fun: acc self |
181 messages fold: acc with: :acc el { | 181 messages fold: acc with: :acc el { |
182 fun: acc el | 182 el fold: acc with: fun |
183 } | 183 } |
184 } | 184 } |
185 } | 185 } |
186 } | 186 } |
187 | 187 |
200 stringIndent: "" | 200 stringIndent: "" |
201 } | 201 } |
202 fold:with <- :acc :fun { | 202 fold:with <- :acc :fun { |
203 acc <- fun: acc self | 203 acc <- fun: acc self |
204 els fold: acc with: :acc el { | 204 els fold: acc with: :acc el { |
205 fun: acc el | 205 el fold: acc with: fun |
206 } | 206 } |
207 } | 207 } |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
219 string <- { | 219 string <- { |
220 stringIndent: "" | 220 stringIndent: "" |
221 } | 221 } |
222 fold:with <- :acc :fun { | 222 fold:with <- :acc :fun { |
223 acc <- fun: acc self | 223 acc <- fun: acc self |
224 acc <- fun: acc _sym | 224 acc <- _sym fold: acc with: fun |
225 fun: acc _expr | 225 _expr fold: acc with: fun |
226 } | 226 } |
227 } | 227 } |
228 } | 228 } |
229 | 229 |
230 lambda:withArgs <- :_exprs :_args { | 230 lambda:withArgs <- :_exprs :_args { |
246 stringIndent: "" | 246 stringIndent: "" |
247 } | 247 } |
248 fold:with <- :acc :fun { | 248 fold:with <- :acc :fun { |
249 acc <- fun: acc self | 249 acc <- fun: acc self |
250 expressions fold: acc with: :acc el { | 250 expressions fold: acc with: :acc el { |
251 fun: acc el | 251 el fold: acc with: fun |
252 } | 252 } |
253 } | 253 } |
254 } | 254 } |
255 } | 255 } |
256 } | 256 } |