[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/3] libpoke: Add skeleton for string properties instructions
From: |
Mohammad-Reza Nabipoor |
Subject: |
[PATCH v2 1/3] libpoke: Add skeleton for string properties instructions |
Date: |
Tue, 8 Jun 2021 03:52:05 +0430 |
Adds three new instruction to handle string properties. But there's
no implementation yet. This is useful for the implementation of
`format`.
2021-06-06 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 3b14d129..febeb753 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2021-06-06 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-06-05 Jose E. Marchesi <jemarch@gnu.org>
* configure.ac: Update for 1.3.
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 0b6da709..c111d1f3 100644
--- a/libpoke/pvm.jitter
+++ b/libpoke/pvm.jitter
@@ -4262,6 +4262,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 v2 2/3] pkl: Fix codegen of printf, Mohammad-Reza Nabipoor, 2021/06/07