mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 00:22:51 -06:00
printing of GFCC
This commit is contained in:
@@ -4,9 +4,9 @@ Abs. Abstract ::= "abstract" "{" [AbsDef] "}" ;
|
|||||||
Cnc. Concrete ::= "concrete" CId "{" [CncDef] "}" ;
|
Cnc. Concrete ::= "concrete" CId "{" [CncDef] "}" ;
|
||||||
|
|
||||||
Fun. AbsDef ::= CId ":" Type "=" Exp ;
|
Fun. AbsDef ::= CId ":" Type "=" Exp ;
|
||||||
AFl. AbsDef ::= "%" CId "=" String ; -- flag
|
--AFl. AbsDef ::= "%" CId "=" String ; -- flag
|
||||||
Lin. CncDef ::= CId "=" Term ;
|
Lin. CncDef ::= CId "=" Term ;
|
||||||
CFl. CncDef ::= "%" CId "=" String ; -- flag
|
--CFl. CncDef ::= "%" CId "=" String ; -- flag
|
||||||
|
|
||||||
Typ. Type ::= [CId] "->" CId ;
|
Typ. Type ::= [CId] "->" CId ;
|
||||||
Tr. Exp ::= "(" Atom [Exp] ")" ;
|
Tr. Exp ::= "(" Atom [Exp] ")" ;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ render d = rend 0 (map ($ "") $ d []) "" where
|
|||||||
t : "]" :ts -> showString t . showChar ']' . rend i ts
|
t : "]" :ts -> showString t . showChar ']' . rend i ts
|
||||||
t :ts -> space t . rend i ts
|
t :ts -> space t . rend i ts
|
||||||
_ -> id
|
_ -> id
|
||||||
new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace
|
new i = showChar '\n' . replicateS (0) (showChar ' ') . dropWhile isSpace
|
||||||
space t = showString t . id ----(\s -> if null s then "" else (' ':s))
|
space t = showString t . id ----(\s -> if null s then "" else (' ':s))
|
||||||
|
|
||||||
parenth :: Doc -> Doc
|
parenth :: Doc -> Doc
|
||||||
|
|||||||
Reference in New Issue
Block a user