@@ -3755,10 +3755,6 @@ let ast-parsed-program = mk-eof();
37553755let parse-suffixes = [] : List<(CString,Type)>;
37563756non-zero(parse-suffixes); # TODO remove
37573757
3758- let config-v3 = true;
3759- let config-v1 = false;
3760- let config-v0 = false;
3761-
37623758let .skey(t: Token): String = intern(t.key);
37633759type AST implements DefaultFormattable;
37643760
@@ -5362,12 +5358,10 @@ let $"||"(lctx: Maybe<TypeContext>, rctx: Maybe<TypeContext>): Maybe<TypeContext
53625358
53635359let .phi-append(tctx-primary: TypeContext?, tctx-secondary: TypeContext?): TypeContext? = (
53645360 tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,false) )
5365- #tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,false).prune-moved )
53665361);
53675362
53685363let .phi-append-dead-on-arrival(tctx-primary: TypeContext?, tctx-secondary: TypeContext?): TypeContext? = (
53695364 tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,true) )
5370- # tctx-primary.with-pctx( tctx-primary.get-or(mk-tctx()).pctx.phi-append(tctx-secondary.get-or(mk-tctx()).pctx,true).prune-moved )
53715365);
53725366
53735367let .phi-append(tctx-primary: PBTree<U64,PhiContextRow>, tctx-secondary: PBTree<U64,PhiContextRow>, dead-on-arrival: Bool): PBTree<U64,PhiContextRow> = (
@@ -7752,9 +7746,7 @@ let std-infer-call-arg(tctx: TypeContext?, term: AST, function-name: CString, hi
77527746 }} else if function-name==c"map::cons" { match term {
77537747 App{k=left, m=right} => (
77547748 (tctx, let new-k) = std-infer-expr(tctx, k, false, Call(function-name), ta);
7755- let direct-hint = if config-v3 or config-v23
7756- then t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint")
7757- else t2(c"HashtableEq",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2);
7749+ let direct-hint = t2(c"Hashtable",typeof-term(new-k).normalize.slot(c"Cons",2).l1,typeof-term(new-k).normalize.slot(c"Cons",2).l2) && t0(c"ReturnHint");
77587750 (tctx, let new-m) = std-infer-expr(tctx, m, false, Used(), direct-hint);
77597751 if not(is(k,new-k)) or not(is(m,new-m)) then { k = new-k; m = new-m; term = mk-cons(k, m); };
77607752 tctx = tctx.ascript(term, t2(c"Cons",typeof-term(k),typeof-term(m)));
@@ -9168,7 +9160,6 @@ let ast-typed-count = 0_sz;
91689160let config-print-ast = false;
91699161
91709162let main(argc: C_int, argv: CString[]): Nil = (
9171- config-v23 = false;
91729163 let argi = 1_sz;
91739164 let input = [] : List<CString>;
91749165 let highlight = false;
@@ -9181,11 +9172,6 @@ let main(argc: C_int, argv: CString[]): Nil = (
91819172 c"--parse" => config-mode = ModeParse();
91829173 c"--preprocess" => config-mode = ModePreprocess();
91839174 c"--compile" => config-mode = ModeCompile();
9184- c"--v0" => (config-v3 = false; config-v0 = true;);
9185- c"--v1" => (config-v3 = false; config-v1 = true;);
9186- c"--v2" => config-v3 = false;
9187- c"--v23" => (config-v3 = false; config-v23 = true;);
9188- c"--v3" => config-v3 = true;
91899175 c"--highlight" => (
91909176 config-mode = ModeTokenize();
91919177 highlight = true;
@@ -13609,7 +13595,6 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
1360913595 lsts-parse-expect(c"[Type Tag]", tokens);
1361013596 };
1361113597 let base = lsts-substitute-type-aliases(lsts-parse-head(tokens)); tokens = tail(tokens);
13612- if not(config-v3) and not(config-v23) and base==c"Hashtable" then base = c"HashtableEq";
1361313598 while non-zero(tokens) and lsts-parse-head(tokens)==c":" and lsts-parse-head(tail(tokens))==c":" {
1361413599 lsts-parse-expect(c":", tokens); tokens = tail(tokens);
1361513600 lsts-parse-expect(c":", tokens); tokens = tail(tokens);
@@ -13633,11 +13618,7 @@ let lsts-parse-type-conjugate(tokens: List<Token>): Tuple<Type,List<Token>> = (
1363313618 };
1363413619 lsts-parse-expect(c">", tokens); tokens = tail(tokens);
1363513620 };
13636- if not(config-v3) and not(config-v23) and base==c"OwnedData" and args.length==1 {
13637- head(args);
13638- } else if base==c"CompatOwnedData" and args.length==1 {
13639- t1(c"OwnedData",head(args));
13640- } else ts( base, args );
13621+ ts( base, args );
1364113622 };
1364213623 while lsts-parse-head(tokens) == c"[" or lsts-parse-head(tokens)==c"?" {
1364313624 if lsts-parse-head(tokens)==c"[" {
@@ -13949,9 +13930,7 @@ let lsts-parse-mul(tokens: List<Token>): Tuple<AST,List<Token>> = (
1394913930
1395013931let lsts-parse-map(tokens: List<Token>): Tuple<AST,List<Token>> = (
1395113932 lsts-parse-expect(c"{", tokens); let loc = head(tokens).location; tokens = tail(tokens);
13952- let term = if config-v3 or config-v23
13953- then mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() )
13954- else Lit( c"HashtableEqEOF", with-location(mk-token("HashtableEqEOF"),loc) );
13933+ let term = mk-app( Var( c"mk-hashtable", with-location(mk-token("mk-hashtable"),loc) ), mk-nil() );
1395513934 if lsts-parse-head(tokens)==c"for" {
1395613935 fail("TODO map comprehension at \{loc}\n")
1395713936 } else {
@@ -14202,15 +14181,11 @@ let lsts-parse-typedef(tokens: List<Token>): (AST, List<Token>) = (
1420214181 lsts-parse-expect(c"implies", tokens); tokens = tail(tokens);
1420314182 (let i, tokens) = lsts-parse-type(tokens);
1420414183 if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
14205- else if config-v23 and i.is-t(c"MustRelease",0) then ()
14206- else if config-v23 and i.is-t(c"MustRetain",0) then ()
1420714184 else infers = infers.push(i);
1420814185 while lsts-parse-head(tokens)==c"," {
1420914186 lsts-parse-expect(c",", tokens); tokens = tail(tokens);
1421014187 (i, tokens) = lsts-parse-type(tokens);
1421114188 if i.is-t(c"CompatMustRelease",0) then infers = infers.push(t0(c"MustRelease"));
14212- else if config-v23 and i.is-t(c"MustRelease",0) then ()
14213- else if config-v23 and i.is-t(c"MustRetain",0) then ()
1421414189 else infers = infers.push(i);
1421514190 }
1421614191 };
0 commit comments