Version française
Home     About     Download     Resources     Contact us    
Browse thread
pa_macro + ulex
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Anastasia Gornostaeva <ermine@e...>
Subject: pa_macro + ulex
Hello.

Is it possible to combine pa_macro and pa_ulex?

=== ex.ml ===

IFDEF VALUE1 THEN
let regexp something1 = [^"1"]
   ELSE
let regexp something2 = [^"2"]
let regexp something3 = "abc"
ENDIF

let rec somewhat = lexer
   | IFDEF VALUE1 THEN 
     something1+
    ELSE
     something2+ | something3
    ENDIF -> ()

   | _ -> failwith "Unknown one"


bash-2.05b$ ocamlfind ocamlc -syntax camlp4o -ppopt pa_macro.cmo -package ulex -c ex.ml 
File "ex.ml", line 11, characters 4-8:
Parse error: [expr] expected after '+' (in [expr])
Uncaught exception: Stream.Error("[expr] expected after '+' (in [expr])")
Preprocessor error

ermine