Sven M. Hallberg
73e92f04df
save kmax in HLLkTable
2015-09-06 14:48:41 +02:00
Sven M. Hallberg
8995097a1d
let's just use ((void *)-1) as another invalid pointer result
2015-09-05 22:43:49 +02:00
Sven M. Hallberg
90b6f30fa1
add a test that needs to suspend on lookahead in the middle of a chunk
2015-09-04 21:06:50 +02:00
Sven M. Hallberg
1276004250
handle suspend on lookahead at the very end of the chunk
2015-09-04 21:05:56 +02:00
Sven M. Hallberg
010a1a36ff
int_range test does not work for regex backend
2015-09-04 16:48:01 +02:00
Sven M. Hallberg
d4f933b2d3
move last_chunk flag into HInputStream
2015-09-04 12:55:37 +02:00
Sven M. Hallberg
28fa93d4cc
make overrun flag a bool to match its usage
2015-09-04 12:54:00 +02:00
Sven M. Hallberg
d3fd0da7b7
don't skip tests on compile failure anymore
2015-09-04 12:48:10 +02:00
Sven M. Hallberg
932c9717d7
oops, forgot about the lookahead
2015-09-04 12:34:34 +02:00
Sven M. Hallberg
10fde548ad
add a test for iterative parsing
2015-09-03 19:58:39 +02:00
Sven M. Hallberg
0231dc141e
add iterative API to LL(k) backend
2015-09-03 19:18:07 +02:00
Sven M. Hallberg
f1d6d0bc5e
split h_llk_parse into start/chunk/finish internally
2015-09-03 19:15:57 +02:00
Sven M. Hallberg
2845a9391e
add API and backend hooks for iterative (chunked) parsing
2015-09-03 15:03:01 +02:00
Sven M. Hallberg
c5f2c5aa2b
add a missing end-of-input check in the LL(k) backend
2015-08-25 14:14:48 +02:00
Nicolas Léveillé
9557448ae6
Introduce {v,}asprintf for windows
...
We have now again two functions called h_platform_vasprintf and
h_platform_asprintf. On windows they are implemented in terms of vsnprint
and the like. On BSD/GNU libraries we use the supplied vasprintf and
asprintf.
2015-08-16 16:46:52 +02:00
Nicolas Léveillé
124b4c381b
regex_debug.c: Stop including dlfcn.h
...
Since the block of code has been disabled anyway and is not very
portable, we introduce a define to control both the include
and the code.
2015-08-16 16:21:21 +02:00
Nicolas Léveillé
e74e23d672
Change system_allocator to store size of blocks only for debugging
...
Storing the size of the blocks is now only activated when DEBUG__MEMFILL
has been defined.
2015-08-16 09:15:20 +02:00
Nicolas Léveillé
d9ae097533
Remove void pointer arithmetics in system_allocator.c
...
We replace instances of void* w/ char* arithmetics.
This allows system_allocator.c to be compiled with MSVC.
Also we introduce a struct to represent the size_t header.
2015-08-16 09:10:04 +02:00
Nicolas Léveillé
01333964bd
Substitute spaces for tabs
2015-08-15 15:43:46 +02:00
Nicolas Léveillé
2346239887
Implement h_platform_stopwatch for Windows
...
We use QueryPerformanceCounter which will return realtime, not user
time.
2015-08-15 15:43:35 +02:00
Nicolas Léveillé
739f5d6d5c
Split platform specific time measurement away
...
We now have a `stopwatch` to measure time between two moments.
2015-08-15 15:43:22 +02:00
Nicolas Léveillé
0c35525e30
Convert usages of errx to h_platform_errx
...
This BSD call will have to be implemented on windows. Right now
we have a stub that just exits the process.
2015-08-09 22:46:45 +02:00
Nicolas Léveillé
c8726244ae
Wrap remaining __attribute__
...
We wrap all remaining references to __attribute__ into a macro call to
H_GCC_ATTRIBUTE, to allow compilation with MSVC CL.EXE
2015-08-09 22:46:00 +02:00
Nicolas Léveillé
6b9ba6033e
Allow windows users to include hammer.h
...
We substitute H_GCC_ATTRIBUTE to any occurence of __attribute__ and
disable its function with non gcc, non clang compilers.
We use a H_ macro so as to not pollute users' namespaces.
On windows build without c4201 so as to allow anonymous struct. This
shows hammer is not C99 compliant but rather C11.
2015-08-09 22:46:00 +02:00
Meredith L. Patterson
0fb9d77e40
remove error from HSVMContext, make svm_stack_ensure_cap return bool instead
2015-08-02 23:42:38 +02:00
Meredith L. Patterson
759fbe77e5
C++ bindings needed to use system_allocator's free() too
2015-08-02 22:03:30 +02:00
Meredith L. Patterson
6bffacefaf
fix memory leak introduced by putting setjmp in the wrong place
2015-08-02 21:46:57 +02:00
Meredith L. Patterson
1ffd8d9276
Fix undefined behaviour around system_allocator, issue #133 .
2015-08-02 21:32:47 +02:00
Meredith L. Patterson
0653a9e48a
add explicit null checks to system_allocator malloc/realloc
2015-08-02 14:34:45 +02:00
Nicolas Léveillé
2a6233b74f
Print user defined token type while pretty printing
...
The pretty printing format chosen is USER:<token name>
We use the registry function `h_get_token_type_name` which returns 0
when no name has been defined. This will print (null) as a token name.
2015-08-01 13:42:43 +02:00
Meredith L. Patterson
39c9096fd6
changes from tutorial: add h_literal, make h_make_bytes more practical
2015-05-04 19:00:37 -04:00
Meredith L. Patterson
26373bf25f
Merge pull request #129 from pesco/h_bind
...
Add monadic bind combinator h_bind
2015-03-10 21:27:24 +01:00
Meredith L. Patterson
af260bdd58
Merge pull request #122 from mrdomino/fix-res_unamb-leak
...
Free res_unamb
2015-03-10 18:06:01 +01:00
Sven M. Hallberg
aa2dc7bcf5
put the message into the assert in aa_realloc
2015-03-04 14:54:42 +01:00
Sven M. Hallberg
be80fdedfc
make arena-allocator implementation functions static
2015-03-04 14:52:28 +01:00
Sven M. Hallberg
9a8dca2c04
Merge branch 'master' of git://github.com/UpstandingHackers/hammer into h_bind
2015-03-04 14:47:49 +01:00
Sven M. Hallberg
1ce0ef9b8a
pass a temporary arena allocator to the continuation in h_bind
2015-02-23 14:10:29 +01:00
Sven M. Hallberg
2eaf5d9052
add some missing type conversions to make h_read_bits work with count>32
2015-02-12 01:40:45 +01:00
Sven M. Hallberg
7ba5931095
Merge branch 'master' of git://github.com/UpstandingHackers/hammer into h_bind
2015-01-30 20:48:49 +01:00
Sven M. Hallberg
12771a5655
oh, there's t_regression.c now, neat.
2015-01-30 20:42:11 +01:00
Sven M. Hallberg
3f197ea1b0
Merge branch 'master' of git://github.com/UpstandingHackers/hammer into fix-h_seq_index_path
2015-01-30 20:37:26 +01:00
Sven M. Hallberg
341123e2ea
descend properly in h_seq_index_path
2015-01-30 20:36:37 +01:00
Sven M. Hallberg
cbc7358b66
add a test that shows a bug in h_seq_index_path
2015-01-30 20:35:35 +01:00
Sven M. Hallberg
c9b2957832
add g_check_cmp_int
2015-01-30 20:35:14 +01:00
Sven M. Hallberg
78266af453
allow h_bind's function argument to return NULL as a shortcut for h_nothing_p()
2015-01-23 22:06:43 +01:00
Sven M. Hallberg
42d51ed479
add monadic bind combinator h_bind
2015-01-23 22:00:59 +01:00
Steven Dee
a0104776ed
Free res_unamb
2015-01-04 21:38:04 -05:00
Meredith L. Patterson
5efaba87e8
Merge pull request #120 from thequux/fix-bug118
...
Fix #118
2015-01-04 04:18:11 +01:00
TQ Hirsch
af73181cf4
Fix #118
...
NEWS:
* Switching endianness mid-byte no longer potentially re-reads bytes.
* bit_offset now consistently refers to the number of bits already
read.
* HParsedTokens now have a bit_length field; this is a size_t. This
may be removed for memory reasons.
The bit writer has not yet been updated to match; the result of
switching bit writer endianness in the middle of a byte remains
undefined.
2015-01-04 04:08:01 +01:00
Steven Dee
2dad0c48b4
H_VALIDATE_APPLY macro
...
I've found this especially useful in combination with my own
_attr_uint_const for things like flags and type specifiers.
It's possible that its usefulness might be diminished significantly if
there were a built-in bitfield constant parser -- that certainly would
eliminate all of my current uses of it -- but it still seems nicely
symmetric with H_ACT_APPLY.
2015-01-03 16:44:36 -05:00