mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 06:48:48 +00:00
Bugfix in runtime and documentation
This commit is contained in:
parent
c084e57b27
commit
e4b34a3ec1
5 changed files with 18 additions and 13 deletions
BIN
lama-spec.pdf
BIN
lama-spec.pdf
Binary file not shown.
|
|
@ -555,13 +555,15 @@ extern void* Lsubstring (void *subj, int p, int l) {
|
||||||
}
|
}
|
||||||
|
|
||||||
extern struct re_pattern_buffer *Lregexp (char *regexp) {
|
extern struct re_pattern_buffer *Lregexp (char *regexp) {
|
||||||
struct re_pattern_buffer *b =
|
regex_t *b = (regex_t*) malloc (sizeof (regex_t));
|
||||||
(struct re_pattern_buffer*) malloc (sizeof (struct re_pattern_buffer));
|
|
||||||
|
|
||||||
b->translate = 0;
|
b->translate = 0;
|
||||||
b->fastmap = 0;
|
b->fastmap = 0;
|
||||||
b->buffer = 0;
|
// A weird workaround: should be 0/0 in theory,
|
||||||
b->allocated = 0;
|
// but is does not work sometimes. The exact number is
|
||||||
|
// determined experimentally :((
|
||||||
|
b->buffer = malloc (256);
|
||||||
|
b->allocated = 256;
|
||||||
|
|
||||||
int n = (int) re_compile_pattern (regexp, strlen (regexp), b);
|
int n = (int) re_compile_pattern (regexp, strlen (regexp), b);
|
||||||
|
|
||||||
|
|
@ -1426,7 +1428,7 @@ extern void __gc_root_scan_stack ();
|
||||||
/* ======================================== */
|
/* ======================================== */
|
||||||
|
|
||||||
//static size_t SPACE_SIZE = 16;
|
//static size_t SPACE_SIZE = 16;
|
||||||
static size_t SPACE_SIZE = 16 * 1024 * 1024;
|
static size_t SPACE_SIZE = 32 * 1024 * 1024;
|
||||||
// static size_t SPACE_SIZE = 128;
|
// static size_t SPACE_SIZE = 128;
|
||||||
// static size_t SPACE_SIZE = 1024 * 1024;
|
// static size_t SPACE_SIZE = 1024 * 1024;
|
||||||
|
|
||||||
|
|
@ -1922,6 +1924,7 @@ extern void * alloc (size_t size) {
|
||||||
#endif
|
#endif
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_to_space (0);
|
init_to_space (0);
|
||||||
#ifdef DEBUG_PRINT
|
#ifdef DEBUG_PRINT
|
||||||
print_indent ();
|
print_indent ();
|
||||||
|
|
|
||||||
|
|
@ -104,10 +104,10 @@ The following symbols are treated as delimiters:
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
. , ( ) { }
|
. , ( ) { }
|
||||||
; # ->
|
; # -> |
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
Despite custom infix operators can coincide with delimiters "\lstinline|#|" and "\lstinline|->|" they can
|
Note, custom infix operators can coincide with delimiters "\lstinline|#|", "\lstinline!|!", and "\lstinline|->|", which can
|
||||||
never clash as neither of these delimiters can be encountered in expressions in infix operator position.
|
sometimes be misleading.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
let version = "Version 1.00, 5db12d76, Fri Mar 13 19:41:14 2020 +0300"
|
let version = "Version 1.00, c084e57b2, Sun Mar 15 12:41:31 2020 +0300"
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@
|
||||||
-- (e.g. "identifier", "string constant", etc.), used for error
|
-- (e.g. "identifier", "string constant", etc.), used for error
|
||||||
-- reporting
|
-- reporting
|
||||||
public fun createRegexp (r, name) {
|
public fun createRegexp (r, name) {
|
||||||
[regexp (r), name]
|
local l = [regexp (r), name];
|
||||||
|
--printf ("Created regexp %s: %x, %x\n", name, l, l[0]);
|
||||||
|
l
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Create an immutable matcher.
|
-- Create an immutable matcher.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue