Skip to content

Commit 62906f9

Browse files
committed
Minor correction
There was some minor issues with prettify. The escape character "\" wasn't properly evaluated. We also modify the name evall_js_sync as evall_js_async, which is more consistent with what it does. This function handles asynchronous javascript calls.
1 parent c77c6c4 commit 62906f9

7 files changed

Lines changed: 40 additions & 10 deletions

File tree

binaries/wasm/lispe.wasm

274 Bytes
Binary file not shown.

docs/lispe.wasm

274 Bytes
Binary file not shown.

include/listes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1440,7 +1440,7 @@ class List : public Element {
14401440
Element* evall_input(LispE* lisp);
14411441
#ifdef LISPE_WASM
14421442
Element* evall_js(LispE* lisp);
1443-
Element* evall_js_sync(LispE* lisp);
1443+
Element* evall_js_async(LispE* lisp);
14441444
#endif
14451445
Element* evall_lambda(LispE* lisp);
14461446
Element* evall_last(LispE* lisp);

src/eval.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ Element* List::evall_js(LispE* lisp) {
505505
return lisp->provideString(code);
506506
}
507507

508-
Element* List::evall_js_sync(LispE* lisp) {
508+
Element* List::evall_js_async(LispE* lisp) {
509509
static int i = 0;
510510
Element* element = liste[1]->eval(lisp);
511511
string code;

src/lispe.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void decrement_total() {
3131
total_objects--;
3232
}
3333

34-
static std::string version = "1.2026.8.18.10.46";
34+
static std::string version = "1.2026.8.20.11.3";
3535
string LispVersion() {
3636
return version;
3737
}
@@ -517,7 +517,7 @@ void Delegation::initialisation(LispE* lisp) {
517517
set_instruction(l_infix, "infix", P_TWO, &List::evall_infix, new List_infix_eval());
518518
#ifdef LISPE_WASM
519519
set_instruction(l_evaljs, "evaljs", P_TWO, &List::evall_js);
520-
set_instruction(l_evaljssync, "asyncjs", P_ATLEASTTWO, &List::evall_js_sync);
520+
set_instruction(l_evaljssync, "asyncjs", P_ATLEASTTWO, &List::evall_js_async);
521521
#else
522522
set_instruction(l_getchar, "getchar", P_ONE, &List::evall_getchar);
523523
set_instruction(l_input, "input@", P_ONE | P_TWO, &List::evall_input);
@@ -3853,3 +3853,4 @@ Element* List::evall_memory(LispE* lisp) {
38533853

38543854

38553855

3856+

src/tools.cxx

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,11 @@ Exporting string doublequoted(string value) {
14171417
c = value[i];
14181418
if (c == '\\') {
14191419
output += c;
1420-
output += value[++i];
1420+
c = value[++i];
1421+
if (c)
1422+
output += c;
1423+
else
1424+
output += '\\';
14211425
continue;
14221426
}
14231427
if (c == '"')
@@ -1440,7 +1444,11 @@ Exporting wstring wdoublequoted(wstring value) {
14401444
c = value[i];
14411445
if (c == '\\') {
14421446
output += c;
1443-
output += value[++i];
1447+
c = value[++i];
1448+
if (c)
1449+
output += c;
1450+
else
1451+
output += '\\';
14441452
continue;
14451453
}
14461454
if (c == '"')
@@ -1467,7 +1475,11 @@ Exporting u_ustring udoublequoted(u_ustring value) {
14671475
c = value[i];
14681476
if (c == '\\') {
14691477
output += c;
1470-
output += value[++i];
1478+
c = value[++i];
1479+
if (c)
1480+
output += c;
1481+
else
1482+
output += '\\';
14711483
continue;
14721484
}
14731485
if (c == '"')
@@ -4562,7 +4574,12 @@ long IndentationCode(string& codestr) {
45624574
p = i;
45634575
while (r < sz) {
45644576
p = pos[r++];
4565-
if ((codestr[p-1] != '\\' && codestr[p] == '"') || codestr[p] == '\n')
4577+
if (codestr[p] == '\\') {
4578+
r++;
4579+
continue;
4580+
}
4581+
4582+
if (codestr[p] == '"' || codestr[p] == '\n')
45664583
break;
45674584
}
45684585
p++;
@@ -4828,7 +4845,13 @@ void IndentationCode(string& str, string& codeindente) {
48284845
p = i;
48294846
while (r < sz) {
48304847
p = pos[r++];
4831-
if ((codestr[p-1] != '\\' && codestr[p] == '"') || codestr[p] == '\n')
4848+
c = codestr[p];
4849+
if (c == '\\') {
4850+
r++;
4851+
continue;
4852+
}
4853+
4854+
if (c == '"' || c == '\n')
48324855
break;
48334856
}
48344857
p++;
@@ -5188,7 +5211,13 @@ void IndentatingCode(string& str, string& codeindente) {
51885211
p = i;
51895212
while (r < sz) {
51905213
p = pos[r++];
5191-
if ((codestr[p-1] != '\\' && codestr[p] == '"') || codestr[p] == '\n')
5214+
c = codestr[p];
5215+
if (c == '\\') {
5216+
r++;
5217+
continue;
5218+
}
5219+
5220+
if (c == '"' || c == '\n')
51925221
break;
51935222
}
51945223
p++;

wasm/lispe.wasm

274 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)