-
Notifications
You must be signed in to change notification settings - Fork 1
/
lang-clj.xsl
50 lines (43 loc) · 1.85 KB
/
lang-clj.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
xmlns:thi="http://thi.ng/">
<xsl:output method="text"/>
<xsl:variable name="lcommentPrefix" select="';; '"/>
<xsl:variable name="lcommentSuffix" select="''"/>
<xsl:variable
name="bcommentPrefix"
select="';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;'"/>
<xsl:variable name="bcommentLPrefix" select="';; '"/>
<xsl:variable
name="bcommentSuffix"
select="';;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;'"/>
<xsl:variable name="definePrefix" select="'(def '"/>
<xsl:variable name="defineSuffix" select="')'"/>
<xsl:variable name="sep" select="'-'"/>
<xsl:function name="thi:lang-prologue">
<xsl:text>(def << bit-shift-left)

</xsl:text>
</xsl:function>
<xsl:function name="thi:lang-epilogue">
</xsl:function>
<xsl:function name="thi:lang-def">
<xsl:param name="sym" as="xs:string"/>
<xsl:param name="val"/>
<xsl:value-of select="concat('(def ',thi:lang-symbolname($sym),' ',$val,')')"/>
</xsl:function>
<xsl:function name="thi:lang-symbolname">
<xsl:param name="body" as="xs:string"/>
<xsl:value-of select="replace(fn:lower-case($body),'_','-')"/>
</xsl:function>
<xsl:function name="thi:lang-expr">
<xsl:param name="op" as="xs:string"/>
<xsl:param name="lhs"/>
<xsl:param name="rhs"/>
<xsl:value-of select="concat('(',$op,' ',$lhs,' ',$rhs,')')"/>
</xsl:function>
<xsl:include href="common.xsl"/>
</xsl:stylesheet>