wtetzner / bitstring

Automatically exported from code.google.com/p/bitstring
GNU General Public License v2.0
0 stars 0 forks source link

Preprocessor error for bitmatch after semicolon #13

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. make

What is the expected output? What do you see instead?

expected compile without errors; got the following output:

make
ocamlfind ocamlc test1.ml -package bitstring.syntax -syntax bitstring
File "test1.ml", line 8, characters 11-12:
Error: Unbound value v
make: [all] Error 2 (ignored)
ocamlfind ocamlc test2.ml -package bitstring.syntax -syntax bitstring
File "test2.ml", line 10, characters 6-14:
Parse error: "end" expected after [class_structure] (in [class_expr])
File "test2.ml", line 1, characters 0-1:
Error: Preprocessor error

What version of the product are you using? On what operating system?
bitstring 2.0.2, ocaml 3.11.2, gentoo linux 32 bit

Please provide any additional information below.

It looks like for some reason bitmatch expression does not like simicolon 
before it. I attached two samples - one for with regular function, other with 
class.

Original issue reported on code.google.com by vsevolod.fedorov@gmail.com on 15 Sep 2010 at 9:13

Attachments:

GoogleCodeExporter commented 8 years ago
Put parentheses around the bitmatch statement:

let test v =
  f ();
  (bitmatch v with
   | {_} -> ())

I believe this is mentioned in the documentation.

Original comment by richard....@gmail.com on 22 Sep 2010 at 11:06