X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=TODO;h=900ae212482a35d8eb90088f3861d417f347cbf7;hb=64bcd448dc8787b82828a49edb709436ec2de93d;hp=74551a6175ed80d54505f0f849e0a42971861419;hpb=161ecfb3d3c9aa5c934a956cec1bf206029a9c41;p=ocaml-bitstring.git diff --git a/TODO b/TODO index 74551a6..900ae21 100644 --- a/TODO +++ b/TODO @@ -9,7 +9,7 @@ Major to-do items. (4) Provide UInt32 and UInt64 types. -(5) Allow for specific offsets and alignment. Something like this: +(5) DONE - Allow for specific offsets and alignment. Something like this: { start : 16; another : 16 : offset(256); (* location would be 256 bits from start *) @@ -33,7 +33,7 @@ Major to-do items. Make the error locations fine-grained, particularly so they point to individual fields, not the whole match. -(10) Cross-module, persistent, named patterns, see: +(10) DONE - Cross-module, persistent, named patterns, see: http://caml.inria.fr/pub/ml-archives/caml-list/2008/04/25992c9c9fa999fe1d35d961dd9917a2.en.html (11) DONE - @@ -49,11 +49,52 @@ Major to-do items. (12) DONE - More constant field lengths. -(13) Implement native endian functions. +(13) PARTLY DONE - Implement native endian functions. -(14) A proper test suite. +(14) PARTLY DONE - A proper test suite. -(15) More examples: +(15) DONE - More examples: ELF binaries GIF images + +(16) We now know the offset of the current field relative to the + whole match. This may allow more efficient aligned versions + of functions to be called (at compile time). However do note + that the offset in the bitstring is usually not known. + +(17) PARTLY DONE - Fix the META file. Current one is very broken. + +(18) DONE - check() qualifier: + + { field : 16 : check (field > 100) } + + The check(expr) qualifier will abort the rest of the match if the + expression is false. + +(19) DONE - bind() qualifier: + + { field : 16 : bind (field * 3) } + ^pattern ^new value + + The bind(expr) qualifier binds the pattern to a new value, + equivalent to doing: + + let field = field * 3 in + (* remainder of match *) + + There is a question of whether bind() should run before or + after when() [best is probably when() first, then bind()]. + +(20) DONE - save_offset_to() qualifier: + + { field : 16 : save_offset_to (offset), bind (field - offset) } + + or: + + { field : 16 : save_offset_to (field_offset) } -> + printf "the offset of field (%d) is %d\n" field field_offset + + save_offset_to(patt) binds the current match offset to + the variable, for later use within bind(), when() or + any later parts of the match.