git @ Cat's Eye Technologies Quylthulg / 51b6fe7
String literals are preceded by a tilde, actually. Chris Pressey 1 year, 4 months ago
2 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
9595 (follow lenv first, follow lenv rest)
9696
9797 formatTerm (Int i) = show i
98 formatTerm (Str s) = "$" ++ s ++ "$" -- not quite (ignores quoting), but close enough
98 formatTerm (Str s) = "~" ++ formatIdent s
9999 formatTerm (Cons h t) = "[" ++ (formatTerm h) ++ formatTail t
100100 formatTerm Null = "null"
101101 formatTerm (Label s t) = ":" ++ s ++ ":" ++ (formatTerm t)
102 formatTerm (Goto s) = "goto " ++ (formatTerm (Str s))
102 formatTerm (Goto s) = "goto " ++ (formatIdent s)
103103 formatTerm Abort = "abort"
104104
105105 formatTail Null = "]"
106106 formatTail (Cons h t) = "," ++ (formatTerm h) ++ formatTail t
107107 formatTail x = "|" ++ formatTerm x ++ "]"
108
109 formatIdent s = "$" ++ s ++ "$" -- not quite (ignores quoting), but close enough
108110
109111 --
110112 -- Terms support a number of operations which require the "meaning" of the
2222 -------------------
2323
2424 | &~$Shoes are $&&~~&~$4.99 a pair$&&
25 = $Shoes are $4.99 a pair$
25 = ~$Shoes are $4.99 a pair$
2626
2727 List expressions.
2828 -----------------
198198 = 25
199199
200200 | {*[}][This is my comment!]}~${}}$
201 = $This is my comment!$
201 = ~$This is my comment!$
202202
203203 | {*[Dave][3]}{*[Emily][4]}$Number of Macros Defined$
204204 = 2
205205
206206 | &~${$&~$*[S][T]}$&
207 = ${*[S][T]}$
207 = ~${*[S][T]}$
208208
209209 | &~${$&~$S}$&
210 = ${S}$
210 = ~${S}$
211211
212212 | %&~${$&~$*[S][T]}$&%&~${$&~$S}$&%
213 = $T$
213 = ~$T$