Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii committed Mar 19, 2024
1 parent f665bd6 commit 839f990
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
14 changes: 10 additions & 4 deletions Data/String/cork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ tm_tokenize (string s) {
while (pos < N (s)) {
int start= pos;
tm_char_forwards (s, pos);
r << s (start, pos);
r << string (s (start, pos));
}
return r;
}
Expand Down Expand Up @@ -230,7 +230,9 @@ tm_string_split_between_words (string s) {
}
tm_char_forwards (s, i);
}
if (j > 0 && j < n) r << s (0, j) << s (j, n);
if (j > 0 && j < n) {
r << string (s (0, j)) << string (s (j, n));
}
else r << s;
return r;
}
Expand All @@ -245,8 +247,12 @@ tm_string_split_at_spaces (string s) {
j= i++;
}
if (j < 1 || j >= n) r << s;
else if (j == n - 1) r << s (0, j) << s (j, n);
else r << s (0, j) << s (j, j + 1) << s (j + 1, n);
else if (j == n - 1) {
r << string (s (0, j)) << string (s (j, n));
}
else {
r << string (s (0, j)) << string (s (j, j + 1)) << string (s (j + 1, n));
}
return r;
}

Expand Down
4 changes: 2 additions & 2 deletions Kernel/Types/modification.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ clean_split (tree t, path p) {
int i, n1= p->next->item, n2= N (u) - n1;
tree s1, s2;
if (is_atomic (u)) {
s1= u->label (0, n1);
s2= u->label (n1, N (u->label));
s1= tree (u->label (0, n1));
s2= tree (u->label (n1, N (u->label)));
}
else {
s1= tree (u, n1);
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Types/tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ operator== (tree t, string s) {

inline bool
operator== (tree t, const char* s) {
return lolly::data::operator== (t, s);
return lolly::data::operator== (t, as_string (s));
}

inline bool
Expand Down
7 changes: 2 additions & 5 deletions Scheme/S7/s7_tm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@ string_to_tmscm (string s) {

string
tmscm_to_string (tmscm s) {
s7_int len_r= s7_string_length (s);
const char* _r = s7_string (s);
string r (_r, len_r);
return r;
return as_string (_r);
}

/******************************************************************************
Expand All @@ -201,8 +199,7 @@ symbol_to_tmscm (string s) {
string
tmscm_to_symbol (tmscm s) {
const char* _r= s7_symbol_name (s);
string r (_r);
return r;
return as_string (_r);
}

/******************************************************************************
Expand Down
8 changes: 4 additions & 4 deletions Scheme/Scheme/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ object::object (int i) : rep (tm_new<tmscm_object_rep> (int_to_tmscm (i))) {}
object::object (double x)
: rep (tm_new<tmscm_object_rep> (double_to_tmscm (x))) {}
object::object (const char* s)
: rep (tm_new<tmscm_object_rep> (string_to_tmscm (string (s)))) {}
: rep (tm_new<tmscm_object_rep> (string_to_tmscm (as_string (s)))) {}
object::object (string s)
: rep (tm_new<tmscm_object_rep> (string_to_tmscm (s))) {}
object::object (tree t) : rep (tm_new<tmscm_object_rep> (tree_to_tmscm (t))) {}
Expand Down Expand Up @@ -341,7 +341,7 @@ object_to_string (object obj) {

object
scheme_cmd (const char* s) {
return eval ("(lambda () " * string (s) * ")");
return eval ("(lambda () " * as_string (s) * ")");
}

object
Expand Down Expand Up @@ -395,7 +395,7 @@ as_command (object obj) {

object
eval (const char* expr) {
return tmscm_to_object (eval_scheme (expr));
return tmscm_to_object (eval_scheme (as_string (expr)));
}
object
eval (string expr) {
Expand All @@ -421,7 +421,7 @@ exec_file (url u) {

object
call (const char* fun) {
return tmscm_to_object (call_scheme (eval_scheme (fun)));
return tmscm_to_object (call_scheme (eval_scheme (as_string (fun))));
}
object
call (const char* fun, object a1) {
Expand Down
1 change: 1 addition & 0 deletions moebius/drd/tag_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "hashmap.hpp"
#include "string.hpp"
#include "tree_helper.hpp"
#include "tree.hpp"

using namespace moebius;

Expand Down
2 changes: 1 addition & 1 deletion xmake/packages/l/lolly/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package("lolly")

add_urls("https://github.com/XmacsLabs/lolly.git")
add_urls("https://gitee.com/XmacsLabs/lolly.git")
add_versions("1.4.13", "v1.4.13")
add_versions("1.4.15", "v1.4.15")

add_deps("tbox")
if not is_plat("wasm") then
Expand Down

0 comments on commit 839f990

Please sign in to comment.