Debian Codegraph @

theories/Ltac2/Char.v

raw
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 Require Import Ltac2.Init.
12 Require Ltac2.Int.
13
14 Ltac2 @external of_int : int -> char := "rocq-runtime.plugins.ltac2" "char_of_int".
15 (** Throws if the integer is not a valid char (in range [0-255]). *)
16
17 Ltac2 @external to_int : char -> int := "rocq-runtime.plugins.ltac2" "char_to_int".
18
19 Ltac2 equal (x : char) (y : char) : bool := Int.equal (to_int x) (to_int y).
20 Ltac2 compare (x : char) (y : char) : int := Int.compare (to_int x) (to_int y).