@@ -120,29 +120,17 @@ let lsts-parse-doc(tokens: List<Token>): Tuple<AST, List<Token>> = (
120
120
(let ax, let new-tags, tokens) = lsts-parse-doc-expr(tokens);
121
121
tags = tags + new-tags;
122
122
if non-zero(ax) {
123
- if non-zero(line) {
124
- line = mk-seq(line, ax);
125
- } else {
126
- line = ax;
127
- };
123
+ line = line + ax;
128
124
};
129
125
};
130
126
tokens = tail(tokens);
131
127
132
128
if non-zero(line) {
133
- if non-zero(para) {
134
- para = mk-seq(para, line);
135
- } else {
136
- para = line;
137
- };
129
+ para = para + line;
138
130
} else {
139
131
# empty line => new paragraph
140
132
if non-zero(para) {
141
- if non-zero(ast) {
142
- ast = mk-seq(ast, para);
143
- } else {
144
- ast = para;
145
- };
133
+ ast = ast + para;
146
134
para = ASTEOF;
147
135
};
148
136
};
@@ -212,7 +200,7 @@ let lsts-parse(tokens: List<Token>): Nil = (
212
200
[ Token{key:c"type"}.. _] => tokens = lsts-parse-typedef(tokens);
213
201
[ Token{key:c"typed"}.. Token{key:c"macro"}.. _] => (
214
202
(let bind, tokens) = lsts-parse-typed-macro(tokens);
215
- ast-parsed-program = mk-seq( ast-parsed-program, bind) ;
203
+ ast-parsed-program = ast-parsed-program + bind;
216
204
);
217
205
[ Token{key:c"interface"}.. _] => tokens = lsts-parse-interface(tokens);
218
206
[ Token{key:c"import"}.. rest] => (
@@ -235,13 +223,13 @@ let lsts-parse(tokens: List<Token>): Nil = (
235
223
};
236
224
let constructor = head(tokens); tokens = tail(tokens);
237
225
lsts-parse-expect(c";", tokens); tokens = tail(tokens);
238
- ast-parsed-program = mk-seq( ast-parsed-program, mk-app(
226
+ ast-parsed-program = ast-parsed-program + mk-app(
239
227
Var{ c"macro::define-zero", with-key(constructor, c"macro::define-zero") },
240
228
mk-cons(
241
229
AType{ base-type-rest.first },
242
230
Lit{ constructor.key, constructor }
243
231
)
244
- )) ;
232
+ );
245
233
);
246
234
[ Token{key:c"atom"}.. Token{key:c"suffix"}.. rest] => (
247
235
tokens = rest;
@@ -261,13 +249,13 @@ let lsts-parse(tokens: List<Token>): Nil = (
261
249
let term-rest = lsts-parse-small-expression(tokens);
262
250
let term = term-rest.first;
263
251
tokens = term-rest.second;
264
- ast-parsed-program = mk-seq( ast-parsed-program, term) ;
252
+ ast-parsed-program = ast-parsed-program + term;
265
253
lsts-parse-expect(c";",tokens); tokens = tail(tokens);
266
254
);
267
255
};
268
256
if is(prev-tokens, tokens) { fail("Unrecognized Token During Parsing: \{lsts-parse-head(tokens)}\n") };
269
257
if non-zero(docx) {
270
- ast-parsed-program = mk-seq( ast-parsed-program, mk-meta(docx) );
258
+ ast-parsed-program = ast-parsed-program + mk-meta(docx);
271
259
};
272
260
};
273
261
);
@@ -789,10 +777,7 @@ let lsts-parse-typedef(tokens: List<Token>): List<Token> = (
789
777
cases = mk-cons(mk-cons(cases, Var{ bar.key, bar }), case-rest.first);
790
778
};
791
779
lsts-parse-expect(c";", tokens); tokens = tail(tokens);
792
- ast-parsed-program = mk-seq(
793
- ast-parsed-program,
794
- mk-typedef(AType{ base-rest.first }, cases)
795
- );
780
+ ast-parsed-program = ast-parsed-program + mk-typedef(AType{ base-rest.first }, cases);
796
781
} else if mode==c"alias" {
797
782
lsts-parse-expect(c"=", tokens); tokens = tail(tokens);
798
783
let case-rest = lsts-parse-type(tokens);
@@ -933,18 +918,14 @@ let lsts-parse-let(tokens: List<Token>): List<Token> = (
933
918
);
934
919
};
935
920
} else {
936
- ast-parsed-program = mk-seq(
937
- ast-parsed-program,
921
+ ast-parsed-program = ast-parsed-program +
938
922
mk-glb( with-location(mk-token(name),loc), mk-abs(
939
923
args-list, return-term, misc-tt && attach-tt
940
- ) )
941
- );
924
+ ) );
942
925
};
943
926
} else {
944
- ast-parsed-program = mk-seq(
945
- ast-parsed-program,
946
- mk-glb( with-location(mk-token(name),loc), return-term )
947
- );
927
+ ast-parsed-program = ast-parsed-program +
928
+ mk-glb( with-location(mk-token(name),loc), return-term );
948
929
};
949
930
tokens
950
931
);
0 commit comments