Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions eo-runtime/src/main/eo/tt/low-cased.eo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
+alias tt.as-ascii
+alias ss.bytes-as-array
+alias ss.list
+alias ss.reduced
+alias tt.up-cased
+architect yegor256@gmail.com
+home https://github.com/objectionary/eo
+package tt
Expand All @@ -27,13 +27,16 @@
slice.
as-bytes.
as-i64.
code.plus (up-cased text).distance
code.plus distance
7
1
byte
(up-cased text).ascii byte > code
(up-cased text).ascii "Z" > maxcode
(up-cased text).ascii "A" > mincode
as-ascii byte > code
as-ascii "Z" > maxcode
as-ascii "A" > mincode
minus. > distance
as-ascii "a"
as-ascii "A"

# Tests that low-cased converts uppercase text to lowercase.
[] +> tests-converts-text-to-lower-case
Expand Down
17 changes: 5 additions & 12 deletions eo-runtime/src/main/eo/tt/up-cased.eo
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
+alias tt.as-ascii
+alias ss.bytes-as-array
+alias ss.list
+alias ss.reduced
Expand Down Expand Up @@ -30,20 +31,12 @@
7
1
byte
ascii byte > code
ascii "z" > maxcode!
ascii "a" > mincode!
as-ascii byte > code
as-ascii "z" > maxcode!
as-ascii "a" > mincode!
minus. > distance
number mincode
ascii "A"

# Converts character to its ASCII numeric value as number.
[char] > ascii
as-number. > @
as-i64.
concat.
00-00-00-00-00-00-00
char.as-bytes
as-ascii "A"

# Tests that up-cased converts lowercase text to uppercase.
[] +> tests-converts-text-to-upper-case
Expand Down
Loading