rapydscript-ng 0.7.21 → 0.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +6 -8
- package/CHANGELOG.md +11 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/publish.py +1 -0
- package/release/baselib-plain-pretty.js +22 -18
- package/release/baselib-plain-ugly.js +3 -3
- package/release/compiler.js +89 -25
- package/release/signatures.json +8 -8
- package/src/ast.pyj +1 -0
- package/src/baselib-containers.pyj +17 -14
- package/src/baselib-internal.pyj +1 -0
- package/src/lib/math.pyj +1 -0
- package/src/lib/random.pyj +27 -3
- package/src/output/operators.pyj +12 -2
- package/src/parse.pyj +4 -1
- package/src/tokenizer.pyj +40 -2
- package/test/baselib.pyj +12 -2
- package/test/collections.pyj +1 -0
- package/test/scoped_flags.pyj +2 -0
- package/test/str.pyj +8 -0
- package/tools/cli.js +6 -1
- package/tools/lint.js +7 -3
package/.github/workflows/ci.yml
CHANGED
|
@@ -5,7 +5,7 @@ env:
|
|
|
5
5
|
|
|
6
6
|
jobs:
|
|
7
7
|
test:
|
|
8
|
-
name: Test on ${{ matrix.os }}
|
|
8
|
+
name: Test on ${{ matrix.os }} LANG ${{ matrix.lang }}
|
|
9
9
|
runs-on: ${{ matrix.os }}
|
|
10
10
|
env:
|
|
11
11
|
LANG: ${{ matrix.lang }}
|
|
@@ -13,12 +13,12 @@ jobs:
|
|
|
13
13
|
strategy:
|
|
14
14
|
matrix:
|
|
15
15
|
include:
|
|
16
|
-
- {
|
|
17
|
-
- {
|
|
18
|
-
- {
|
|
16
|
+
- { os: ubuntu-latest, lang: en_US.UTF-8 }
|
|
17
|
+
- { os: ubuntu-latest, lang: de_DE.UTF-8}
|
|
18
|
+
- { os: ubuntu-latest, lang: hi_IN.UTF-8 }
|
|
19
19
|
|
|
20
|
-
- {
|
|
21
|
-
- {
|
|
20
|
+
- { os: macos-latest, lang: en_US.UTF-8 }
|
|
21
|
+
- { os: windows-latest, lang: en_US.UTF-8 }
|
|
22
22
|
|
|
23
23
|
steps:
|
|
24
24
|
- name: Checkout source code
|
|
@@ -28,8 +28,6 @@ jobs:
|
|
|
28
28
|
|
|
29
29
|
- name: Set up Node ${{ matrix.node }}
|
|
30
30
|
uses: actions/setup-node@master
|
|
31
|
-
with:
|
|
32
|
-
node-version: ${{ matrix.node }}
|
|
33
31
|
|
|
34
32
|
- name: Install deps
|
|
35
33
|
run:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
version 0.7.23
|
|
2
|
+
=======================
|
|
3
|
+
|
|
4
|
+
* Fix consecutive of f-strings without concatenation operator causing a syntax error
|
|
5
|
+
|
|
6
|
+
version 0.7.22
|
|
7
|
+
=======================
|
|
8
|
+
|
|
9
|
+
* Fix assignment operators other than the plain = not working with overload_getitem
|
|
10
|
+
* Fix dict.popitem() removing the first rather than the last item
|
|
11
|
+
|
|
1
12
|
version 0.7.21
|
|
2
13
|
=======================
|
|
3
14
|
|
package/README.md
CHANGED
|
@@ -114,7 +114,7 @@ From NPM for use in your own node project:
|
|
|
114
114
|
|
|
115
115
|
From Git:
|
|
116
116
|
|
|
117
|
-
git clone
|
|
117
|
+
git clone https://github.com/kovidgoyal/rapydscript-ng.git
|
|
118
118
|
cd rapydscript-ng
|
|
119
119
|
sudo npm link .
|
|
120
120
|
npm install # This will automatically install the dependencies for RapydScript
|
package/package.json
CHANGED
package/publish.py
CHANGED
|
@@ -706,7 +706,6 @@ if (!ρσ_list_extend.__argnames__) Object.defineProperties(ρσ_list_extend, {
|
|
|
706
706
|
});
|
|
707
707
|
|
|
708
708
|
function ρσ_list_index(val, start, stop) {
|
|
709
|
-
var idx;
|
|
710
709
|
start = start || 0;
|
|
711
710
|
if (start < 0) {
|
|
712
711
|
start = this.length + start;
|
|
@@ -715,11 +714,7 @@ function ρσ_list_index(val, start, stop) {
|
|
|
715
714
|
throw new ValueError(val + " is not in list");
|
|
716
715
|
}
|
|
717
716
|
if (stop === undefined) {
|
|
718
|
-
|
|
719
|
-
if (idx === -1) {
|
|
720
|
-
throw new ValueError(val + " is not in list");
|
|
721
|
-
}
|
|
722
|
-
return idx;
|
|
717
|
+
stop = this.length;
|
|
723
718
|
}
|
|
724
719
|
if (stop < 0) {
|
|
725
720
|
stop = this.length + stop;
|
|
@@ -756,12 +751,13 @@ if (!ρσ_list_pop.__argnames__) Object.defineProperties(ρσ_list_pop, {
|
|
|
756
751
|
});
|
|
757
752
|
|
|
758
753
|
function ρσ_list_remove(value) {
|
|
759
|
-
var
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
754
|
+
for (var i = 0; i < this.length; i++) {
|
|
755
|
+
if (((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === value || typeof (ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i] === "object" && ρσ_equals((ρσ_expr_temp = this)[(typeof i === "number" && i < 0) ? ρσ_expr_temp.length + i : i], value))) {
|
|
756
|
+
this.splice(i, 1);
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
763
759
|
}
|
|
764
|
-
|
|
760
|
+
throw new ValueError(value + " not in list");
|
|
765
761
|
};
|
|
766
762
|
if (!ρσ_list_remove.__argnames__) Object.defineProperties(ρσ_list_remove, {
|
|
767
763
|
__argnames__ : {value: ["value"]},
|
|
@@ -2002,7 +1998,7 @@ Object.defineProperties(ρσ_dict.prototype, (function(){
|
|
|
2002
1998
|
});
|
|
2003
1999
|
return ρσ_anonfunc;
|
|
2004
2000
|
})();
|
|
2005
|
-
ρσ_dict.prototype.set_default = (function() {
|
|
2001
|
+
ρσ_dict.prototype.set_default = ρσ_dict.prototype.setdefault = (function() {
|
|
2006
2002
|
var ρσ_anonfunc = function (key, defval) {
|
|
2007
2003
|
var j;
|
|
2008
2004
|
j = this.jsmap;
|
|
@@ -2066,13 +2062,20 @@ Object.defineProperties(ρσ_dict.prototype, (function(){
|
|
|
2066
2062
|
})();
|
|
2067
2063
|
ρσ_dict.prototype.popitem = (function() {
|
|
2068
2064
|
var ρσ_anonfunc = function () {
|
|
2069
|
-
var r;
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2065
|
+
var last, e, r;
|
|
2066
|
+
last = null;
|
|
2067
|
+
e = this.jsmap.entries();
|
|
2068
|
+
while (true) {
|
|
2069
|
+
r = e.next();
|
|
2070
|
+
if (r.done) {
|
|
2071
|
+
if (last === null) {
|
|
2072
|
+
throw new KeyError("dict is empty");
|
|
2073
|
+
}
|
|
2074
|
+
this.jsmap.delete(last.value[0]);
|
|
2075
|
+
return last.value;
|
|
2076
|
+
}
|
|
2077
|
+
last = r;
|
|
2073
2078
|
}
|
|
2074
|
-
this.jsmap.delete(r.value[0]);
|
|
2075
|
-
return r.value;
|
|
2076
2079
|
};
|
|
2077
2080
|
if (!ρσ_anonfunc.__module__) Object.defineProperties(ρσ_anonfunc, {
|
|
2078
2081
|
__module__ : {value: "__main__"}
|
|
@@ -2697,6 +2700,7 @@ function ρσ_setitem(obj, key, val) {
|
|
|
2697
2700
|
}
|
|
2698
2701
|
obj[(typeof key === "number" && key < 0) ? obj.length + key : key] = val;
|
|
2699
2702
|
}
|
|
2703
|
+
return val;
|
|
2700
2704
|
};
|
|
2701
2705
|
if (!ρσ_setitem.__argnames__) Object.defineProperties(ρσ_setitem, {
|
|
2702
2706
|
__argnames__ : {value: ["obj", "key", "val"]},
|