[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 06/12] libpoke: Fix trivial errors
From: |
Mohammad-Reza Nabipoor |
Subject: |
[PATCH 06/12] libpoke: Fix trivial errors |
Date: |
Wed, 26 May 2021 02:51:09 +0430 |
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (return): s/jitter_int/jitter_uint/.
(popf): s/JITTER_ARGN0/JITTER_ARGU0/.
(sconc): Remove useless `#undef F`.
(bnzi): Fix type s/bzni/bnzi/.
(substr): Fix doc.
(ains): Likewise.
(indent): Fix typo.
(mka): Remove redundant array offset initialization.
* libpoke/ras (BEGIN): Use `\"` instead of `\\\"`.
---
ChangeLog | 12 ++++++++++++
libpoke/pvm.jitter | 21 +++++++++------------
libpoke/ras | 2 +-
3 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f668ffc3..951da58f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
+
+ * libpoke/pvm.jitter (return): s/jitter_int/jitter_uint/.
+ (popf): s/JITTER_ARGN0/JITTER_ARGU0/.
+ (sconc): Remove useless `#undef F`.
+ (bnzi): Fix type s/bzni/bnzi/.
+ (substr): Fix doc.
+ (ains): Likewise.
+ (indent): Fix typo.
+ (mka): Remove redundant array offset initialization.
+ * libpoke/ras (BEGIN): Use `\"` instead of `\\\"`.
+
2021-05-22 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-rt.pk (_pkl_unit_name): Fix typo. s/gigi/gibi/
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index 2ead1a7c..176fad7d 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -1639,7 +1639,7 @@ instruction return ()
/* Restore the environment of the caller. Note the cast to
jitter_uint is to avoid a warning in 32-bit. */
- jitter_state_runtime.env = (pvm_env) (jitter_int) JITTER_TOP_RETURNSTACK
();
+ jitter_state_runtime.env = (pvm_env) (jitter_uint) JITTER_TOP_RETURNSTACK
();
JITTER_DROP_RETURNSTACK();
return_address = JITTER_TOP_RETURNSTACK();
@@ -1678,7 +1678,7 @@ instruction popf (?n popf_printer)
code
jitter_uint i;
- for (i = 0; i < JITTER_ARGN0; ++i)
+ for (i = 0; i < JITTER_ARGU0; ++i)
jitter_state_runtime.env
= pvm_env_pop_frame (jitter_state_runtime.env);
end
@@ -1801,7 +1801,7 @@ end
# 16 - print the number in hexadecimal.
# Any other value - print the number in decimal.
-# Instruction: printind
+# Instruction: indent
#
# Indent the output in the terminal for LVL levels of indentation,
# using STEP white chars in each indentation level.
@@ -3249,7 +3249,6 @@ instruction sconc ()
res = pvm_make_string_nodup (s);
JITTER_PUSH_STACK (res);
-#undef F
end
end
@@ -3810,7 +3809,7 @@ instruction bzlu (?f)
end
end
-# Instruction: bzni LABEL
+# Instruction: bnzi LABEL
#
# Branch to the given LABEL if the integer at the top of the stack
# is nonzero.
@@ -4160,7 +4159,7 @@ end
# Instruction: substr
#
-# Given a string and two indexes FROM AND to conforming a semi-open
+# Given a string and two indices FROM and TO conforming a semi-open
# interval [FROM,TO), push the substring enclosed by that interval.
#
# Both indexes are zero-based.
@@ -4244,7 +4243,6 @@ instruction mka ()
pvm_val arr = pvm_make_array (JITTER_TOP_STACK (),
JITTER_UNDER_TOP_STACK ());
- PVM_VAL_ARR_OFFSET (arr) = PVM_MAKE_ULONG (0, 64);
JITTER_DROP_STACK ();
JITTER_DROP_STACK ();
JITTER_PUSH_STACK (arr);
@@ -4253,8 +4251,7 @@ end
# Instruction: ains
#
-# Insert a new element VAL, with bit-offset BOFF, at the end of
-# the array ARR, making it grow.
+# Insert a new element VAL, at the end of the array ARR, making it grow.
#
# If IDX is less than the current size of the array, the value is
# stored in the referred argument.
@@ -4266,9 +4263,9 @@ end
#
# a = [a1, a2, a3]
#
-# [a1, a2, a3] BOFF 2 VAL ains -> INVAL exception
-# [a1, a2, a3] BOFF 3 VAL ains -> [a1, a2, a3, VAL]
-# [a1, a2, a3] BOFF 5 VAL ains -> [a1, a2, a3, VAL, VAL, VAL]
+# [a1, a2, a3] 2 VAL ains -> INVAL exception
+# [a1, a2, a3] 3 VAL ains -> [a1, a2, a3, VAL]
+# [a1, a2, a3] 5 VAL ains -> [a1, a2, a3, VAL, VAL, VAL]
#
# Stack: ( ARR IDX VAL -- ARR )
# Exceptions: PVM_E_INVAL
diff --git a/libpoke/ras b/libpoke/ras
index 5dfc3f38..3f300332 100755
--- a/libpoke/ras
+++ b/libpoke/ras
@@ -503,7 +503,7 @@ BEGIN {
null_re="null"
int_re="(u?int)<([0-9]+)>(-?(0x)?[0-9]+)"
long_re="(u?long)<([0-9]+)>(-?(0x)?[0-9]+)"
- string_re="(\"([^\"]|\\\")*\")"
+ string_re="(\"([^\"]|\")*\")"
var_re="(\\$[a-zA-Z][0-9a-zA-Z_]*)"
expt_re="(PVM_E_[A-Z_]+)"
anode_re="@([a-zA-Z_][0-9a-zA-Z_]*)"
--
2.31.1
- Re: [PATCH 03/12] libpoke: Fix `muls` insn to use `pvm_alloc`, (continued)
- [PATCH 02/12] doc/learn-poke-in-y-minutes.pk: Update, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 04/12] libpoke/pvm.jitter: Use more `pvm_make_string_nodup`, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 05/12] libpoke/pkl-rt.pk: Fix typo s/gigi/gibi/, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 06/12] libpoke: Fix trivial errors,
Mohammad-Reza Nabipoor <=
- [PATCH 07/12] libpoke: Add `__pkl_unsafe_string_set` builtin, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 08/12] libpoke: Fix printf %v for strings to give valid literals, Mohammad-Reza Nabipoor, 2021/05/25
- [PATCH 09/12] libpoke: Fix a bug and add assertions to pvm_make_*, Mohammad-Reza Nabipoor, 2021/05/25