aboutsummaryrefslogtreecommitdiffhomepage
path: root/coq/coq-smie.el
Commit message (Collapse)AuthorAge
* Make coq-mode work without generic/proof-*Gravatar Stefan Monnier2018-12-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revise the various `require`s to avoid spurious dependencies, and tweak the code here and there to eliminate the remaining dependencies. * coq/coq-db.el: Don't require proof-config nor proof-syntax. (coq-build-opt-regexp-from-db): Avoid proof-regexp-alt-list. * coq/coq-indent.el: Use lexical-binding. Don't require coq-syntax. Comment out all the code that's not used any more. (coq-empty-command-p): Use forward-comment instead of coq-find-not-in-comment-backward. Fix paren typos. (coq-script-parse-cmdend-forward, coq-script-parse-cmdend-backward): Use forward-comment i.s.o proof-script-generic-parse-find-comment-end. Use syntax-ppss i.s.o proof-buffer-syntactic-context. (coq-find-current-start): Explicit case-fold-search i.s.o proof-looking-at. * coq/coq-mode.el (coq-mode): Set comment-start/end. * coq/coq-smie.el: Require coq-syntax explicitly. (coq-smie-detect-goal-command, coq-smie-module-deambiguate): Explicit case-fold-search i.s.o proof-looking-at. (coq-indent-basic): New custom var. (coq-smie-rules): Use it in case PG is not loaded. * coq/coq-syntax.el: Don't require proof-syntax, proof-utils, and span. (coq-goal-command-p): Use overlay-get i.s.o span-property. (coq-save-command-regexp-strict, coq-save-command-regexp): Use \` and regexp-opt i.s.o proof-anchor-regexp and proof-ids-to-regexp. (coq-save-command-p): Explicit case-fold-search i.s.o proof-string-match. (coq--regexp-alt-list-symb): Rename from proof-regexp-alt-list-symb. Use mapconcat i.s.o proof-regexp-alt-list. (coq-save-with-hole-regexp): Use regexp-opt i.s.o proof-regexp-alt-list. (coq-goal-command-regexp, coq-goal-with-hole-regexp) (coq-decl-with-hole-regexp, coq-defn-with-hole-regexp) (coq-font-lock-keywords-1): Use mapconcat i.s.o proof-regexp-alt-list. (coq-find-first-hyp, coq-detect-hyps-positions-in-goals): Use current buffer i.s.o proof-goals-buffer. (coq-with-altered-syntax-table): Fix broken use of unwind-protect. * coq/coq.el (coq-detect-hyps-in-goals): Change buffer before calling coq-find-first-hyp and coq-detect-hyps-positions-in-goals. (coq-pg-setup): Use comment-start/end. * generic/pg-goals.el: Require proof-script explicitly instead of autoloading via proof-insert-sendback-command. * generic/pg-pbrpm.el: Require proof-script explicitly instead of autoloading via proof-insert-pbp-command. * generic/pg-pgip.el: Require proof-script explicitly. * generic/proof-depends.el: Require proof-script explicitly instead of autoloading via pg-set-span-helphighlights. * generic/proof-script.el (pg-set-span-helphighlights) (proof-insert-pbp-command, proof-insert-sendback-command) (proof-script-generic-parse-find-comment-end): Don't autoload. * generic/proof-syntax.el (proof-ids-to-regexp): Simplify. * lib/span.el (span-delete): η-reduce.
* Cosmetic cleanup of coq-smie, coq-syntax, and coq-abbrev.Gravatar Stefan Monnier2018-12-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a few more cl.el leftovers. Get rid of remaining use of iso-2022. Use SMIE unconditionally. * coq/coq-abbrev.el: Use lexical-binding. (coq-install-abbrevs): Delete, only keep the relevant contents. (proof-defstringset-fn): Remove. Fold changes into the main version. * coq/coq-indent.el (coq-find-real-start): Use forward-comment. * coq/coq-smie.el: Use lexical-binding. Assume `smie` is available. (coq--string-suffix-p): Rename from coq-string-suffix-p. Use string-suffix-p for it when available. (string-suffix-p): Never define here. Change all users to use coq--string-suffix-p instead. (coq-smie-.-deambiguate): Use forward-comment. Remove unused var `beg`. (coq-backward-token-fast-nogluing-dot-friends) (coq-forward-token-fast-nogluing-dot-friends): Remove unused var `tok-other`. (coq-smie-search-token-backward): Remove unused var `p`. (coq-smie-:=-deambiguate, coq-smie-backward-token): Prefer char-before over looking-back. (coq-smie-rules): Use `pcase` over deprecated cl's `case`. * coq/coq-syntax.el: Use lexical-binding. (coq-count-match): Rewrite so it doesn't do needless heap-allocation. (coq-module-opening-p, coq-section-command-p, coq-goal-command-str-p): Use case-fold-search rather than proof-string-match. (coq-goal-command-regexp): Forward-declare. (coq-save-command-regexp-strict): Move before first use. (coq-reserved-regexp): Use a single \_< ... \_>. (coq-detect-hyps-positions): Limit search for looking-back. * coq/coq.el: Remove SMIE declarations since SMIE is always used. (coq-use-smie): Remove, unused. (coq-smie): Always require. * generic/pg-pbrpm.el: Fix leftover cl.el uses. * generic/proof-utils.el (proof-defstringset-fn): Fix copy&paste error in the docstring, improve interactive prompt. * lib/maths-menu.el: Use utf-8 and lexical-binding.
* Fix most doc issues raised by (checkdoc)Gravatar Erik Martin-Dorel2018-08-23
|
* Support the Variant vernacularGravatar Tej Chajed2018-08-17
| | | | | Syntactically looks much like an Inductive, though it is non-recursive so "where" (mutual recursion) is not supported.
* Update copyright messages and improve the header of elisp files.Gravatar Erik Martin-Dorel2018-02-21
|
* Experimental fix for #220.Gravatar Pierre Courtieu2018-01-15
|
* Limited extensibility of smie token detection.Gravatar Pierre Courtieu2017-10-26
|
* Fixing #183.Gravatar Pierre Courtieu2017-05-23
|
* Fix #176.Gravatar Pierre Courtieu2017-04-19
| | | | | The code uses several token searcher and the wrong one was called somewhere.
* Fixing #147 and #91 + others indentation bugs.Gravatar Pierre Courtieu2017-01-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | While fixing these I discovered several flaws in indentation (what a suprise). The probem is the following: since we don't have a precise grammar of tactics, smie often decides that the parent of a sub-part of a tactic is the previous command instead of the current tacic. Typical example (fixed now but in general): foo. apply bar with bar'. Since "apply ... bar'" is considered as one leaf of the grammar, it is considered to be a child of the previous dot. . /\ / \ foo apply...bar' Therefore indentation of "with" wants to align with parent "." and hence with "foo". Basically we should try to define a much more precise grammar of complex tactics (with with, as, using etc) in order to fix the problem. Of course this has the drawback of making impossible to support user tactic notations.
* add second argument to looking-back, required in emacs25Gravatar Hendrik Tews2016-12-31
|
* Fix a type error hidden until recent emacs.Gravatar Pierre Courtieu2016-06-23
|
* Fix #47.Gravatar Pierre Courtieu2016-03-09
| | | | There are many other issued with coq-smie-forward-token.
* Fixing a small glitch in indentation.Gravatar Pierre Courtieu2016-03-09
| | | | | if a "; tactic" is not at the end of its line, (hanging) then it should not act on indetation of next line.
* Fix #63 (efficiency pb in indentation).Gravatar Pierre Courtieu2016-03-09
|
* Avoiding useless computation in indentation code.Gravatar Pierre Courtieu2016-03-08
|
* Add uconstr to the (ltac constr) list in SMIEGravatar Clément Pit--Claudel2016-02-27
|
* Fix a typo: s/coq-modulestart-proofstart/coq-indent-proofstart/Gravatar Clément Pit--Claudel2016-02-27
|
* Add a :safe predicate to indentation variablesGravatar Clément Pit--Claudel2016-02-27
| | | | This is useful if people want to set them project-locally.
* Fix #29 + indentation glitch + regexp refactoring.Gravatar Pierre Courtieu2016-01-14
|
* Fixing indentation of ";".Gravatar Pierre Courtieu2016-01-08
| | | | | Local/Global Tactic Notation
* indentation of ";" more accurate.Gravatar Pierre Courtieu2016-01-08
| | | | | Now detecting if the ; is inside a parenthesized tactic (--> no spurious indentation).
* Fixing outdenting in ";" indetation.Gravatar Pierre Courtieu2016-01-08
|
* Trying to indent ";" differently inside Ltac defs.Gravatar Pierre Courtieu2016-01-08
| | | | | | | This only works when the command starts with "Ltac". Ideally we would like to switch to no indentation of ";" each time the ";" is the child of something else that ends a command "." or bullets).
* Fixed indentation of ";" tactical.Gravatar Pierre Courtieu2016-01-07
|
* Adding uset preference coq-indent-semicolon-tactical.Gravatar Pierre Courtieu2016-01-06
| | | | | | | | | Some people prefer ";" tactical to be non indented, in particular in Ltac definitions. Setting this variable to 0 (2 by default) does it. You can still have some indentation by putting ; at beginning of lines: tac1 ; tac2 ; tac3.
* Fixed #15 + more speedup of indentation.Gravatar Pierre Courtieu2015-12-05
| | | | | Experimenting on more regexp and less adhoc searching in the smie lexer. In particular the regexp for bullet seems now capture only real bullets.
* Speeding up indentation code (smie lexer).Gravatar Pierre Courtieu2015-11-30
|
* Fixes #486 with an option.Gravatar Pierre Courtieu2015-05-07
|
* Yet another half fix of smie lexer.Gravatar Pierre Courtieu2015-05-07
| | | | || is either a boolean operator or a tactical.
* Trying to prepare indentation cleaning...Gravatar Pierre Courtieu2015-04-03
|
* Fixed smie code for ";" + added || in grammar.Gravatar Pierre Courtieu2015-03-31
| | | | | Actually || and + are overloaded and I don"t see how to deambiguate them. Indetation may be buggy until I found away.
* Fixed a small bug in indentation.Gravatar Pierre Courtieu2015-03-27
|
* Fixed indetation of tryif then else.Gravatar Pierre Courtieu2015-03-24
|
* Fixed lazymatch and multimatch indentation/highlighting.Gravatar Pierre Courtieu2015-03-23
|
* Customization variables for modules, section and proof indentation.Gravatar Pierre Courtieu2015-03-05
|
* Fixed Proof end/start detection on Proof using ...Gravatar Pierre Courtieu2015-03-04
| | | | | Was making scripting confused. P.
* changed default indentation of match's cases.Gravatar Pierre Courtieu2015-01-14
|
* failed and commented attempt at improving indentation of records.Gravatar Pierre Courtieu2015-01-09
|
* Fixing indentation of pending curly braces.Gravatar Pierre Courtieu2015-01-05
|
* Fix compile on 23.xGravatar David Aspinall2015-01-05
|
* trying to indent pending forall in the expected wayGravatar Pierre Courtieu2015-01-05
|
* fixed indentation (lexing of 'with') + made local coq-load-path.Gravatar Pierre Courtieu2014-12-30
|
* fixed a bug in command parsing for coq, due to recent changes.Gravatar Pierre Courtieu2014-12-24
|
* typo in indentation cod, found after testing coq/ex/indent.v.Gravatar Pierre Courtieu2014-12-24
|
* fixing a small pb in indentation of arrow (->). Not perfect.Gravatar Pierre Courtieu2014-12-24
|
* fixed the use of >= 24.4 function string-suffix-p.Gravatar Pierre Courtieu2014-12-24
|
* Supporting more bullets (coq 8.5), like ++ or ++++.Gravatar Pierre Courtieu2014-12-23
|
* * coq/coq-smie.el: Fix precedence of 'else'.Gravatar Stefan Monnier2014-06-06
|
* * coq-smie.el (coq-smie-.-deambiguate): Proofs don't start with a definition.Gravatar Stefan Monnier2014-06-04
| | | | | (coq-smie-backward-token): Don't burp at EOB. (coq-smie-rules): Indent top-level ":" like ":=".