summaryrefslogtreecommitdiff
path: root/src/GF/Grammar
diff options
context:
space:
mode:
authoraarne <unknown>2003-11-03 16:27:55 +0000
committeraarne <unknown>2003-11-03 16:27:55 +0000
commit94326929b144913642121bef8f8ecc98feb992e7 (patch)
tree07d59cc33cbef2ac79c6f3f573b9718c51322e7a /src/GF/Grammar
parent2728e6e7ceec92c7f781368b4a523b37e5dee3b9 (diff)
Fixed several things, e.g. tokenizer.
Diffstat (limited to 'src/GF/Grammar')
-rw-r--r--src/GF/Grammar/PrGrammar.hs18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/GF/Grammar/PrGrammar.hs b/src/GF/Grammar/PrGrammar.hs
index 03197ea02..607b766da 100644
--- a/src/GF/Grammar/PrGrammar.hs
+++ b/src/GF/Grammar/PrGrammar.hs
@@ -9,6 +9,8 @@ import qualified PrintGFC as C
import qualified AbsGFC as A
import Values
import GrammarToSource
+
+import Option
import Ident
import Str
@@ -97,13 +99,6 @@ prMarkedTree = prf 1 where
prTree :: Tree -> [String]
prTree = prMarkedTree . mapTr (\n -> (n,False))
---- to get rig of brackets
-prRefinement :: Term -> String
-prRefinement t = case t of
- Q m c -> prQIdent (m,c)
- QC m c -> prQIdent (m,c)
- _ -> prt t
-
-- a pretty-printer for parsable output
tree2string = unlines . prprTree
@@ -187,3 +182,12 @@ prExp e = case e of
pr2 e = case e of
App _ _ -> prParenth $ prExp e
_ -> pr1 e
+
+-- option -strip strips qualifications
+prTermOpt opts = if oElem nostripQualif opts then prt else prExp
+
+--- to get rid of brackets in the editor
+prRefinement t = case t of
+ Q m c -> prQIdent (m,c)
+ QC m c -> prQIdent (m,c)
+ _ -> prt t