Source

mutated_ocaml / camlp4 / test / fixtures / macrotest.ml

DEFINE A = 42;
DEFINE B = 51;

IFDEF A THEN
  value a_should_be_present = B + 2;
  print_int (a_should_be_present + 1);
ENDIF;

print_int (a_should_be_present + 2);

IFNDEF C THEN
  print_int (a_should_be_present + 3);
ENDIF;

IFNDEF C THEN
  print_int (a_should_be_present + 4);
ELSE
  print_int (c_should_not_be_present + 1);
ENDIF;

IFDEF C THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

IFDEF DNE THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

IFDEF OPT THEN
  print_int (c_should_not_be_present + 2);
ELSIF
  print_int (A * a_should_be_present + 5);
ENDIF;

value e =
  IFDEF DNE THEN
    print_int (c_should_not_be_present + 2)
  ELSE
    print_int (A * a_should_be_present + 5)
  ENDIF;

value f =
  fun _ ->
    IFDEF DNE THEN
      print_int (c_should_not_be_present + 2)
    ELSE
      print_int (A * a_should_be_present + 5)
    ENDIF;

IFDEF A THEN
  DEFINE Z = "ok";
ELSE
  DEFINE Z = "ko";
ENDIF;

Z;

IFDEF DNE THEN
  DEFINE Z = "ko2";
ELSE
  DEFINE Z = "ok2";
ENDIF;

Z;

pouet;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.