Skip to content

Commit

Permalink
serapi: Add a "noexec" driver
Browse files Browse the repository at this point in the history
Closes GH-52.

Suggested-by: @gmalecha
  • Loading branch information
cpitclaudel committed Sep 3, 2021
1 parent f0ab88e commit 6f4ae20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions alectryon/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ def reset(self):
DRIVERS_BY_LANGUAGE = {
"coq": {
"sertop": (".serapi", "SerAPI"),
"sertop_noexec": (".serapi", "SerAPI_noexec"),
"coqc_time": (".coqc_time", "CoqcTime"),
}
}
Expand Down
13 changes: 13 additions & 0 deletions alectryon/serapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,19 @@ def annotate(self, chunks):
with self as api:
return [api.run(chunk) for chunk in chunks]

class SerAPI_noexec(SerAPI):
"""A variant of SerAPI that segments the code without executing it.
This runs faster, but the results don't include goals and messages."""

NAME = "Coq+SerAPI-noexec"
ID = "sertop_noexec"

def _exec(self, sid, chunk):
return []
def _goals(self, sid, chunk):
return []

def annotate(chunks, sertop_args=(), fpath="-", binpath=None):
r"""Annotate multiple `chunks` of Coq code.
Expand Down

0 comments on commit 6f4ae20

Please sign in to comment.