Skip to content

Some fixes#137

Open
mtzguido wants to merge 4 commits into
FStarLang:masterfrom
mtzguido:fixes
Open

Some fixes#137
mtzguido wants to merge 4 commits into
FStarLang:masterfrom
mtzguido:fixes

Conversation

@mtzguido
Copy link
Copy Markdown
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

mtzguido added 4 commits June 26, 2023 08:20
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!
Comment thread fstar-mode.el
"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
Copy Markdown
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
Copy Markdown
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

Comment thread fstar-mode.el
"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
Copy Markdown
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

Comment thread fstar-mode.el
(,(concat "\\_<\\(val\\) +\\(" id "\\) *:")
(1 'fstar-structure-face)
(2 'font-lock-function-name-face))
(, "%splice"
Copy link
Copy Markdown
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

Comment thread fstar-mode.el

(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
Copy Markdown
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?

Comment thread fstar-mode.el
("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
Copy Markdown
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

Comment thread fstar-mode.el
(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
Copy Markdown
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