Fixed bugs in runtime; added stringInt

This commit is contained in:
Dmitry Boulytchev 2020-02-23 01:36:30 +03:00
parent e0ad5aa89a
commit 2c85715ae0
4 changed files with 11 additions and 2 deletions

View file

@ -696,6 +696,12 @@ int inner_hash (int depth, unsigned acc, void *p) {
}
}
extern void* LstringInt (char *b) {
int n;
sscanf (b, "%d", &n);
return BOX(n);
}
extern int Lhash (void *p) {
return BOX(inner_hash (0, 0, p));
}
@ -1115,7 +1121,7 @@ extern void Bmatch_failure (void *v, char *fname, int line, int col) {
createStringBuf ();
printValue (v);
failure ("match failure at %s:%d:%d, value '%s'\n",
fname, line, col, stringBuf.contents);
fname, UNBOX(line), UNBOX(col), stringBuf.contents);
}
extern void* /*Lstrcat*/ Li__Infix_4343 (void *a, void *b) {