summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2021-09-09 17:36:18 -0700
committerAdrian Thurston <thurston@colm.net>2021-09-09 17:36:18 -0700
commit159c9a44359291ce5954d4779988b79f6cef0341 (patch)
treee81cfee20de0cf85bea3e08c6e9b59e358564ef9
parent0efb9a4774b3e3c830b44d6e70c5936e7a0be499 (diff)
downloadragel-159c9a44359291ce5954d4779988b79f6cef0341.tar.gz
need to use Bytes.to_string on buffer objects
Now need to convert the buffer to a string before passing to functions that expect string.
-rw-r--r--test/ragel.d/trans-ocaml.lm4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ragel.d/trans-ocaml.lm b/test/ragel.d/trans-ocaml.lm
index 6cec5ad4..57e094fb 100644
--- a/test/ragel.d/trans-ocaml.lm
+++ b/test/ragel.d/trans-ocaml.lm
@@ -50,7 +50,7 @@ int rw_ocaml_factor( Factor: indep::factor )
case [`buffer]
{
send Out
- "String.sub buffer 0 blen.contents"
+ "( String.sub ( Bytes.to_string buffer ) 0 blen.contents )"
}
case [`blen]
{
@@ -183,7 +183,7 @@ int rw_ocaml_print_stmt( Stmt: indep::print_stmt )
else if match Stmt [`print_buf `;]
{
send Out
- "print_string( String.sub buffer 0 blen.contents );
+ "print_string( String.sub ( Bytes.to_string buffer ) 0 blen.contents );
}
else if match Stmt [`print_str expr `;]
{