From 98cd1d82b5a48df4a4d4288043a381ba128c3591 Mon Sep 17 00:00:00 2001 From: Young-Flash Date: Wed, 4 Sep 2024 15:32:04 +0800 Subject: [PATCH] internal: rename driver ffi external type --- .../moonbuild/template/test_driver_template.mbt | 16 ++++++++-------- .../moonbuild/template/test_driver_template2.mbt | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/crates/moonbuild/template/test_driver_template.mbt b/crates/moonbuild/template/test_driver_template.mbt index a77b4e0c..add8ea1a 100644 --- a/crates/moonbuild/template/test_driver_template.mbt +++ b/crates/moonbuild/template/test_driver_template.mbt @@ -171,7 +171,7 @@ fn main { // =========== ffi start =========== -fn _moonbit_test_driver_internal_get_file_name() -> ExternString = "test" "get_file_name" +fn _moonbit_test_driver_internal_get_file_name() -> MoonbitTestDriverInternalExternString = "test" "get_file_name" fn moonbit_test_driver_internal_get_file_name() -> String { let file_name = _moonbit_test_driver_internal_get_file_name() moonbit_test_driver_internal_string_from_extern(file_name) @@ -179,18 +179,18 @@ fn moonbit_test_driver_internal_get_file_name() -> String { fn moonbit_test_driver_internal_get_index() -> Int = "test" "get_index" -type StringReadHandle +type MoonbitTestDriverInternalStringReadHandle -type ExternString +type MoonbitTestDriverInternalExternString -fn moonbit_test_driver_internal_begin_read_string(s : ExternString) -> StringReadHandle = "__moonbit_fs_unstable" "begin_read_string" +fn moonbit_test_driver_internal_begin_read_string(s : MoonbitTestDriverInternalExternString) -> MoonbitTestDriverInternalStringReadHandle = "__moonbit_fs_unstable" "begin_read_string" -fn moonbit_test_driver_internal_string_read_char(handle : StringReadHandle) -> Int = "__moonbit_fs_unstable" "string_read_char" +fn moonbit_test_driver_internal_string_read_char(handle : MoonbitTestDriverInternalStringReadHandle) -> Int = "__moonbit_fs_unstable" "string_read_char" -fn moonbit_test_driver_internal_finish_read_string(handle : StringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" +fn moonbit_test_driver_internal_finish_read_string(handle : MoonbitTestDriverInternalStringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" -fn moonbit_test_driver_internal_string_from_extern(e : ExternString) -> String { - let buf = Buffer::new() +fn moonbit_test_driver_internal_string_from_extern(e : MoonbitTestDriverInternalExternString) -> String { + let buf = @moonbitlang/core/builtin.Buffer::new() let handle = moonbit_test_driver_internal_begin_read_string(e) while true { let ch = moonbit_test_driver_internal_string_read_char(handle) diff --git a/crates/moonbuild/template/test_driver_template2.mbt b/crates/moonbuild/template/test_driver_template2.mbt index 2bd5f34d..f68810b9 100644 --- a/crates/moonbuild/template/test_driver_template2.mbt +++ b/crates/moonbuild/template/test_driver_template2.mbt @@ -129,7 +129,7 @@ fn main { // =========== ffi start =========== -fn _moonbit_test_driver_internal_get_file_name() -> ExternString = "test" "get_file_name" +fn _moonbit_test_driver_internal_get_file_name() -> MoonbitTestDriverInternalExternString = "test" "get_file_name" fn moonbit_test_driver_internal_get_file_name() -> String { let file_name = _moonbit_test_driver_internal_get_file_name() moonbit_test_driver_internal_string_from_extern(file_name) @@ -137,18 +137,18 @@ fn moonbit_test_driver_internal_get_file_name() -> String { fn moonbit_test_driver_internal_get_index() -> Int = "test" "get_index" -type StringReadHandle +type MoonbitTestDriverInternalStringReadHandle -type ExternString +type MoonbitTestDriverInternalExternString -fn moonbit_test_driver_internal_begin_read_string(s : ExternString) -> StringReadHandle = "__moonbit_fs_unstable" "begin_read_string" +fn moonbit_test_driver_internal_begin_read_string(s : MoonbitTestDriverInternalExternString) -> MoonbitTestDriverInternalStringReadHandle = "__moonbit_fs_unstable" "begin_read_string" -fn moonbit_test_driver_internal_string_read_char(handle : StringReadHandle) -> Int = "__moonbit_fs_unstable" "string_read_char" +fn moonbit_test_driver_internal_string_read_char(handle : MoonbitTestDriverInternalStringReadHandle) -> Int = "__moonbit_fs_unstable" "string_read_char" -fn moonbit_test_driver_internal_finish_read_string(handle : StringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" +fn moonbit_test_driver_internal_finish_read_string(handle : MoonbitTestDriverInternalStringReadHandle) = "__moonbit_fs_unstable" "finish_read_string" -fn moonbit_test_driver_internal_string_from_extern(e : ExternString) -> String { - let buf = Buffer::new() +fn moonbit_test_driver_internal_string_from_extern(e : MoonbitTestDriverInternalExternString) -> String { + let buf = @moonbitlang/core/builtin.Buffer::new() let handle = moonbit_test_driver_internal_begin_read_string(e) while true { let ch = moonbit_test_driver_internal_string_read_char(handle)