aboutsummaryrefslogtreecommitdiff
path: root/luxc/src
diff options
context:
space:
mode:
authorEduardo Julian2017-07-02 12:29:36 -0400
committerEduardo Julian2017-07-02 12:29:36 -0400
commit38d5f05977c54770195129df5ede2c91be4a32af (patch)
tree891069a1db8e827294a980ec55a2638881adb754 /luxc/src
parentc6a107d54f20a57dff4b8e26b07d8eac15982c91 (diff)
- Lux no longer has a Char primitive data-type.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/analyser.clj4
-rw-r--r--luxc/src/lux/analyser/base.clj1
-rw-r--r--luxc/src/lux/analyser/case.clj23
-rw-r--r--luxc/src/lux/analyser/parser.clj3
-rw-r--r--luxc/src/lux/analyser/proc/common.clj18
-rw-r--r--luxc/src/lux/base.clj5
-rw-r--r--luxc/src/lux/compiler/cache/ann.clj5
-rw-r--r--luxc/src/lux/compiler/js.clj3
-rw-r--r--luxc/src/lux/compiler/js/lux.clj4
-rw-r--r--luxc/src/lux/compiler/jvm.clj3
-rw-r--r--luxc/src/lux/compiler/jvm/case.clj7
-rw-r--r--luxc/src/lux/compiler/jvm/lux.clj1
-rw-r--r--luxc/src/lux/compiler/jvm/proc/common.clj62
-rw-r--r--luxc/src/lux/compiler/jvm/rt.clj5
-rw-r--r--luxc/src/lux/lexer.clj39
-rw-r--r--luxc/src/lux/optimizer.clj66
-rw-r--r--luxc/src/lux/parser.clj3
-rw-r--r--luxc/src/lux/type.clj20
18 files changed, 18 insertions, 254 deletions
diff --git a/luxc/src/lux/analyser.clj b/luxc/src/lux/analyser.clj
index 1c854acb9..5ea8cf64b 100644
--- a/luxc/src/lux/analyser.clj
+++ b/luxc/src/lux/analyser.clj
@@ -86,10 +86,6 @@
(|do [_ (&type/check exo-type &type/Real)]
(return (&/|list (&&/|meta exo-type cursor (&&/$real ?value)))))
- (&/$Char ?value)
- (|do [_ (&type/check exo-type &type/Char)]
- (return (&/|list (&&/|meta exo-type cursor (&&/$char ?value)))))
-
(&/$Text ?value)
(|do [_ (&type/check exo-type &type/Text)]
(return (&/|list (&&/|meta exo-type cursor (&&/$text ?value)))))
diff --git a/luxc/src/lux/analyser/base.clj b/luxc/src/lux/analyser/base.clj
index b71df2b1f..bfe931546 100644
--- a/luxc/src/lux/analyser/base.clj
+++ b/luxc/src/lux/analyser/base.clj
@@ -11,7 +11,6 @@
("int" 1)
("deg" 1)
("real" 1)
- ("char" 1)
("text" 1)
("variant" 3)
("tuple" 1)
diff --git a/luxc/src/lux/analyser/case.clj b/luxc/src/lux/analyser/case.clj
index c60059540..fa9d568d0 100644
--- a/luxc/src/lux/analyser/case.clj
+++ b/luxc/src/lux/analyser/case.clj
@@ -17,7 +17,6 @@
("IntTotal" 2)
("DegTotal" 2)
("RealTotal" 2)
- ("CharTotal" 2)
("TextTotal" 2)
("TupleTotal" 2)
("VariantTotal" 2))
@@ -30,7 +29,6 @@
("IntTestAC" 1)
("DegTestAC" 1)
("RealTestAC" 1)
- ("CharTestAC" 1)
("TextTestAC" 1)
("TupleTestAC" 1)
("VariantTestAC" 1))
@@ -296,11 +294,6 @@
=kont kont]
(return (&/T [($RealTestAC ?value) =kont])))
- (&/$Char ?value)
- (|do [_ (&type/check value-type &type/Char)
- =kont kont]
- (return (&/T [($CharTestAC ?value) =kont])))
-
(&/$Text ?value)
(|do [_ (&type/check value-type &type/Text)
=kont kont]
@@ -428,9 +421,6 @@
[($RealTotal total? ?values) ($NoTestAC)]
(return ($RealTotal true ?values))
- [($CharTotal total? ?values) ($NoTestAC)]
- (return ($CharTotal true ?values))
-
[($TextTotal total? ?values) ($NoTestAC)]
(return ($TextTotal true ?values))
@@ -458,9 +448,6 @@
[($RealTotal total? ?values) ($StoreTestAC ?idx)]
(return ($RealTotal true ?values))
- [($CharTotal total? ?values) ($StoreTestAC ?idx)]
- (return ($CharTotal true ?values))
-
[($TextTotal total? ?values) ($StoreTestAC ?idx)]
(return ($TextTotal true ?values))
@@ -500,12 +487,6 @@
[($RealTotal total? ?values) ($RealTestAC ?value)]
(return ($RealTotal total? (&/$Cons ?value ?values)))
- [($DefaultTotal total?) ($CharTestAC ?value)]
- (return ($CharTotal total? (&/|list ?value)))
-
- [($CharTotal total? ?values) ($CharTestAC ?value)]
- (return ($CharTotal total? (&/$Cons ?value ?values)))
-
[($DefaultTotal total?) ($TextTestAC ?value)]
(return ($TextTotal total? (&/|list ?value)))
@@ -591,10 +572,6 @@
(|do [_ (&type/check value-type &type/Real)]
(return ?total))
- ($CharTotal ?total _)
- (|do [_ (&type/check value-type &type/Char)]
- (return ?total))
-
($TextTotal ?total _)
(|do [_ (&type/check value-type &type/Text)]
(return ?total))
diff --git a/luxc/src/lux/analyser/parser.clj b/luxc/src/lux/analyser/parser.clj
index 873f0db91..731b5bace 100644
--- a/luxc/src/lux/analyser/parser.clj
+++ b/luxc/src/lux/analyser/parser.clj
@@ -142,9 +142,6 @@
[_ (&lexer/$Real param-value*)] &lexer/lex-real]
(return (double param-value*)))
- (|do [[_ (&lexer/$Char param-value*)] &lexer/lex-char]
- (return (char param-value*)))
-
(|do [[_ (&lexer/$Text param-value*)] &lexer/lex-text]
(return param-value*))
))]
diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj
index 0695de2a6..27af2a08d 100644
--- a/luxc/src/lux/analyser/proc/common.clj
+++ b/luxc/src/lux/analyser/proc/common.clj
@@ -131,7 +131,7 @@
(|do [:let [(&/$Cons text (&/$Cons idx (&/$Nil))) ?values]
=text (&&/analyse-1 analyse &type/Text text)
=idx (&&/analyse-1 analyse &type/Nat idx)
- _ (&type/check exo-type (&/$Apply &type/Char &type/Maybe))
+ _ (&type/check exo-type (&/$Apply &type/Nat &type/Maybe))
_cursor &/cursor]
(return (&/|list (&&/|meta exo-type _cursor
(&&/$proc (&/T ["text" "char"])
@@ -217,9 +217,6 @@
^:private analyse-real-rem ["real" "%"] &type/Real &type/Real
^:private analyse-real-eq ["real" "="] &type/Real &type/Bool
^:private analyse-real-lt ["real" "<"] &type/Real &type/Bool
-
- ^:private analyse-char-eq ["char" "="] &type/Char &type/Bool
- ^:private analyse-char-lt ["char" "<"] &type/Char &type/Bool
)
(do-template [<name> <proc>]
@@ -294,13 +291,10 @@
^:private analyse-nat-to-int &type/Nat &type/Int ["nat" "to-int"]
^:private analyse-int-to-nat &type/Int &type/Nat ["int" "to-nat"]
- ^:private analyse-nat-to-char &type/Nat &type/Char ["nat" "to-char"]
- ^:private analyse-char-to-nat &type/Char &type/Nat ["char" "to-nat"]
+ ^:private analyse-nat-to-char &type/Nat &type/Text ["nat" "to-char"]
^:private analyse-int-to-real &type/Int &type/Real ["int" "to-real"]
^:private analyse-real-to-int &type/Real &type/Int ["real" "to-int"]
-
- ^:private analyse-char-to-text &type/Char &type/Text ["char" "to-text"]
^:private analyse-deg-to-real &type/Deg &type/Real ["deg" "to-real"]
^:private analyse-real-to-deg &type/Real &type/Deg ["real" "to-deg"]
@@ -598,14 +592,6 @@
"to-int" (analyse-real-to-int analyse exo-type ?values)
)
- "char"
- (case proc
- "=" (analyse-char-eq analyse exo-type ?values)
- "<" (analyse-char-lt analyse exo-type ?values)
- "to-text" (analyse-char-to-text analyse exo-type ?values)
- "to-nat" (analyse-char-to-nat analyse exo-type ?values)
- )
-
"math"
(case proc
"e" (analyse-math-e analyse exo-type ?values)
diff --git a/luxc/src/lux/base.clj b/luxc/src/lux/base.clj
index c63cce34e..8a7378586 100644
--- a/luxc/src/lux/base.clj
+++ b/luxc/src/lux/base.clj
@@ -76,7 +76,6 @@
("Int" 1)
("Deg" 1)
("Real" 1)
- ("Char" 1)
("Text" 1)
("Symbol" 1)
("Tag" 1)
@@ -223,7 +222,6 @@
("IntA" 1)
("DegA" 1)
("RealA" 1)
- ("CharA" 1)
("TextA" 1)
("IdentA" 1)
("ListA" 1)
@@ -1222,9 +1220,6 @@
[_ ($Real ?value)]
(pr-str ?value)
- [_ ($Char ?value)]
- (str "#\"" (pr-str ?value) "\"")
-
[_ ($Text ?value)]
(str "\"" ?value "\"")
diff --git a/luxc/src/lux/compiler/cache/ann.clj b/luxc/src/lux/compiler/cache/ann.clj
index b71d6707b..35a41f247 100644
--- a/luxc/src/lux/compiler/cache/ann.clj
+++ b/luxc/src/lux/compiler/cache/ann.clj
@@ -43,9 +43,6 @@
(&/$RealA value)
(str "R" value stop)
- (&/$CharA value)
- (str "C" value stop)
-
(&/$TextA value)
(serialize-text value)
@@ -88,7 +85,6 @@
^:private deserialize-int "I" &/$IntA Long/parseLong
^:private deserialize-deg "D" &/$DegA Long/parseLong
^:private deserialize-real "R" &/$RealA Double/parseDouble
- ^:private deserialize-char "C" &/$CharA (fn [^String input] (.charAt input 0))
^:private deserialize-text "T" &/$TextA identity
)
@@ -143,7 +139,6 @@
(deserialize-int input)
(deserialize-deg input)
(deserialize-real input)
- (deserialize-char input)
(deserialize-text input)
(deserialize-ident input)
(deserialize-list input)
diff --git a/luxc/src/lux/compiler/js.clj b/luxc/src/lux/compiler/js.clj
index c19a40dcd..b618b7b1b 100644
--- a/luxc/src/lux/compiler/js.clj
+++ b/luxc/src/lux/compiler/js.clj
@@ -51,9 +51,6 @@
(&o/$real ?value)
(&&lux/compile-real ?value)
- (&o/$char ?value)
- (&&lux/compile-char ?value)
-
(&o/$text ?value)
(&&lux/compile-text ?value)
diff --git a/luxc/src/lux/compiler/js/lux.clj b/luxc/src/lux/compiler/js/lux.clj
index d066dff17..593055b8b 100644
--- a/luxc/src/lux/compiler/js/lux.clj
+++ b/luxc/src/lux/compiler/js/lux.clj
@@ -192,10 +192,6 @@
(&o/$RealPM _value)
(return (str "if(" cursor-peek " !== " _value ") { " pm-fail " }"))
- (&o/$CharPM _value)
- (|do [=value (compile-char _value)]
- (return (str "if(" (str "(" cursor-peek ").C") " !== " (str "(" =value ").C") ") { " pm-fail " }")))
-
(&o/$TextPM _value)
(|do [=value (compile-text _value)]
(return (str "if(" cursor-peek " !== " =value ") { " pm-fail " }")))
diff --git a/luxc/src/lux/compiler/jvm.clj b/luxc/src/lux/compiler/jvm.clj
index 22310201c..5c11c0c6d 100644
--- a/luxc/src/lux/compiler/jvm.clj
+++ b/luxc/src/lux/compiler/jvm.clj
@@ -62,9 +62,6 @@
(&o/$real ?value)
(&&lux/compile-real ?value)
- (&o/$char ?value)
- (&&lux/compile-char ?value)
-
(&o/$text ?value)
(&&lux/compile-text ?value)
diff --git a/luxc/src/lux/compiler/jvm/case.clj b/luxc/src/lux/compiler/jvm/case.clj
index da8d8d0a9..c205381e8 100644
--- a/luxc/src/lux/compiler/jvm/case.clj
+++ b/luxc/src/lux/compiler/jvm/case.clj
@@ -101,13 +101,6 @@
(.visitInsn Opcodes/DCMPL)
(.visitJumpInsn Opcodes/IFNE $else))
- (&o/$CharPM _value)
- (doto writer
- stack-peek
- &&/unwrap-char
- (.visitLdcInsn _value)
- (.visitJumpInsn Opcodes/IF_ICMPNE $else))
-
(&o/$TextPM _value)
(doto writer
stack-peek
diff --git a/luxc/src/lux/compiler/jvm/lux.clj b/luxc/src/lux/compiler/jvm/lux.clj
index bb7dda339..123676d35 100644
--- a/luxc/src/lux/compiler/jvm/lux.clj
+++ b/luxc/src/lux/compiler/jvm/lux.clj
@@ -41,7 +41,6 @@
compile-int "java/lang/Long" "J" long
compile-deg "java/lang/Long" "J" long
compile-real "java/lang/Double" "D" double
- compile-char "java/lang/Character" "C" char
)
(defn compile-text [?value]
diff --git a/luxc/src/lux/compiler/jvm/proc/common.clj b/luxc/src/lux/compiler/jvm/proc/common.clj
index 821fcc619..7c44f3434 100644
--- a/luxc/src/lux/compiler/jvm/proc/common.clj
+++ b/luxc/src/lux/compiler/jvm/proc/common.clj
@@ -274,31 +274,6 @@
^:private compile-real-lt Opcodes/DCMPG -1 &&/unwrap-double
)
-(do-template [<name> <opcode> <unwrap>]
- (defn <name> [compile ?values special-args]
- (|do [:let [(&/$Cons ?x (&/$Cons ?y (&/$Nil))) ?values]
- ^MethodVisitor *writer* &/get-writer
- _ (compile ?x)
- :let [_ (doto *writer*
- <unwrap>)]
- _ (compile ?y)
- :let [_ (doto *writer*
- <unwrap>)
- $then (new Label)
- $end (new Label)
- _ (doto *writer*
- (.visitJumpInsn <opcode> $then)
- (.visitFieldInsn Opcodes/GETSTATIC (&host-generics/->bytecode-class-name "java.lang.Boolean") "FALSE" (&host-generics/->type-signature "java.lang.Boolean"))
- (.visitJumpInsn Opcodes/GOTO $end)
- (.visitLabel $then)
- (.visitFieldInsn Opcodes/GETSTATIC (&host-generics/->bytecode-class-name "java.lang.Boolean") "TRUE" (&host-generics/->type-signature "java.lang.Boolean"))
- (.visitLabel $end))]]
- (return nil)))
-
- ^:private compile-char-eq Opcodes/IF_ICMPEQ &&/unwrap-char
- ^:private compile-char-lt Opcodes/IF_ICMPLT &&/unwrap-char
- )
-
(do-template [<name> <cmp-output>]
(defn <name> [compile ?values special-args]
(|do [:let [(&/$Cons ?x (&/$Cons ?y (&/$Nil))) ?values]
@@ -440,34 +415,15 @@
^:private compile-real-to-deg "java.lang.Double" "real-to-deg" "(D)J" &&/unwrap-double &&/wrap-long
)
-(let [widen (fn [^MethodVisitor *writer*]
- (doto *writer*
- (.visitInsn Opcodes/I2L)))
- shrink (fn [^MethodVisitor *writer*]
- (doto *writer*
- (.visitInsn Opcodes/L2I)
- (.visitInsn Opcodes/I2C)))]
- (do-template [<name> <unwrap> <wrap> <adjust>]
- (defn <name> [compile ?values special-args]
- (|do [:let [(&/$Cons ?x (&/$Nil)) ?values]
- ^MethodVisitor *writer* &/get-writer
- _ (compile ?x)
- :let [_ (doto *writer*
- <unwrap>
- <adjust>
- <wrap>)]]
- (return nil)))
-
- ^:private compile-nat-to-char &&/unwrap-long &&/wrap-char shrink
- ^:private compile-char-to-nat &&/unwrap-char &&/wrap-long widen
- ))
-
-(defn ^:private compile-char-to-text [compile ?values special-args]
+(defn ^:private compile-nat-to-char [compile ?values special-args]
(|do [:let [(&/$Cons ?x (&/$Nil)) ?values]
^MethodVisitor *writer* &/get-writer
_ (compile ?x)
:let [_ (doto *writer*
- (.visitMethodInsn Opcodes/INVOKEVIRTUAL "java/lang/Object" "toString" "()Ljava/lang/String;"))]]
+ &&/unwrap-long
+ (.visitInsn Opcodes/L2I)
+ (.visitInsn Opcodes/I2C)
+ (.visitMethodInsn Opcodes/INVOKESTATIC "java/lang/String" "valueOf" "(C)Ljava/lang/String;"))]]
(return nil)))
(do-template [<name>]
@@ -968,14 +924,6 @@
"decode" (compile-real-decode compile ?values special-args)
)
- "char"
- (case proc
- "=" (compile-char-eq compile ?values special-args)
- "<" (compile-char-lt compile ?values special-args)
- "to-nat" (compile-char-to-nat compile ?values special-args)
- "to-text" (compile-char-to-text compile ?values special-args)
- )
-
"math"
(case proc
"e" (compile-math-e compile ?values special-args)
diff --git a/luxc/src/lux/compiler/jvm/rt.clj b/luxc/src/lux/compiler/jvm/rt.clj
index 31a2c800c..63a5e1935 100644
--- a/luxc/src/lux/compiler/jvm/rt.clj
+++ b/luxc/src/lux/compiler/jvm/rt.clj
@@ -698,8 +698,9 @@
(.visitLabel $from)
(.visitVarInsn Opcodes/ALOAD 0)
(.visitVarInsn Opcodes/ILOAD 1)
- (.visitMethodInsn Opcodes/INVOKEVIRTUAL "java/lang/String" "charAt" "(I)C")
- &&/wrap-char
+ (.visitMethodInsn Opcodes/INVOKEVIRTUAL "java/lang/String" "codePointAt" "(I)I")
+ (.visitInsn Opcodes/I2L)
+ &&/wrap-long
(.visitMethodInsn Opcodes/INVOKESTATIC "lux/LuxRT" "make_some" "(Ljava/lang/Object;)[Ljava/lang/Object;")
(.visitInsn Opcodes/ARETURN)
(.visitLabel $to)
diff --git a/luxc/src/lux/lexer.clj b/luxc/src/lux/lexer.clj
index 58f8f95f7..dbdeef6a8 100644
--- a/luxc/src/lux/lexer.clj
+++ b/luxc/src/lux/lexer.clj
@@ -14,7 +14,6 @@
("Int" 1)
("Deg" 1)
("Real" 1)
- ("Char" 1)
("Text" 1)
("Symbol" 1)
("Tag" 1)
@@ -27,32 +26,6 @@
)
;; [Utils]
-(defn ^:private escape-char [escaped]
- "(-> Text (Lux Text))"
- (cond (.equals ^Object escaped "\\t") (return "\t")
- (.equals ^Object escaped "\\v") (return "\u000B")
- (.equals ^Object escaped "\\b") (return "\b")
- (.equals ^Object escaped "\\n") (return "\n")
- (.equals ^Object escaped "\\r") (return "\r")
- (.equals ^Object escaped "\\f") (return "\f")
- (.equals ^Object escaped "\\\"") (return "\"")
- (.equals ^Object escaped "\\\\") (return "\\")
- :else
- (&/fail-with-loc (str "[Lexer Error] Unknown escape character: " escaped))))
-
-(defn ^:private escape-char* [escaped]
- "(-> Text Text)"
- (cond (.equals ^Object escaped "\\t") "\t"
- (.equals ^Object escaped "\\v") "\u000B"
- (.equals ^Object escaped "\\b") "\b"
- (.equals ^Object escaped "\\n") "\n"
- (.equals ^Object escaped "\\r") "\r"
- (.equals ^Object escaped "\\f") "\f"
- (.equals ^Object escaped "\\\"") "\""
- (.equals ^Object escaped "\\\\") "\\"
- :else
- (assert false (str "[Lexer Error] Unknown escape character: " escaped))))
-
(defn ^:private clean-line [^String raw-line]
"(-> Text Text)"
(let [line-length (.length raw-line)
@@ -171,17 +144,6 @@
lex-real $Real #"^-?(0\.[0-9_]+|[1-9][0-9_]*\.[0-9_]+)(e-?[1-9][0-9_]*)?"
)
-(def lex-char
- (|do [[meta _ _] (&reader/read-text "#\"")
- token (&/try-all% (&/|list (|do [[_ _ escaped] (&reader/read-regex #"^(\\.)")]
- (escape-char escaped))
- (|do [[_ _ ^String unicode] (&reader/read-regex #"^(\\u[0-9a-fA-F]{4})")]
- (return (str (char (Integer/valueOf (.substring unicode 2) 16)))))
- (|do [[_ _ char] (&reader/read-regex #"^(.)")]
- (return char))))
- _ (&reader/read-text "\"")]
- (return (&/T [meta ($Char token)]))))
-
(def ^:private lex-ident
(&/try-all-% "[Reader Error]"
(&/|list (|do [[meta _ token] (&reader/read-regex +ident-re+)
@@ -246,7 +208,6 @@
lex-real
lex-deg
lex-int
- lex-char
lex-text
lex-symbol
lex-tag
diff --git a/luxc/src/lux/optimizer.clj b/luxc/src/lux/optimizer.clj
index d83ac3014..107435f92 100644
--- a/luxc/src/lux/optimizer.clj
+++ b/luxc/src/lux/optimizer.clj
@@ -11,7 +11,6 @@
("int" 1)
("deg" 1)
("real" 1)
- ("char" 1)
("text" 1)
("variant" 3)
("tuple" 1)
@@ -76,8 +75,6 @@
("DegPM" 1)
;; Compare the CDN with a real value.
("RealPM" 1)
- ;; Compare the CDN with a character value.
- ("CharPM" 1)
;; Compare the CDN with a text value.
("TextPM" 1)
;; Compare the CDN with a variant value. If valid, proceed to test
@@ -197,10 +194,6 @@
(&/|list ($RealPM _value)
$PopPM)
- (&a-case/$CharTestAC _value)
- (&/|list ($CharPM _value)
- $PopPM)
-
(&a-case/$TextTestAC _value)
(&/|list ($TextPM _value)
$PopPM)
@@ -267,57 +260,6 @@
($ExecPM body-id)
(clean-unnecessary-pops (&/|reverse (transform-pm* test)))))
-(defn ^:private pattern->text [pattern]
- (|case pattern
- ($PopPM)
- "$PopPM"
-
- ($BindPM _id)
- (str "($BindPM " _id ")")
-
- ($BoolPM _value)
- (str "($BoolPM " (pr-str _value) ")")
-
- ($NatPM _value)
- (str "($NatPM " (pr-str _value) ")")
-
- ($IntPM _value)
- (str "($IntPM " (pr-str _value) ")")
-
- ($DegPM _value)
- (str "($DegPM " (pr-str _value) ")")
-
- ($RealPM _value)
- (str "($RealPM " (pr-str _value) ")")
-
- ($CharPM _value)
- (str "($CharPM " (pr-str _value) ")")
-
- ($TextPM _value)
- (str "($TextPM " (pr-str _value) ")")
-
- ($TuplePM (&/$Left _idx))
- (str "($TuplePM L" _idx ")")
-
- ($TuplePM (&/$Right _idx))
- (str "($TuplePM R" _idx ")")
-
- ($VariantPM (&/$Left _idx))
- (str "($VariantPM L" _idx ")")
-
- ($VariantPM (&/$Right _idx))
- (str "($VariantPM R" _idx ")")
-
- ($SeqPM _left _right)
- (str "($SeqPM " (pattern->text _left) " " (pattern->text _right) ")")
-
- ($ExecPM _idx)
- (str "($ExecPM " _idx ")")
-
- ;; $AltPM is not considered because it's not supposed to be
- ;; present anywhere at this point in time.
- ))
-
;; This function fuses together the paths of the PM traversal, adding
;; branching AltPMs where necessary, and fusing similar paths together
;; as much as possible, when early parts of them coincide.
@@ -358,11 +300,6 @@
($RealPM _pre-value)
($AltPM pre post))
- [($CharPM _pre-value) ($CharPM _post-value)]
- (if (= _pre-value _post-value)
- ($CharPM _pre-value)
- ($AltPM pre post))
-
[($TextPM _pre-value) ($TextPM _post-value)]
(if (= _pre-value _post-value)
($TextPM _pre-value)
@@ -1079,9 +1016,6 @@
(&a/$real value)
(&/T [meta ($real value)])
- (&a/$char value)
- (&/T [meta ($char value)])
-
(&a/$text value)
(&/T [meta ($text value)])
diff --git a/luxc/src/lux/parser.clj b/luxc/src/lux/parser.clj
index c502efff2..7c9076aee 100644
--- a/luxc/src/lux/parser.clj
+++ b/luxc/src/lux/parser.clj
@@ -79,9 +79,6 @@
(&lexer/$Real ?value)
(return (&/|list (&/T [meta (&/$Real (Double/parseDouble ?value))])))
- (&lexer/$Char ^String ?value)
- (return (&/|list (&/T [meta (&/$Char (.charAt ?value 0))])))
-
(&lexer/$Text ?value)
(return (&/|list (&/T [meta (&/$Text ?value)])))
diff --git a/luxc/src/lux/type.clj b/luxc/src/lux/type.clj
index b569d890f..e6cc86fff 100644
--- a/luxc/src/lux/type.clj
+++ b/luxc/src/lux/type.clj
@@ -28,7 +28,6 @@
(def Deg (&/$Named (&/T ["lux" "Deg"]) (&/$Host &&host/deg-data-tag &/$Nil)))
(def Int (&/$Named (&/T ["lux" "Int"]) (&/$Host "#Int" &/$Nil)))
(def Real (&/$Named (&/T ["lux" "Real"]) (&/$Host "#Real" &/$Nil)))
-(def Char (&/$Named (&/T ["lux" "Char"]) (&/$Host "#Char" &/$Nil)))
(def Text (&/$Named (&/T ["lux" "Text"]) (&/$Host "#Text" &/$Nil)))
(def Ident (&/$Named (&/T ["lux" "Ident"]) (&/$Product Text Text)))
@@ -144,19 +143,16 @@
;; RealA
Real
(&/$Sum
- ;; CharA
- Char
+ ;; TextA
+ Text
(&/$Sum
- ;; TextA
- Text
+ ;; IdentA
+ Ident
(&/$Sum
- ;; IdentA
- Ident
- (&/$Sum
- ;; ListA
- (&/$Apply Ann-Value List)
- ;; DictA
- (&/$Apply (&/$Product Text Ann-Value) List))))))))))
+ ;; ListA
+ (&/$Apply Ann-Value List)
+ ;; DictA
+ (&/$Apply (&/$Product Text Ann-Value) List)))))))))
)))))
(def Anns