v0.5.5
Integration of the Clafer compiler and instance generators into Sublime Text 4.
- Michał Antkiewicz, Main developer.
In a Clafer model (.cfr):
- Syntax highlighting of keywords, operators, comments, strings and numbers, compiler directives
(
//# OPTIONSon the first line,//# FRAGMENT,//# GRAPH,//# STATS,//# SUMMARY), and embedded Alloy and JavaScript ([alloy| … |],[choco| … |]). - Compilation
ctrl+b(Tools > Build): the compiler's errors are shown in the model, at their position, and its output in a panel. An error in a file that the model imports (--import, Clafer 0.5.4) is shown at the start of the model, with the file and the position in it, and in that file if it is open; double-click the error's underlined position in the panel, or pressF4, to open the file at the error. The variantValidate(ctrl+shift+b) also validates the generated outputs with Alloy and chocosolver. - Instance generation in a Terminus tab:
- Alloy-based instance generator (claferIG)
ctrl+i, g, a - Choco-based instance generator (chocosolver)
ctrl+i, g, c
- Alloy-based instance generator (claferIG)
- The Command Palette has the same commands under
Clafer:.
- Install Sublime Text 4.
- In Sublime Text, install the packages
Clafer ToolsandTerminuswith Package Control:Tools > Command Palette > Package Control: Install Package. - Download a binary distribution of the Clafer tools and unpack it into a folder of your choice. The instance generators need Java 21 or later.
- Either add that folder to
PATH, or settools_pathto it inPreferences > Package Settings > Clafer Tools > Settings.
tools_path: the folder of the Clafer tools (clafer,claferIG,chocosolver.jar,alloy6.2.0.jar). Empty (the default): use the tools onPATH.clafer_args: the arguments ofclaferfor compilation; the model is added at the end. Default:["-m", "alloy", "-m", "choco", "-m", "html", "--self-contained"].
syntax_test_clafer.cfr tests the syntax: open it and run Tools > Build With… > Syntax Tests.