Skip to content

Commit

Permalink
Merge pull request #3895 from maxonfjvipon/bug/#3300/more-strict-obje…
Browse files Browse the repository at this point in the history
…cts-retrival

bug(#3300): refactored `PhPackage`
  • Loading branch information
yegor256 authored Feb 7, 2025
2 parents 69641a3 + 684c0dd commit a828139
Show file tree
Hide file tree
Showing 120 changed files with 344 additions and 614 deletions.
6 changes: 0 additions & 6 deletions eo-runtime/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ SOFTWARE.
<goals>
<goal>register</goal>
<goal>compile</goal>
<goal>lint</goal>
<goal>transpile</goal>
<goal>xmir-to-phi</goal>
<goal>phi-to-xmir</goal>
Expand All @@ -244,11 +243,6 @@ SOFTWARE.
<goal>unspile</goal>
</goals>
<configuration>
<removeBinaries>
<glob>EOorg/EOeolang/EOhamcrest/**</glob>
<glob>EOorg/EOeolang/EOmath/**</glob>
<glob>EOorg/EOeolang/EOfs/**</glob>
</removeBinaries>
<withRuntimeDependency>false</withRuntimeDependency>
<placeBinariesThatHaveSources>true</placeBinariesThatHaveSources>
</configuration>
Expand Down
98 changes: 44 additions & 54 deletions eo-runtime/src/main/eo/org/eolang/bytes.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# The object encapsulates a chain of bytes, adding a few
# convenient operations to it. Objects like `int`, `string`,
Expand All @@ -37,27 +35,55 @@
data > @
$ > as-bytes
eq 01- > as-bool

# Turn this chain of eight bytes into a number.
# If there are less or more than eight bytes, there will
# be an error returned.
[] > as-number
if. > @
eq nan.as-bytes
nan
if. > as-number
eq nan.as-bytes
nan
if.
eq positive-infinity.as-bytes
positive-infinity
if.
eq positive-infinity.as-bytes
positive-infinity
eq negative-infinity.as-bytes
negative-infinity
if.
eq negative-infinity.as-bytes
negative-infinity
if.
size.eq 8
number ^
error
sprintf
"Can't convert non 8 length bytes to a number, bytes are %x"
* ^
size.eq 8
number $
error
sprintf
"Can't convert non 8 length bytes to a number, bytes are %x"
* $
# Turn this chain of eight bytes into a i64 number.
# If there are less or more than eight bytes, there will
# be an error returned.
if. > as-i64
size.eq 8
i64 $
error
sprintf
"Can't convert non 8 length bytes to i64, bytes are %x"
* $
# Turn this chain of four bytes into a i32 number.
# If there are less or more than four bytes, there will
# be an error returned.
if. > as-i32
size.eq 4
i32 $
error
sprintf
"Can't convert non 4 length bytes to i32, bytes are %x"
* $
# Turn this chain of two bytes into a i16 number.
# If there are less or more than two bytes, there will
# be an error returned.
if. > as-i16
size.eq 2
i16 $
error
sprintf
"Can't convert non 2 length bytes to i16, bytes are %x"
* $

# Equals to another object.
# A condition where two objects have the same value or content.
Expand All @@ -70,42 +96,6 @@
# Represents a sub-sequence inside the current one.
[start len] > slice /org.eolang.bytes

# Turn this chain of eight bytes into a i64 number.
# If there are less or more than eight bytes, there will
# be an error returned.
[] > as-i64
if. > @
size.eq 8
i64 ^
error
sprintf
"Can't convert non 8 length bytes to i64, bytes are %x"
* ^

# Turn this chain of four bytes into a i32 number.
# If there are less or more than four bytes, there will
# be an error returned.
[] > as-i32
if. > @
size.eq 4
i32 ^
error
sprintf
"Can't convert non 4 length bytes to i32, bytes are %x"
* ^

# Turn this chain of two bytes into a i16 number.
# If there are less or more than two bytes, there will
# be an error returned.
[] > as-i16
if. > @
size.eq 2
i16 ^
error
sprintf
"Can't convert non 2 length bytes to i16, bytes are %x"
* ^

# Calculate the bitwise and operation.
[b] > and /org.eolang.bytes

Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/cti.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang
+version 0.0.0
+unlint object-has-data

# Compile Time Instruction (CTI).
#
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/dataized.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang
+version 0.0.0
+unlint object-has-data

# The object dataizes `target`, makes new instance of `bytes` from given data and behaves as result
# `bytes`.
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/main/eo/org/eolang/error.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint unit-test-missing

# This object must be used in order to terminate the program
# due to an error. Just make a copy of it with any encapsulated object.
Expand Down
2 changes: 1 addition & 1 deletion eo-runtime/src/main/eo/org/eolang/false.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
+home https://github.com/objectionary/eo
+package org.eolang
+version 0.0.0
+unlint object-has-data
+unlint unit-test-missing

# The object is a FALSE boolean state.
[] > false
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/fs/dir.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# Directory in the file system.
# Apparently every directory is a file.
Expand Down
3 changes: 0 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/fs/file.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-ref
+unlint broken-alias-second

# The file object in the filesystem.
[path] > file
Expand Down
30 changes: 11 additions & 19 deletions eo-runtime/src/main/eo/org/eolang/fs/path.eo
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.fs
+version 0.0.0
+unlint object-has-data
+unlint broken-ref
+unlint broken-alias-second
+unlint unused-alias

# A `path` represents a path that is hierarchical and composed of a sequence of
# directory and file name elements separated by a special separator or delimiter.
Expand All @@ -45,6 +41,13 @@
string uri.as-bytes
posix
string uri.as-bytes
# The system-dependent default name-separator character.
# On UNIX systems the value of this field is "/";
# on Microsoft Windows systems it is "\\".
if. > separator
os.is-windows
win32.separator
posix.separator

# Utility object that joins given `tuple` of paths with current OS separator
# and normalizes result path.
Expand All @@ -60,29 +63,18 @@
win32 joined-path
posix joined-path

# The system-dependent default name-separator character.
# On UNIX systems the value of this field is "/";
# on Microsoft Windows systems it is "\\".
[] > separator
if. > @
os.is-windows
win32.separator
posix.separator

# POSIX specified path.
# A standardized way to represent file or directory locations in a Unix-like system.
[uri] > posix
$ > determined
"/" > separator
(file uri).as-file > as-file
(dir (QQ.fs.file uri)).as-dir > as-dir
uri > @

# Returns `true` if current path is absolute - starts with '/' char.
[] > is-absolute
and. > @
uri.length.gt 0
(uri.as-bytes.slice 0 1).eq separator
and. > is-absolute
uri.length.gt 0
(uri.as-bytes.slice 0 1).eq separator
uri > @

# Return new `path` with normalized uri.
# Normalization includes:
Expand Down
4 changes: 0 additions & 4 deletions eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.fs
+version 0.0.0
+unlint object-has-data
+unlint broken-ref
+unlint broken-alias-second
+unlint unused-alias

# Temporary directory.
# For Unix/MacOS uses the path supplied by the first environment variable
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/go.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang
+version 0.0.0
+unlint object-has-data
+unlint broken-ref

# Non-conditional forward and backward jumps.
# Forward jump instantly returns provided object to `g.forward` without touching
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/i16.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# The 16 bits signed integer.
# Here `as-bytes` must be a `bytes` object.
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/i32.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# The 32 bits signed integer.
# Here `as-bytes` must be a `bytes` object.
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/i64.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# The 64 bits signed integer.
# Here `as-bytes` must be a `bytes` object.
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/bytes-as-input.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Makes an `input` from bytes.
# Here `bts` is sequence of bytes or an object that can be dataized
Expand Down
3 changes: 0 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/io/console.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second
+unlint unused-alias

# The `console` object is basic I/O object that allows to
# interact with operation system console.
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/dead-input.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Dead input is an input that reads from nowhere and always
# returns empty sequence of bytes `--`.
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/dead-output.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Dead output is an output that writes to nowhere.
[] > dead-output
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/input-length.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Reads all the bytes from provided `input` and returns its length.
[input] > input-length
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/malloc-as-output.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Makes an output from allocated block in memory.
# Here `allocated` is `malloc.of.allocated` object.
Expand Down
4 changes: 1 addition & 3 deletions eo-runtime/src/main/eo/org/eolang/io/stdin.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second
+unlint unused-alias
+unlint unit-test-missing

# The `stdin` object is a convenient wrapper on `console` object
# which is used as input only and allows to read the data from console.
Expand Down
3 changes: 0 additions & 3 deletions eo-runtime/src/main/eo/org/eolang/io/stdout.eo
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second
+unlint unused-alias

# The `stdout` object is convenient wrapper on `console` object which
# uses it as output only and allows to print given argument to console as `string`:
Expand Down
1 change: 0 additions & 1 deletion eo-runtime/src/main/eo/org/eolang/io/tee-input.eo
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
+home https://github.com/objectionary/eo
+package org.eolang.io
+version 0.0.0
+unlint object-has-data

# Tee input is an input that reads from provided `input`,
# writes to provided `output` and behaves as provided `input`.
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/malloc.eo
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-ref

# The `malloc` object is an abstraction of a storage of data in heap
# memory. The implementation of `malloc` is platform dependent. It may
Expand Down
2 changes: 0 additions & 2 deletions eo-runtime/src/main/eo/org/eolang/math/angle.eo
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
+rt jvm org.eolang:eo-runtime:0.0.0
+rt node eo2js-runtime:0.0.0
+version 0.0.0
+unlint object-has-data
+unlint broken-alias-second

# The angle.
# A measure of how much something is tilted or rotated, measured in degrees or radians.
Expand Down
Loading

0 comments on commit a828139

Please sign in to comment.