You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This provides TextMate and Sublime bundles to enable syntax
highlighting for programs written in the Whiley.
This also serves as the grammar for
github/linguist (which enables
syntax highlighting on Github).
An example Whiley program is the following:
typenatis (intx) wherex>=0functionindexOf(int[] items, intitem) -> (intr)
// If valid index returned, element matches itemensuresr>=0==>items[r] ==item// If invalid index return, no element matches itemensuresr<0==>all { iin0..|items| | items[i] != item }
// Return value is between -1 and size of itemsensuresr>=-1&&r< |items|:
//nati = 0whilei< |items|
whereall { kin0 .. i | items[k] != item }:
// ifitems[i] ==item:
returnii = i+1//return-1
Install (Sublime)
Eventually you will be able to install via
PackageControl. For now, you can copy
the whiley.submlime-text file into
.config/sublime-tests/Packages/User.
The single source of truth is the file
Syntaxes/whiley.YAML-tmLanguage. This is used to generate the
remaining files:
whiley.tmLanguage. This is generated by installing
PackageDev and then
running Tools > Build on whiley.YAML-tmLanguage and choosing
Convert to: Property List.
whiley.sublime-text. This is generated by selecting the file
whiley.tmLanguage and running Tools > Developer > New Syntax from whiley.tmLanguage ....