This is a major mode for GNU Emacs 29.1 or later which adds support for the MathProg modeling language used by the GNU Linear Programming Kit, which is a subset of the AMPL language.
The mode provides the following features and enhancements to help writing MathProg models.
Syntax highlighting for the following elements is implemented:
- statements
- comments
- strings
- numbers
- functions
- operators
The keybindings C-M-a and C-M-e jump to the preceding or following statement.
Emacs 29.1 or above with Tree-sitter support is required.
Also the appropriate parser for the MathProg language needs to be installed. The following Elisp code should be used to install the MathProg language parser. This requires some tools -- notably a compiler toolchain -- to be available on your machine.
(require 'mathprog-ts-mode)
(mathprog-ts-mode-install-grammar)Using the function provided by the package ensures that a version of the parser matching the package will be installed. These commands should also be used to update the parser to the correct version when the package is updated.
MathProg Tree-sitter Mode is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
MathProg Tree-sitter Mode is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.