diff options
| author | kr.angelov <kr.angelov@gmail.com> | 2006-06-06 21:30:14 +0000 |
|---|---|---|
| committer | kr.angelov <kr.angelov@gmail.com> | 2006-06-06 21:30:14 +0000 |
| commit | f09e929dd1e46c066a566a5e0c6437ecaf3002a1 (patch) | |
| tree | e703f7835de306a59ca495526bfc78edc7372026 /src/GF/Grammar | |
| parent | 283379b57fc650719f519368cb75cfdc3829598e (diff) | |
initial support for literal categories e.g. String,Int and Float
Diffstat (limited to 'src/GF/Grammar')
| -rw-r--r-- | src/GF/Grammar/Macros.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/GF/Grammar/Macros.hs b/src/GF/Grammar/Macros.hs index 8261f7f36..e7d073382 100644 --- a/src/GF/Grammar/Macros.hs +++ b/src/GF/Grammar/Macros.hs @@ -398,16 +398,17 @@ freshAsTerm s = Vr (varX (readIntArg s)) -- | create a terminal for concrete syntax string2term :: String -> Term -string2term = ccK +string2term = K -ccK :: String -> Term -ccC :: Term -> Term -> Term -ccK = K -ccC = C +int2term :: Integer -> Term +int2term = EInt + +float2term :: Double -> Term +float2term = EFloat -- | create a terminal from identifier ident2terminal :: Ident -> Term -ident2terminal = ccK . prIdent +ident2terminal = K . prIdent -- | create a constant string2CnTrm :: String -> Term |
