[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/12] libpoke: Add skeleton for string properties instructions
From: |
Mohammad-Reza Nabipoor |
Subject: |
[PATCH 10/12] libpoke: Add skeleton for string properties instructions |
Date: |
Wed, 26 May 2021 02:51:13 +0430 |
Adds three new instruction to handle string properties. But there's
no implementation yet. This is useful for the implementation of
`format`.
2021-05-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pvm.jitter (sprops): Add instruction for
"string property style", but with no implementation.
(sproph): Add instruction for "string property hyperlink", but with
no implementation.
(spropc): Add instruction for "string property clear", but with no
implementation.
* libpoke/pkl-insn.def: Add new instructions.
---
ChangeLog | 10 ++++++++++
libpoke/pkl-insn.def | 3 +++
libpoke/pvm.jitter | 47 ++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 60 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 77bc4ca7..ba235f82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-05-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
+
+ * libpoke/pvm.jitter (sprops): Add instruction for
+ "string property style", but with no implementation.
+ (sproph): Add instruction for "string property hyperlink", but with
+ no implementation.
+ (spropc): Add instruction for "string property clear", but with no
+ implementation.
+ * libpoke/pkl-insn.def: Add new instructions.
+
2021-05-23 Mohammad-Reza Nabipoor <mnabipoor@gnu.org>
* libpoke/pkl-gen.pks (struct_constructor): s/uint<64>/ulong<64>.
diff --git a/libpoke/pkl-insn.def b/libpoke/pkl-insn.def
index 3b059dbd..15a5a32a 100644
--- a/libpoke/pkl-insn.def
+++ b/libpoke/pkl-insn.def
@@ -238,6 +238,9 @@ PKL_DEF_INSN(PKL_INSN_STRREF,"","strref")
PKL_DEF_INSN(PKL_INSN_STRSET,"","strset")
PKL_DEF_INSN(PKL_INSN_SUBSTR,"","substr")
PKL_DEF_INSN(PKL_INSN_MULS,"","muls")
+PKL_DEF_INSN(PKL_INSN_SPROPS,"","sprops")
+PKL_DEF_INSN(PKL_INSN_SPROPH,"","sproph")
+PKL_DEF_INSN(PKL_INSN_SPROPC,"","spropc")
/* Offset instructions. */
diff --git a/libpoke/pvm.jitter b/libpoke/pvm.jitter
index 60b19ee2..b50530cd 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -4258,6 +4258,53 @@ instruction muls ()
end
end
+# Instruction: sprops
+#
+# Given a string STR, set the styling class of the substring with
+# length LEN from index IDX to CLASS.
+#
+# Stack: ( STR IDX LEN CLASS -- STR )
+
+instruction sprops ()
+ code
+ /* FIXME not implemented yet */
+ JITTER_DROP_STACK ();
+ JITTER_DROP_STACK ();
+ JITTER_DROP_STACK ();
+ end
+end
+
+# Instruction: sproph
+#
+# Given a string STR, set the hyperlink property (which characterized
+# by a URL and an ID) of the substring with length LEN from index IDX.
+#
+# Stack: ( STR IDX LEN URL ID -- STR )
+
+instruction sproph ()
+ code
+ /* FIXME not implemented yet */
+ JITTER_DROP_STACK ();
+ JITTER_DROP_STACK ();
+ JITTER_DROP_STACK ();
+ JITTER_DROP_STACK ();
+ end
+end
+
+
+# Instruction: spropc
+#
+# Given a string on the stack, push the copy of the string with all
+# properties cleared.
+#
+# Stack: ( STR -- STR )
+
+instruction spropc ()
+ code
+ /* FIXME not implemented yet */
+ end
+end
+
## Array instructions
--
2.31.1
[PATCH 12/12] pvm.jitter: Wrap std string functions, Mohammad-Reza Nabipoor, 2021/05/25
Re: [PATCH 00/12] Add format function, Jose E. Marchesi, 2021/05/27