diff options
| author | bringert <bringert@cs.chalmers.se> | 2005-11-29 18:16:33 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2005-11-29 18:16:33 +0000 |
| commit | 9a2dea46d103d180c3b0e0780df4f10a8a16f386 (patch) | |
| tree | f3ddcb3dcff372f877241330301d0fd21a614e72 /src/Transfer/Core/Core.cf | |
| parent | 5b9249a422cb1ac172d6b5f1f03d5cde629d6216 (diff) | |
Use rec and sig for records.
Diffstat (limited to 'src/Transfer/Core/Core.cf')
| -rw-r--r-- | src/Transfer/Core/Core.cf | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/Transfer/Core/Core.cf b/src/Transfer/Core/Core.cf index c2d9d3175..c68a5502e 100644 --- a/src/Transfer/Core/Core.cf +++ b/src/Transfer/Core/Core.cf @@ -24,7 +24,7 @@ PCons. Pattern ::= "(" CIdent [Pattern] ")" ; -- constructor patterns must have parantheses. PVar. Pattern ::= PatternVariable ; -- Record patterns. -PRec. Pattern ::= "{" [FieldPattern] "}"; +PRec. Pattern ::= "rec" "{" [FieldPattern] "}"; -- Patterns matching the constant Type. PType. Pattern ::= "Type" ; -- String literal patterns. @@ -59,11 +59,17 @@ EApp. Exp3 ::= Exp3 Exp4 ; -- Record field projection. EProj. Exp4 ::= Exp4 "." CIdent ; -EEmptyRec. Exp5 ::= "{" "}" ; -- Record types. -ERecType. Exp5 ::= "{" [FieldType] "}" ; +ERecType. Exp5 ::= "sig" "{" [FieldType] "}" ; +FieldType. FieldType ::= CIdent ":" Exp ; +separator FieldType ";" ; + -- Record expressions. -ERec. Exp5 ::= "{" [FieldValue] "}" ; +ERec. Exp5 ::= "rec" "{" [FieldValue] "}" ; +FieldValue.FieldValue ::= CIdent "=" Exp ; +separator FieldValue ";" ; + + -- Functions, constructors and local variables. EVar. Exp5 ::= CIdent ; -- The constant Type. @@ -79,24 +85,11 @@ token TMeta ('?' digit+) ; coercions Exp 5 ; -{- --- Hack to make lists of function arguments not conflict with --- application. -[]. [Exp] ::= ; -(:). [Exp] ::= Exp4 [Exp] ; --} Case. Case ::= Pattern "->" Exp ; separator Case ";" ; -FieldType. FieldType ::= CIdent ":" Exp ; -separator nonempty FieldType ";" ; - -FieldValue. FieldValue ::= CIdent "=" Exp ; -separator nonempty FieldValue ";" ; - - -- Identifiers in core can start with underscore to allow -- generating unique identifiers easily. token CIdent ((letter | '_') (letter | digit | '_' | '\'')*) ; |
