Hello,
This minor patch add a primitive to get a list of s-expression from a
boxed C string of a strbuf.
This is only the MELT part, as the called C code was already written.
I compiled and test it.
Thanks!
Pierre Vittet
2011-07-18 Pierre Vittet <pier...@pvittet.com>
* melt/warmelt-base.melt (read_strv): New primitive.
Index: gcc/melt/warmelt-base.melt
===================================================================
--- gcc/melt/warmelt-base.melt (revision 176434)
+++ gcc/melt/warmelt-base.melt (working copy)
@@ -272,6 +272,11 @@ number $NUM opaque location number $LOC.}#
:doc #{Read from file named by the $FILNAM string balue a list of MELT
s-expressions.}#
#{(meltgc_read_file (melt_string_str((melt_ptr_t)($filnam)), (char*)0))}#)
+(defprimitive read_strv (strv) :value
+ :doc #{Return the list of sexpr contained in $STRV. $STRV can be a boxed
+ string or a strbuf value.}#
+ #{(meltgc_read_from_val ($strv, NULL))}#
+)
;; to signal an error in a source with some additional string value
(defprimitive error_strv (loc :cstring cmsg :value strv) :void
@@ -2441,6 +2446,7 @@ polyhedron values.}#
pair_set_head
ppstrbuf_mixbigint
read_file
+ read_strv
register_pass_execution_hook
register_pragma_handler
register_pre_genericize_hook