Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SkySkimmer committed Jun 7, 2023
1 parent de15b88 commit 3b76319
Show file tree
Hide file tree
Showing 13 changed files with 1,665 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/docker-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker CI

on:
push:
branches:
- master
pull_request:
branches:
- '**'

jobs:
build:
# the OS must be GNU/Linux to be able to use the docker-coq-action
runs-on: ubuntu-latest
strategy:
matrix:
image:
- 'coqorg/coq:dev'
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: coq-community/docker-coq-action@v1
with:
opam_file: 'coq-ltac2-compiler.opam'
custom_image: ${{ matrix.image }}

# See also:
# https://github.com/coq-community/docker-coq-action#readme
# https://github.com/erikmd/docker-coq-github-action-demo
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Makefile.coq*

/src/g_tac2compile.ml

*.a
*.aux
*.cm*
*.d
*.glob
*.o
*.vo*
.merlin
META*
458 changes: 458 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MAKE_OPTS:= --no-builtin-rules

TEST_GOALS:=$(filter test%, $(MAKECMDGOALS))

.PHONY: submake
submake: Makefile.coq
$(MAKE) $(MAKE_OPTS) -f Makefile.coq $(filter-out test%, $(MAKECMDGOALS))
+$(if $(TEST_GOALS),$(MAKE) $(MAKE_OPTS) -C tests $(patsubst tests/%,%,$(filter-out test, $(TEST_GOALS))))

Makefile.coq: _CoqProject
$(COQBIN)coq_makefile -f $< -o $@

%:: submake ;

# known sources

Makefile: ;

_CoqProject: ;
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A compiler for Ltac2
9 changes: 9 additions & 0 deletions _CoqProject
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-generate-meta-for-package coq-ltac2-compiler
-Q src Ltac2Compiler
-I src

src/Ltac2Compiler.v
src/g_tac2compile.mlg
src/tac2compile.ml
src/tac2compile.mli
src/ltac2_compiler.mlpack
23 changes: 23 additions & 0 deletions coq-ltac2-compiler.opam
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
opam-version: "2.0"
maintainer: "gaetan.gilbert@skyskimmer.net"
version: "dev"

homepage: "https://github.com/SkySkimmer/coq-ltac2-compiler"
dev-repo: "git+https://github.com/SkySkimmer/coq-ltac2-compiler.git"
bug-reports: "https://github.com/SkySkimmer/coq-ltac2-compiler/issues"
license: "LGPL-2.1-only"

synopsis: "Plugin to compile Ltac2 tactics using OCaml"
description: """
Plugin to compile Ltac2 tactics using OCaml."""

build: [make "-j%{jobs}%" "test"]
install: [make "install"]
depends: [
"ocaml" {>= "4.09.0"}
"coq" {= "dev"}
]

authors: [
"Gaëtan Gilbert"
]
1 change: 1 addition & 0 deletions src/Ltac2Compiler.v
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Declare ML Module "coq-ltac2-compiler.plugin".
8 changes: 8 additions & 0 deletions src/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
(library
(name ltac2_compiler)
(public_name coq.ltac2-compiler)
(synopsis "Ltac2 compiler using OCaml")
(libraries coq-core.plugins.ltac2)
(flags :standard -w -40))

(coq.pp (modules g_tac2compile))
25 changes: 25 additions & 0 deletions src/g_tac2compile.mlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
(* v * Copyright INRIA, CNRS and contributors *)
(* <O___,, * (see version control and CREDITS file for authors & dates) *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(* * (see LICENSE file for the text of the license) *)
(************************************************************************)

DECLARE PLUGIN "coq-ltac2-compiler.plugin"

{

open Util
open Names
open Pcoq

let recursive_att = Attributes.bool_attribute ~name:"recursive"
}

VERNAC COMMAND EXTEND Ltac2Compile CLASSIFIED AS SIDEFF
| #[ recursive = recursive_att ] [ "Ltac2" "Compile" reference_list(n) ] ->
{ Tac2entries.perform_compile ?recursive n }
END
2 changes: 2 additions & 0 deletions src/ltac2_compiler.mlpack
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Tac2compile
G_tac2compile
Loading

0 comments on commit 3b76319

Please sign in to comment.