Debian Codegraph @

theories/Ltac2/String.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
13 Ltac2 Type t := string.
14
15 Ltac2 @external make : int -> char -> string := "rocq-runtime.plugins.ltac2" "string_make".
16 Ltac2 @external length : string -> int := "rocq-runtime.plugins.ltac2" "string_length".
17 Ltac2 @external get : string -> int -> char := "rocq-runtime.plugins.ltac2" "string_get".
18 Ltac2 @external set : string -> int -> char -> unit := "rocq-runtime.plugins.ltac2" "string_set".
19 Ltac2 @external concat : string -> string list -> string := "rocq-runtime.plugins.ltac2" "string_concat".
20 Ltac2 @external app : string -> string -> string := "rocq-runtime.plugins.ltac2" "string_app".
21 Ltac2 @external sub : string -> int -> int -> string := "rocq-runtime.plugins.ltac2" "string_sub".
22 Ltac2 @external equal : string -> string -> bool := "rocq-runtime.plugins.ltac2" "string_equal".
23 Ltac2 @external compare : string -> string -> int := "rocq-runtime.plugins.ltac2" "string_compare".
24
25 Ltac2 is_empty s := match s with "" => true | _ => false end.