mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-05 22:38:44 +00:00
Fixed bugs in runtime; added stringInt
This commit is contained in:
parent
e0ad5aa89a
commit
2c85715ae0
4 changed files with 11 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
V,sysargs;
|
||||
F,stringInt;
|
||||
F,makeArray;
|
||||
F,clone;
|
||||
F,hash;
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ is added implicitly by the compiler and can not be specified by an end user.
|
|||
|
||||
The following declarations are accessible:
|
||||
|
||||
\descr{\lstinline|fun stringInt (s)|}{Converts a string representation of a signed decimal number into integer.}
|
||||
|
||||
\descr{\lstinline|fun read ()|}{Reads an integer value from the standard input, printing a prompt "\lstinline|>|".}
|
||||
|
||||
\descr{\lstinline|fun write (int)|}{Writes an integer value to the standard output.}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
let version = "Version 1.00, 7ebbf65b, Thu Feb 20 20:25:29 2020 +0300"
|
||||
let version = "Version 1.00, e0ad5aa8, Thu Feb 20 20:29:57 2020 +0300"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue