Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes #137

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Some fixes #137

wants to merge 4 commits into from

Conversation

mtzguido
Copy link
Member

Some misc fixes, the last one is the only "serious" one I'd say. Also,
I added a C-c C-g to start checking the whole file (in normal mode, not
lax), I think there isn't something like this already?

As usual my emacs-foo is weak, so take everything with a grain of salt :-)

  • Introduce: C-c C-g to typecheck whole buffer
  • Fix regex for finding subtype annotations
  • Mark %splice as a syntax header and highlight it
  • Fix fstar-debug-invocation

Similar to C-c C-b, but without setting lax.
This also matched with the notation for typeclass arguments
(`{| eq a |}`), which is not intended. Though I think this
only happens when there is no space before it, e.g.

    (a:Type){|deq a|}
It wasn't actually taking the executable into account!
@@ -867,7 +867,7 @@ allows composition in code comments."
'("open" "module" "include" "friend"
"let" "let rec" "val" "and" "assume"
"exception" "effect" "new_effect" "sub_effect" "new_effect_for_free" "layered_effect"
"kind" "type" "class" "instance"))
"kind" "type" "class" "instance" "%splice"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add this here if you also add it below?

Copy link
Contributor

@cpitclaudel cpitclaudel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, except the C-g binding

@@ -1123,7 +1123,7 @@ leads to the binder's start."
(defun fstar-find-subtype-annotation (bound)
"Find {...} group between point and BOUND."
(let ((found) (end))
(while (and (not found) (re-search-forward "{[^:].*}" bound t))
(while (and (not found) (re-search-forward "{[^:|].*}" bound t))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know enough about the syntax to comment on this

@@ -1167,6 +1167,8 @@ leads to the binder's start."
(,(concat "\\_<\\(val\\) +\\(" id "\\) *:")
(1 'fstar-structure-face)
(2 'font-lock-function-name-face))
(, "%splice"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for , here

@@ -3495,6 +3497,14 @@ into blocks; process it as one large block instead."
(let ((fstar-subp--lax t))
(fstar-subp-advance-or-retract-to-point arg)))

(defun fstar-subp-advance-to-point-max (&optional arg)
"Like `fstar-subp-advance-or-retract-to-point' on `point-max'.
Pass ARG to `fstar-subp-advance-or-retract-to-point'."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you refactor the function below to use this new one?

@@ -5323,6 +5334,7 @@ This is useful to spot discrepancies between the CLI and IDE frontends."
("C-c C-l" "C-S-l" fstar-subp-advance-or-retract-to-point-lax)
("C-c C-." "C-S-." fstar-subp-goto-beginning-of-unprocessed-region)
("C-c C-b" "C-S-b" fstar-subp-advance-to-point-max-lax)
("C-c C-g" "C-S-g" fstar-subp-advance-to-point-max)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A keybinding ending in C-g is going to be very very confusing, because C-g is the universal "cancel" action

@@ -5488,6 +5502,7 @@ its `find-image' forms."
(define-key-after map [basic-actions-sep] '(menu-item "--"))
(add-item 'fstar-subp-advance-next "next")
(add-item 'fstar-subp-advance-next-lax "next-lax")
(add-item 'fstar-subp-advance-to-point-max "goto-end")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a corresponding picture in the repo already?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants