summaryrefslogtreecommitdiff
path: root/ocamltest/tsl_ast.ml
blob: a3082828651d089ca2576e39fd4a3f719805cf1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*             Sebastien Hinderer, projet Gallium, INRIA Paris            *)
(*                                                                        *)
(*   Copyright 2016 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(* Abstract Syntax Tree for the Tests Specification Language *)

type 'a located = {
  node : 'a;
  loc : Location.t
}

type environment_statement =
  | Assignment of bool * string located * string located (* variable = value *)
  | Append of string located * string located
  | Include of string located (* include named environment *)
  | Unset of string located (* clear environment variable *)

type tsl_item =
  | Environment_statement of environment_statement located
  | Test of
    int (* test depth *) *
    string located (* test name *) *
    string located list (* environment modifiers *)

type tsl_block = tsl_item list

type t = Ast of tsl_item list * t list

let make ?(loc = Location.none) foo = { node = foo; loc = loc }

let make_identifier = make
let make_string = make
let make_environment_statement = make