summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-12-20 20:22:08 +0000
committerbringert <bringert@cs.chalmers.se>2006-12-20 20:22:08 +0000
commit0353b7b7cb15a09d068ad8a345127058c976f8e5 (patch)
tree3862cc7ac7a73f61fb56d4e5aa5cd9592458ff06 /src
parente74d10952e299c77527cdf76153d90213b7737c7 (diff)
Make smaller SISR code for tokens.
Diffstat (limited to 'src')
-rw-r--r--src/GF/Speech/SISR.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/GF/Speech/SISR.hs b/src/GF/Speech/SISR.hs
index 6e035afb4..bc1da64ae 100644
--- a/src/GF/Speech/SISR.hs
+++ b/src/GF/Speech/SISR.hs
@@ -60,8 +60,12 @@ catSISR t (c,i) fmt
| otherwise = []
profileFinalSISR :: CFTerm -> SISRFormat -> SISRTag
-profileFinalSISR term fmt = [fmtOut fmt `ass` f term]
- where f (CFObj n ts) =
+profileFinalSISR term fmt = g term
+ where
+ -- optimization for tokens
+ g (CFObj n []) = [field (fmtOut fmt) "name" `ass` JS.EStr (prIdent n)]
+ g t = [fmtOut fmt `ass` f t]
+ f (CFObj n ts) =
JS.ESeq $ [ret `ass` JS.ENew (JS.Ident "Object") [],
field ret "name" `ass` JS.EStr (prIdent n)]
++ [field ret ("arg"++show i) `ass` f t