forked from GitHub/gf-core
remove the deprecated RP constructor in GFCC
This commit is contained in:
@@ -67,7 +67,6 @@ data Term =
|
||||
| FV [Term]
|
||||
| W String Term
|
||||
| TM String
|
||||
| RP Term Term
|
||||
deriving (Eq,Ord,Show)
|
||||
|
||||
data Tokn =
|
||||
|
||||
@@ -69,7 +69,6 @@ term2js n l t = f t
|
||||
D.F f -> JS.ECall (JS.EMember (JS.EIndex (JS.EMember (JS.EVar $ JS.Ident n) (JS.Ident "concretes")) (JS.EStr l)) (JS.Ident "rule")) [JS.EStr (prCId f), JS.EVar children]
|
||||
D.FV xs -> new "Variants" (map f xs)
|
||||
D.W str x -> new "Suffix" [JS.EStr str, f x]
|
||||
D.RP x y -> new "Rp" [f x, f y]
|
||||
D.TM _ -> new "Meta" []
|
||||
|
||||
tokn2js :: D.Tokn -> JS.Expr
|
||||
|
||||
@@ -23,7 +23,6 @@ realize trm = case trm of
|
||||
KP s _ -> unwords s ---- prefix choice TODO
|
||||
W s t -> s ++ realize t
|
||||
FV ts -> realize (ts !! 0) ---- other variants TODO
|
||||
RP _ r -> realize r ---- DEPREC
|
||||
TM s -> s
|
||||
_ -> "ERROR " ++ show trm ---- debug
|
||||
|
||||
@@ -52,7 +51,6 @@ compute :: GFCC -> CId -> [Term] -> Term -> Term
|
||||
compute mcfg lang args = comp where
|
||||
comp trm = case trm of
|
||||
P r p -> proj (comp r) (comp p)
|
||||
RP i t -> RP (comp i) (comp t) ---- DEPREC
|
||||
W s t -> W s (comp t)
|
||||
R ts -> R $ lmap comp ts
|
||||
V i -> idx args i -- already computed
|
||||
@@ -80,13 +78,11 @@ compute mcfg lang args = comp where
|
||||
|
||||
getIndex t = case t of
|
||||
C i -> i
|
||||
RP p _ -> getIndex p ---- DEPREC
|
||||
TM _ -> 0 -- default value for parameter
|
||||
_ -> trace ("ERROR in grammar compiler: index from " ++ show t) 666
|
||||
|
||||
getField t i = case t of
|
||||
R rs -> idx rs i
|
||||
RP _ r -> getField r i ---- DEPREC
|
||||
TM s -> TM s
|
||||
_ -> error ("ERROR in grammar compiler: field from " ++ show t) t
|
||||
|
||||
|
||||
@@ -136,7 +136,6 @@ toTerm e = case e of
|
||||
App "S" es -> S (lmap toTerm es)
|
||||
App "FV" es -> FV (lmap toTerm es)
|
||||
App "P" [e,v] -> P (toTerm e) (toTerm v)
|
||||
App "RP" [e,v] -> RP (toTerm e) (toTerm v) ----
|
||||
App "W" [AStr s,v] -> W s (toTerm v)
|
||||
App "A" [AInt i] -> V (fromInteger i)
|
||||
App f [] -> F (mkCId f)
|
||||
@@ -203,7 +202,6 @@ fromTerm e = case e of
|
||||
S es -> App "S" (lmap fromTerm es)
|
||||
FV es -> App "FV" (lmap fromTerm es)
|
||||
P e v -> App "P" [fromTerm e, fromTerm v]
|
||||
RP e v -> App "RP" [fromTerm e, fromTerm v] ----
|
||||
W s v -> App "W" [AStr s, fromTerm v]
|
||||
C i -> AInt (toInteger i)
|
||||
TM _ -> AMet
|
||||
|
||||
Reference in New Issue
Block a user