Skip to content

Commit

Permalink
Re-named Char to Character.
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoejp committed Sep 6, 2023
1 parent f72ac93 commit 3c77407
Show file tree
Hide file tree
Showing 64 changed files with 590 additions and 596 deletions.
4 changes: 2 additions & 2 deletions lux-lua/source/program.lux
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@
(_.bit_shr (_.int <shift>))
(_.bit_and (!integer <and>))
(_.bit_or (!integer <or>)))])]
(these (the rembulan//char
(these (the rembulan//character
(let [$buffer (_.var "buffer")
$k (_.var "k")
$v (_.var "v")
Expand Down Expand Up @@ -681,7 +681,7 @@
(_.return (_.int +0)))

... Ported from https://github.com/meepen/Lua-5.1-UTF-8
..rembulan//char
..rembulan//character
... ..rembulan//str_rel_to_abs
... ..rembulan//decode
... ..rembulan//codes
Expand Down
2 changes: 1 addition & 1 deletion lux-mode/lux-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ Called by `imenu--generic-function'."
(code//macro (altRE "macro"))
;; Miscellaneous
(jvm-host (altRE "import" "export" "class" "interface" "object" "synchronized" "class_for"))
(alternative-format (altRE "char" "bin" "oct" "hex"))
(alternative-format (altRE "character" "bin" "oct" "hex"))
(documentation (altRE "comment"))
(function-application (altRE "|>" "<|" "all"))
(function-definition (altRE "function" "|>>" "<<|"
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -852,10 +852,10 @@
4)]
(all + <operands>)))))

($.definition /.char
($.definition /.character
"If given a 1-character text literal, yields the char-code of the sole character."
($.example (' (is Natural
(char "A"))))
(character "A"))))
($.comment "=>")
($.example (' 65)))

Expand Down
10 changes: 5 additions & 5 deletions stdlib/source/documentation/lux/data/text.lux
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@

(the .public documentation
(List $.Documentation)
(let [character (list ... ($.definition /.Char
(let [character (list ... ($.definition /.Character
... "A character code number.")

... ($.definition /.char
... ($.definition /.character
... "Yields the character at the specified index."
... ($.example (' (char index input))))
... ($.example (' (character index input))))

... ($.definition /.of_char)
... ($.definition /.of_character)

($.definition /.\0)
($.definition /.null)
Expand Down Expand Up @@ -299,7 +299,7 @@

($.definition /.space?
"Checks whether the character is white-space."
($.example (' (space? char)))))]
($.example (' (space? character)))))]
(list.partial ($.module /._
"")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@

($.definition /.within?
""
($.example (' (within? block char))))
($.example (' (within? block character))))

(all list#composite
all_1/4
Expand Down
4 changes: 2 additions & 2 deletions stdlib/source/documentation/lux/math/random.lux
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
($.definition /.integer)
($.definition /.revolution)
($.definition /.decimal)
($.definition /.char)
($.definition /.character)

($.definition /.safe_decimal
"A number in the interval [0.0,1.0]."))
Expand All @@ -35,7 +35,7 @@

($.definition /.text
""
($.example (' (text char_gen size)))))]
($.example (' (text character_gen size)))))]
(list.partial ($.module /._
"Pseudo-random number generation (PRNG) algorithms.")

Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/documentation/lux/world/locale/territory.lux
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

(.require
[library
[lux (.except char)
[lux (.except)
["$" documentation]
[data
[collection
Expand Down
2 changes: 1 addition & 1 deletion stdlib/source/library/lux.lux
Original file line number Diff line number Diff line change
Expand Up @@ -5892,7 +5892,7 @@
(macro (_ tokens compiler)
{#Right [compiler tokens]}))

(the .public char
(the .public character
(macro (_ tokens compiler)
(when tokens
(list [_ {#Text input}])
Expand Down
6 changes: 3 additions & 3 deletions stdlib/source/library/lux/data/color/terminal.lux
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
[equivalence (.only Equivalence)]]
[data
["[0]" text (.only)
["[0]" char]
["%" \\injection]]]
["%" \\injection]
["[0]" character]]]
[math
[number
["n" natural]]]
Expand Down Expand Up @@ -39,7 +39,7 @@

(the command
Text
(%.message (text.of_char char.escape) "["))
(%.message (text.of_character character.escape) "["))

(the .public (with command text)
(-> Command Text
Expand Down
10 changes: 5 additions & 5 deletions stdlib/source/library/lux/data/format/json.lux
Original file line number Diff line number Diff line change
Expand Up @@ -426,22 +426,22 @@
(<text>.exactly! 4)
<text>.slice
(<>.format natural.hex)
(<>#each text.of_char)))
(<>#each text.of_character)))
)))

(the string_projection
(Projection String)
(<| (<text>.enclosed [text.double_quote text.double_quote])
(loop (again [_ []]))
(do [! <>.monad]
[chars (<text>.some (<text>.none_of (text#composite "\" text.double_quote)))
[characters (<text>.some (<text>.none_of (text#composite "\" text.double_quote)))
stop <text>.next])
(if (text.= "\" stop)
(do !
[escaped escaped_projection
next_chars (again [])]
(in (all text#composite chars escaped next_chars)))
(in chars))))
next_characters (again [])]
(in (all text#composite characters escaped next_characters)))
(in characters))))

(the (kv_projection json_projection)
(-> (Projection JSON)
Expand Down
48 changes: 24 additions & 24 deletions stdlib/source/library/lux/data/format/tar.lux
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[library
[lux (.except Mode
#mode
and)
and character)
[ffi (.only)]
[abstract
[monad (.only do)]
Expand All @@ -22,7 +22,7 @@
["![1]" \\injection (.only Injection) (.use "[1]#[0]" monoid)]
["?[1]" \\projection (.only Projection)]]
["[0]" text (.only)
[char (.only Char)]
[character (.only Character)]
["%" \\injection]
[encoding
["[0]" utf8]]]
Expand Down Expand Up @@ -131,7 +131,7 @@
)

(exception.the .public (wrong_character [expected actual])
(Exception [Char Char])
(Exception [Character Character])
(exception.report
(list ["Expected" (%.natural expected)]
["Actual" (%.natural actual)])))
Expand All @@ -149,11 +149,11 @@
(Projection Any)
(<| (function (_ state))
(parsed state pre_end ?binary.bits_8)
(let [expected (`` (char (,, (static ..blank))))])
(let [expected (`` (.character (,, (static ..blank))))])
(if (not (n.= expected pre_end))
(exception.except ..wrong_character [expected pre_end]))
(parsed state end ?binary.bits_8)
(let [expected (`` (char (,, (static ..null))))])
(let [expected (`` (.character (,, (static ..null))))])
(if (not (n.= expected end))
(exception.except ..wrong_character [expected end]))
{try.#Success [state []]}))
Expand All @@ -175,7 +175,7 @@
(parsed state digits (?binary.segment ..big_size))
(parsed state digits (<>.of_try (of utf8.format projection digits)))
(parsed state end ?binary.bits_8)
(let [expected (`` (char (,, (static ..blank))))])
(let [expected (`` (.character (,, (static ..blank))))])
(if (not (n.= expected end))
(exception.except ..wrong_character [expected end]))
(do [! try.monad]
Expand Down Expand Up @@ -241,16 +241,16 @@
)

(the last_ascii
Char
Character
(number.hex "007F"))

(the ascii?
(-> Text
Bit)
(|>> (of utf8.format injection)
(binary.mix (function (_ char verdict)
(binary.mix (function (_ character verdict)
(.and verdict
(n.<= ..last_ascii char)))
(n.<= ..last_ascii character)))
true)))

(exception.the .public (not_ascii text)
Expand All @@ -272,9 +272,9 @@
(loop (again [end (-- size)])
(when end
0 (of utf8.format injection "")
_ (let [last_char (binary!.bits_8 end string)]
(`` (when (.natural last_char)
(char (,, (static ..null)))
_ (let [last_character (binary!.bits_8 end string)]
(`` (when (.natural last_character)
(.character (,, (static ..null)))
(again (-- end))

_
Expand Down Expand Up @@ -322,7 +322,7 @@
(<| (function (_ state))
(parsed state string (?binary.segment <size>))
(parsed state end ?binary.bits_8)
(let [expected (`` (char (,, (static ..null))))])
(let [expected (`` (.character (,, (static ..null))))])
(if (not (n.= expected end))
(exception.except ..wrong_character [expected end]))
(do [! try.monad]
Expand Down Expand Up @@ -365,7 +365,7 @@
(<| (function (_ state))
(parsed state string (?binary.segment ..magic_size))
(parsed state end ?binary.bits_8)
(let [expected (`` (char (,, (static ..null))))])
(let [expected (`` (.character (,, (static ..null))))])
(if (not (n.= expected end))
(exception.except ..wrong_character [expected end]))
(of try.monad each (|>> nominal.abstraction [state])
Expand Down Expand Up @@ -432,11 +432,11 @@
(..small_number ..device_size)))

(nominal.every Link_Flag
Char
Character

(the link_flag
(-> Link_Flag
Char)
Character)
(|>> nominal.representation))

(the link_flag_injection
Expand All @@ -445,14 +445,14 @@
!binary.bits_8))

(expansion.let [<options> (these [0 old_normal]
[(char "0") normal]
[(char "1") link]
[(char "2") symbolic_link]
[(char "3") character]
[(char "4") block]
[(char "5") directory]
[(char "6") fifo]
[(char "7") contiguous])]
[(.character "0") normal]
[(.character "1") link]
[(.character "2") symbolic_link]
[(.character "3") character]
[(.character "4") block]
[(.character "5") directory]
[(.character "6") fifo]
[(.character "7") contiguous])]
(these (template.with [<flag> <name>]
[(the <name>
Link_Flag
Expand Down
22 changes: 11 additions & 11 deletions stdlib/source/library/lux/data/format/xml.lux
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
(the namespace_separator
":")

(the xml_standard_escape_char^
(the xml_standard_escape_character^
(Projection Text)
(all <>.either
(<>.after (<text>.this "&lt;") (<>#in "<"))
Expand All @@ -58,11 +58,11 @@
(<>.after (<text>.this "&quot;") (<>#in text.double_quote))
))

(the xml_unicode_escape_char^
(the xml_unicode_escape_character^
(Projection Text)
(|> (do [! <>.monad]
[hex? (<>.maybe (<text>.this "x"))]
(<| (of ! each (|>> .natural text.of_char))
(<| (of ! each (|>> .natural text.of_character))
(<>.format integer.base_10)
<text>.slice
<text>.many!
Expand All @@ -75,15 +75,15 @@
(<>.before (<text>.this ";"))
(<>.after (<text>.this "&#"))))

(the xml_escape_char^
(the xml_escape_character^
(Projection Text)
(<>.either xml_standard_escape_char^
xml_unicode_escape_char^))
(<>.either xml_standard_escape_character^
xml_unicode_escape_character^))

(the xml_char^
(the xml_character^
(Projection Text)
(<>.either (<text>.none_of (all text#composite "<>&" text.double_quote))
xml_escape_char^))
xml_escape_character^))

(the xml_identifier
(Projection Text)
Expand Down Expand Up @@ -119,7 +119,7 @@

(the attr_value^
(Projection Text)
(let [value^ (<text>.some xml_char^)]
(let [value^ (<text>.some xml_character^)]
(<>.either (<text>.enclosed [text.double_quote text.double_quote] value^)
(<text>.enclosed ["'" "'"] value^))))

Expand Down Expand Up @@ -167,13 +167,13 @@

(the text^
(Projection XML)
(|> (..spaced^ (<text>.many xml_char^))
(|> (..spaced^ (<text>.many xml_character^))
(<>.either (<text>.slice cdata^))
(<>#each (|>> {#Text}))))

(the null^
(Projection Any)
(<text>.this (text.of_char 0)))
(<text>.this (text.of_character 0)))

(the xml^
(Projection XML)
Expand Down
Loading

0 comments on commit 3c77407

Please sign in to comment.