diff options
| author | aarne <unknown> | 2004-03-24 15:09:06 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2004-03-24 15:09:06 +0000 |
| commit | dc71ffcf5bae1f2b91467de273c71e7c3294acb3 (patch) | |
| tree | a4e705bba717aa9f7421c000cfa5756d5eb8462b /grammars | |
| parent | 31836c0da9ba7a716ee0480e6219d771da4999fa (diff) | |
Restoring old functionality
Diffstat (limited to 'grammars')
| -rw-r--r-- | grammars/prelude/Prelude.gf | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/grammars/prelude/Prelude.gf b/grammars/prelude/Prelude.gf index 8c29232e7..1889f1086 100644 --- a/grammars/prelude/Prelude.gf +++ b/grammars/prelude/Prelude.gf @@ -1,6 +1,6 @@ -- language-independent prelude facilities -resource Prelude = open (Predef = Predef) in { +resource Prelude = { oper -- to construct records and tables @@ -71,16 +71,20 @@ oper E0 => E1 ; E1 => E2 ; _ => Emore} ; -- these were defined in Predef before - oper isNil : Tok -> Bool = \b -> pbool2bool (Predef.eqStr [] b) ; + isNil : Tok -> Bool = \b -> pbool2bool (Predef.eqStr [] b) ; - oper ifTok : (A : Type) -> Tok -> Tok -> A -> A -> A = \A,t,u,a,b -> + ifTok : (A : Type) -> Tok -> Tok -> A -> A -> A = \A,t,u,a,b -> case Predef.eqStr t u of {Predef.PTrue => a ; Predef.PFalse => b} ; -- so we need an interface - oper pbool2bool : Predef.PBool -> Bool = \b -> case b of { + pbool2bool : Predef.PBool -> Bool = \b -> case b of { Predef.PFalse => False ; Predef.PTrue => True } ; + init : Tok -> Tok = Predef.tk 1 ; + last : Tok -> Tok = Predef.dp 1 ; + + -- bind together two tokens in the lexer, either obligatorily or optionally oper |
