Skip to content

Commit a828139

Browse files
authored
Merge pull request #3895 from maxonfjvipon/bug/#3300/more-strict-objects-retrival
bug(#3300): refactored `PhPackage`
2 parents 69641a3 + 684c0dd commit a828139

120 files changed

Lines changed: 344 additions & 614 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eo-runtime/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ SOFTWARE.
235235
<goals>
236236
<goal>register</goal>
237237
<goal>compile</goal>
238-
<goal>lint</goal>
239238
<goal>transpile</goal>
240239
<goal>xmir-to-phi</goal>
241240
<goal>phi-to-xmir</goal>
@@ -244,11 +243,6 @@ SOFTWARE.
244243
<goal>unspile</goal>
245244
</goals>
246245
<configuration>
247-
<removeBinaries>
248-
<glob>EOorg/EOeolang/EOhamcrest/**</glob>
249-
<glob>EOorg/EOeolang/EOmath/**</glob>
250-
<glob>EOorg/EOeolang/EOfs/**</glob>
251-
</removeBinaries>
252246
<withRuntimeDependency>false</withRuntimeDependency>
253247
<placeBinariesThatHaveSources>true</placeBinariesThatHaveSources>
254248
</configuration>

eo-runtime/src/main/eo/org/eolang/bytes.eo

Lines changed: 44 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
+rt jvm org.eolang:eo-runtime:0.0.0
2828
+rt node eo2js-runtime:0.0.0
2929
+version 0.0.0
30-
+unlint object-has-data
31-
+unlint broken-alias-second
3230

3331
# The object encapsulates a chain of bytes, adding a few
3432
# convenient operations to it. Objects like `int`, `string`,
@@ -37,27 +35,55 @@
3735
data > @
3836
$ > as-bytes
3937
eq 01- > as-bool
40-
4138
# Turn this chain of eight bytes into a number.
4239
# If there are less or more than eight bytes, there will
4340
# be an error returned.
44-
[] > as-number
45-
if. > @
46-
eq nan.as-bytes
47-
nan
41+
if. > as-number
42+
eq nan.as-bytes
43+
nan
44+
if.
45+
eq positive-infinity.as-bytes
46+
positive-infinity
4847
if.
49-
eq positive-infinity.as-bytes
50-
positive-infinity
48+
eq negative-infinity.as-bytes
49+
negative-infinity
5150
if.
52-
eq negative-infinity.as-bytes
53-
negative-infinity
54-
if.
55-
size.eq 8
56-
number ^
57-
error
58-
sprintf
59-
"Can't convert non 8 length bytes to a number, bytes are %x"
60-
* ^
51+
size.eq 8
52+
number $
53+
error
54+
sprintf
55+
"Can't convert non 8 length bytes to a number, bytes are %x"
56+
* $
57+
# Turn this chain of eight bytes into a i64 number.
58+
# If there are less or more than eight bytes, there will
59+
# be an error returned.
60+
if. > as-i64
61+
size.eq 8
62+
i64 $
63+
error
64+
sprintf
65+
"Can't convert non 8 length bytes to i64, bytes are %x"
66+
* $
67+
# Turn this chain of four bytes into a i32 number.
68+
# If there are less or more than four bytes, there will
69+
# be an error returned.
70+
if. > as-i32
71+
size.eq 4
72+
i32 $
73+
error
74+
sprintf
75+
"Can't convert non 4 length bytes to i32, bytes are %x"
76+
* $
77+
# Turn this chain of two bytes into a i16 number.
78+
# If there are less or more than two bytes, there will
79+
# be an error returned.
80+
if. > as-i16
81+
size.eq 2
82+
i16 $
83+
error
84+
sprintf
85+
"Can't convert non 2 length bytes to i16, bytes are %x"
86+
* $
6187

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

73-
# Turn this chain of eight bytes into a i64 number.
74-
# If there are less or more than eight bytes, there will
75-
# be an error returned.
76-
[] > as-i64
77-
if. > @
78-
size.eq 8
79-
i64 ^
80-
error
81-
sprintf
82-
"Can't convert non 8 length bytes to i64, bytes are %x"
83-
* ^
84-
85-
# Turn this chain of four bytes into a i32 number.
86-
# If there are less or more than four bytes, there will
87-
# be an error returned.
88-
[] > as-i32
89-
if. > @
90-
size.eq 4
91-
i32 ^
92-
error
93-
sprintf
94-
"Can't convert non 4 length bytes to i32, bytes are %x"
95-
* ^
96-
97-
# Turn this chain of two bytes into a i16 number.
98-
# If there are less or more than two bytes, there will
99-
# be an error returned.
100-
[] > as-i16
101-
if. > @
102-
size.eq 2
103-
i16 ^
104-
error
105-
sprintf
106-
"Can't convert non 2 length bytes to i16, bytes are %x"
107-
* ^
108-
10999
# Calculate the bitwise and operation.
110100
[b] > and /org.eolang.bytes
111101

eo-runtime/src/main/eo/org/eolang/cti.eo

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
+home https://github.com/objectionary/eo
2525
+package org.eolang
2626
+version 0.0.0
27-
+unlint object-has-data
2827

2928
# Compile Time Instruction (CTI).
3029
#

eo-runtime/src/main/eo/org/eolang/dataized.eo

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
+home https://github.com/objectionary/eo
2525
+package org.eolang
2626
+version 0.0.0
27-
+unlint object-has-data
2827

2928
# The object dataizes `target`, makes new instance of `bytes` from given data and behaves as result
3029
# `bytes`.

eo-runtime/src/main/eo/org/eolang/error.eo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
+rt jvm org.eolang:eo-runtime:0.0.0
2727
+rt node eo2js-runtime:0.0.0
2828
+version 0.0.0
29-
+unlint object-has-data
29+
+unlint unit-test-missing
3030

3131
# This object must be used in order to terminate the program
3232
# due to an error. Just make a copy of it with any encapsulated object.

eo-runtime/src/main/eo/org/eolang/false.eo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
+home https://github.com/objectionary/eo
2525
+package org.eolang
2626
+version 0.0.0
27-
+unlint object-has-data
27+
+unlint unit-test-missing
2828

2929
# The object is a FALSE boolean state.
3030
[] > false

eo-runtime/src/main/eo/org/eolang/fs/dir.eo

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
+rt jvm org.eolang:eo-runtime:0.0.0
2828
+rt node eo2js-runtime:0.0.0
2929
+version 0.0.0
30-
+unlint object-has-data
31-
+unlint broken-alias-second
3230

3331
# Directory in the file system.
3432
# Apparently every directory is a file.

eo-runtime/src/main/eo/org/eolang/fs/file.eo

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
+rt jvm org.eolang:eo-runtime:0.0.0
2828
+rt node eo2js-runtime:0.0.0
2929
+version 0.0.0
30-
+unlint object-has-data
31-
+unlint broken-ref
32-
+unlint broken-alias-second
3330

3431
# The file object in the filesystem.
3532
[path] > file

eo-runtime/src/main/eo/org/eolang/fs/path.eo

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
+home https://github.com/objectionary/eo
3131
+package org.eolang.fs
3232
+version 0.0.0
33-
+unlint object-has-data
34-
+unlint broken-ref
35-
+unlint broken-alias-second
36-
+unlint unused-alias
3733

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

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

63-
# The system-dependent default name-separator character.
64-
# On UNIX systems the value of this field is "/";
65-
# on Microsoft Windows systems it is "\\".
66-
[] > separator
67-
if. > @
68-
os.is-windows
69-
win32.separator
70-
posix.separator
71-
7266
# POSIX specified path.
7367
# A standardized way to represent file or directory locations in a Unix-like system.
7468
[uri] > posix
7569
$ > determined
7670
"/" > separator
7771
(file uri).as-file > as-file
7872
(dir (QQ.fs.file uri)).as-dir > as-dir
79-
uri > @
80-
8173
# Returns `true` if current path is absolute - starts with '/' char.
82-
[] > is-absolute
83-
and. > @
84-
uri.length.gt 0
85-
(uri.as-bytes.slice 0 1).eq separator
74+
and. > is-absolute
75+
uri.length.gt 0
76+
(uri.as-bytes.slice 0 1).eq separator
77+
uri > @
8678

8779
# Return new `path` with normalized uri.
8880
# Normalization includes:

eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@
2828
+home https://github.com/objectionary/eo
2929
+package org.eolang.fs
3030
+version 0.0.0
31-
+unlint object-has-data
32-
+unlint broken-ref
33-
+unlint broken-alias-second
34-
+unlint unused-alias
3531

3632
# Temporary directory.
3733
# For Unix/MacOS uses the path supplied by the first environment variable

0 commit comments

Comments
 (0)