1
0
forked from GitHub/gf-core

GF shell, cc command: try to compute pre{...} tokens in token sequences

This is implemented as a simple post-processing step after partial evaluation
to try compute pre{...} tokens in token sequences. Nothing is done to deal
with intervening free variants.

This was done in response to a query from René T on the gf-dev mailing list.
This commit is contained in:
hallgren
2015-12-02 16:41:18 +00:00
parent d5d4f11684
commit a6c2ef97ff
2 changed files with 28 additions and 4 deletions

View File

@@ -303,8 +303,8 @@ strsFromValue t = case t of
vars <- [[(str2strings v, map sstr c) | (v,c) <- zip vv c0] |
vv <- combinations v0]
]
VFV ts -> mapM strsFromValue ts >>= return . concat
VStrs ts -> mapM strsFromValue ts >>= return . concat
VFV ts -> concat # mapM strsFromValue ts
VStrs ts -> concat # mapM strsFromValue ts
_ -> fail ("cannot get Str from value " ++ show t)