diff options
| author | Alasdair Armstrong | 2017-08-16 19:26:04 +0100 |
|---|---|---|
| committer | Alasdair Armstrong | 2017-08-16 19:26:04 +0100 |
| commit | 9f013687086937df8be81dd6a0ebd86fc750abf7 (patch) | |
| tree | 91c60d0b9f363bdffe3ac1b1d440b839162dd819 /src/parse_ast.ml | |
| parent | 3a61ca53dd501b501bcc6e076aac11243c38880a (diff) | |
Added the feature to bind type variables in patterns.
The reason you want this is to do something like (note new parser only):
*********
default Order dec
type bits 'n:Int = vector('n - 1, 'n, dec, bit)
val zeros : forall 'n. atom('n) -> bits('n)
val decode : bool -> unit
function decode b = {
let 'datasize: {|32, 64|} = if b then 32 else 64;
let imm: bits('datasize) = zeros(datasize);
()
}
*********
for the ASL decode functions, where the typechecker now knows that the
datasize variable and the length of imm are the same.
Diffstat (limited to 'src/parse_ast.ml')
| -rw-r--r-- | src/parse_ast.ml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/parse_ast.ml b/src/parse_ast.ml index 54feaf29..3951ab51 100644 --- a/src/parse_ast.ml +++ b/src/parse_ast.ml @@ -234,6 +234,7 @@ pat_aux = (* Pattern *) | P_as of pat * id (* named pattern *) | P_typ of atyp * pat (* typed pattern *) | P_id of id (* identifier *) + | P_var of kid | P_app of id * (pat) list (* union constructor pattern *) | P_record of (fpat) list * bool (* struct pattern *) | P_vector of (pat) list (* vector pattern *) |
