summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKathy Gray2013-11-29 10:36:50 +0000
committerKathy Gray2013-11-29 10:36:50 +0000
commitf335486bf254b882727fc373688b872a57de594c (patch)
treee71ee0576f4b9d62f550b002ad304adcb305f0bc /src
parentdcc2ec2e4e6a3fd9a393af64d45bdf659201da03 (diff)
minor syntax fixups
Diffstat (limited to 'src')
-rw-r--r--src/parser.mly24
-rw-r--r--src/test/test1.sail8
-rw-r--r--src/test/test3.sail10
3 files changed, 21 insertions, 21 deletions
diff --git a/src/parser.mly b/src/parser.mly
index 572408ea..4050885f 100644
--- a/src/parser.mly
+++ b/src/parser.mly
@@ -885,13 +885,13 @@ val_spec:
{ vloc (VS_val_spec(mk_typschm $2 $3 2 3,$4)) }
| Val typ id
{ vloc (VS_val_spec(mk_typschm (mk_typqn ()) $2 2 2,$3)) }
- | Val Extern typquant atomic_typ id
+ | Val Extern typquant typ id
{ vloc (VS_extern_no_rename (mk_typschm $3 $4 3 4,$5)) }
- | Val Extern atomic_typ id
+ | Val Extern typ id
{ vloc (VS_extern_no_rename (mk_typschm (mk_typqn ()) $3 3 3, $4)) }
- | Val Extern typquant atomic_typ id Eq String
+ | Val Extern typquant typ id Eq String
{ vloc (VS_extern_spec (mk_typschm $3 $4 3 4,$5,$7)) }
- | Val Extern atomic_typ id Eq String
+ | Val Extern typ id Eq String
{ vloc (VS_extern_spec (mk_typschm (mk_typqn ()) $3 3 3,$4, $6)) }
kinded_id:
@@ -943,25 +943,25 @@ name_sect:
{ Name_sect_aux(Name_sect_some($4), loc ()) }
c_def_body:
- | atomic_typ id
+ | typ id
{ [($1,$2)],false }
- | atomic_typ id Semi
+ | typ id Semi
{ [($1,$2)],true }
- | atomic_typ id Semi c_def_body
+ | typ id Semi c_def_body
{ ($1,$2)::(fst $4), snd $4 }
union_body:
| id
{ [Tu_aux( Tu_id $1, loc())],false }
- | atomic_typ id
+ | typ id
{ [Tu_aux( Tu_ty_id ($1,$2), loc())],false }
| id Semi
{ [Tu_aux( Tu_id $1, loc())],true }
- | atomic_typ id Semi
+ | typ id Semi
{ [Tu_aux( Tu_ty_id ($1,$2),loc())],true }
| id Semi union_body
{ (Tu_aux( Tu_id $1, loc()))::(fst $3), snd $3 }
- | atomic_typ id Semi union_body
+ | typ id Semi union_body
{ (Tu_aux(Tu_ty_id($1,$2),loc()))::(fst $4), snd $4 }
index_range_atomic:
@@ -1035,9 +1035,9 @@ type_def:
default_typ:
| Default atomic_kind tyvar
{ defloc (DT_kind($2,$3)) }
- | Default typquant atomic_typ id
+ | Default typquant typ id
{ defloc (DT_typ((mk_typschm $2 $3 2 3),$4)) }
- | Default atomic_typ id
+ | Default typ id
{ defloc (DT_typ((mk_typschm (mk_typqn ()) $2 2 2),$3)) }
scattered_def:
diff --git a/src/test/test1.sail b/src/test/test1.sail
index dfb8ac8f..128a4a99 100644
--- a/src/test/test1.sail
+++ b/src/test/test1.sail
@@ -1,11 +1,11 @@
default Nat 'i
default Order 'o
default bool b
-default forall 'a. (list<'a>) b
-val forall 'a, 'b . (('a * 'b) -> 'b pure) snd
-val forall Type 'i, 'b. (('i * 'b) -> 'i pure) fst
+default forall 'a. list<'a> b
+val forall 'a, 'b . ('a * 'b) -> 'b pure snd
+val forall Type 'i, 'b. ('i * 'b) -> 'i pure fst
typedef int_list [name = "il"] = list<nat>
-typedef reco = const struct forall 'i, 'a, 'b. { ('a['i]) v; 'b w; }
+typedef reco = const struct forall 'i, 'a, 'b. { 'a['i] v; 'b w; }
typedef maybe = const union forall 'a. { Nne; 'a Sme; }
typedef colors = enumerate { red; green; blue }
typedef creg = register bits [5:'i] { 5 : h ; 6..7 : j}
diff --git a/src/test/test3.sail b/src/test/test3.sail
index 30513bc9..e77e1b71 100644
--- a/src/test/test3.sail
+++ b/src/test/test3.sail
@@ -2,13 +2,13 @@
register nat dummy_reg
(* a function to read from memory; wmem serves no purpose currently,
memory-writing functions are figured out syntactically. *)
-val ( nat -> nat effect { wmem , rmem } ) MEM
-val ( nat -> nat effect { wmem , rmem } ) MEM_GPU
-val ( ( nat * nat ) -> nat effect { wmem , rmem } ) MEM_SIZE
+val nat -> nat effect { wmem , rmem } MEM
+val nat -> nat effect { wmem , rmem } MEM_GPU
+val ( nat * nat ) -> nat effect { wmem , rmem } MEM_SIZE
(* extern functions *)
-val extern ( ( nat * nat ) -> nat pure ) add = "add"
-val extern ( ( nat * nat ) -> nat pure ) (deinfix + ) = "add_infix" (* infix plus *)
+val extern ( nat * nat ) -> nat pure add = "add"
+val extern ( nat * nat ) -> nat pure (deinfix + ) = "add_infix" (* infix plus *)
function nat (deinfix * ) ( (nat) x, (nat) y ) = 42