diff options
| author | Alasdair Armstrong | 2017-09-21 18:31:49 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-09-21 18:31:49 +0100 |
| commit | 669bfc2cd34bda80e69ba6c75edbd3e4d57114cd (patch) | |
| tree | 8638cbd82f46433b8ae574cb04a924735005b90c /src/parser.mly | |
| parent | b097466ab11fd035dbfd5c7c51ea0644c62b92da (diff) | |
Refactored AST valspecs into single constructor
Diffstat (limited to 'src/parser.mly')
| -rw-r--r-- | src/parser.mly | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/parser.mly b/src/parser.mly index 8e7d81c6..dd0981fc 100644 --- a/src/parser.mly +++ b/src/parser.mly @@ -51,6 +51,10 @@ let locn m n = Range(Parsing.rhs_start_pos m,Parsing.rhs_end_pos n) let idl i = Id_aux(i, loc()) +let string_of_id = function + | Id_aux (Id str, _) -> str + | Id_aux (DeIid str, _) -> str + let efl e = BE_aux(e, loc()) let ploc p = P_aux(p,loc ()) @@ -1041,21 +1045,21 @@ fun_def: val_spec: | Val typquant typ id - { vloc (VS_val_spec(mk_typschm $2 $3 2 3,$4)) } + { vloc (VS_val_spec(mk_typschm $2 $3 2 3,$4, None, false)) } | Val typ id - { vloc (VS_val_spec(mk_typschm (mk_typqn ()) $2 2 2,$3)) } + { vloc (VS_val_spec(mk_typschm (mk_typqn ()) $2 2 2,$3, None, false)) } | Val Cast typquant typ id - { vloc (VS_cast_spec (mk_typschm $3 $4 3 4,$5)) } + { vloc (VS_val_spec (mk_typschm $3 $4 3 4,$5, None, true)) } | Val Cast typ id - { vloc (VS_cast_spec (mk_typschm (mk_typqn ()) $3 3 3, $4)) } + { vloc (VS_val_spec (mk_typschm (mk_typqn ()) $3 3 3, $4, None, true)) } | Val Extern typquant typ id - { vloc (VS_extern_no_rename (mk_typschm $3 $4 3 4,$5)) } + { vloc (VS_val_spec (mk_typschm $3 $4 3 4,$5, Some (string_of_id $5), false)) } | Val Extern typ id - { vloc (VS_extern_no_rename (mk_typschm (mk_typqn ()) $3 3 3, $4)) } + { vloc (VS_val_spec (mk_typschm (mk_typqn ()) $3 3 3, $4, Some (string_of_id $4), false)) } | Val Extern typquant typ id Eq String - { vloc (VS_extern_spec (mk_typschm $3 $4 3 4,$5,$7)) } + { vloc (VS_val_spec (mk_typschm $3 $4 3 4,$5, Some $7, false)) } | Val Extern typ id Eq String - { vloc (VS_extern_spec (mk_typschm (mk_typqn ()) $3 3 3,$4, $6)) } + { vloc (VS_val_spec (mk_typschm (mk_typqn ()) $3 3 3,$4, Some $6, false)) } kinded_id: | tyvar |
