Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

driver_lexer.mll 2.85 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
(**************************************************************************)
(*                                                                        *)
(*  Copyright (C) 2010-                                                   *)
(*    Francois Bobot                                                      *)
(*    Jean-Christophe Filliatre                                           *)
(*    Johannes Kanig                                                      *)
(*    Andrei Paskevich                                                    *)
(*                                                                        *)
(*  This software is free software; you can redistribute it and/or        *)
(*  modify it under the terms of the GNU Library General Public           *)
(*  License version 2.1, with the special exception on linking            *)
(*  described in file LICENSE.                                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *)
(*                                                                        *)
(**************************************************************************)

{
Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
21
  open Format
22 23
  open Lexing
  open Driver_parser
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
24
  open Lexer
Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
25 26 27 28 29 30 31 32 33 34

  let keywords = Hashtbl.create 97
  let () = 
    List.iter 
      (fun (x,y) -> Hashtbl.add keywords x y)
      [ "theory", THEORY;
	"end", END;
	"syntax", SYNTAX;
	"remove", REMOVE;
	"tag", TAG;
35
	"cloned", CLONED;
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
36 37 38 39 40 41 42 43
	"prelude", PRELUDE;
	"printer", PRINTER;
	"call_on_file", CALL_ON_FILE;
	"call_on_stdin", CALL_ON_STDIN;
	"valid", VALID;
	"invalid", INVALID;
	"unknown", UNKNOWN;
	"fail", FAIL;
44 45 46
        "logic", LOGIC;
        "type", TYPE;
        "prop", PROP;
47
        "filename", FILENAME;
48
        "transformations", TRANSFORMS;
49
        "plugin", PLUGIN
Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
50 51
      ]

52 53
}

Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
54 55 56 57 58
let space = [' ' '\t' '\r']
let alpha = ['a'-'z' 'A'-'Z' '_']
let digit = ['0'-'9']
let ident = alpha (alpha | digit | '\'')*

59
rule token = parse
Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
  | '\n'
      { newline lexbuf; token lexbuf }
  | space+  
      { token lexbuf }
  | "(*"
      { comment lexbuf; token lexbuf }
  | '_' 
      { UNDERSCORE }
  | ident as id
      { try Hashtbl.find keywords id with Not_found -> IDENT id }
  | "<>" | "<" | "<=" | ">" | ">=" 
  | "="
  | "+" | "-"
  | "*" | "/" | "%" as op
      { OPERATOR op }
  | "("
      { LEFTPAR }
  | ")"
      { RIGHTPAR }
  | "."
      { DOT }
  | "\""
Jean-Christophe Filliâtre's avatar
Jean-Christophe Filliâtre committed
82
      { STRING (string lexbuf) }
Jean-Christophe Filliâtre's avatar
drivers  
Jean-Christophe Filliâtre committed
83 84 85 86 87 88 89 90 91 92 93 94 95
  | eof 
      { EOF }
  | _ as c
      { raise (Error (IllegalCharacter c)) }

{
  let loc lb = (lexeme_start_p lb, lexeme_end_p lb)

  let with_location f lb =
    try f lb with e -> raise (Loc.Located (loc lb, e))

  let parse_file = with_location (Driver_parser.file token)
}