diff --git a/.gitmodules b/.gitmodules index 86a11e9d..2c612bfe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -630,6 +630,9 @@ [submodule "vendor/grammars/Lean.tmbundle"] path = vendor/grammars/Lean.tmbundle url = https://github.com/leanprover/Lean.tmbundle +[submodule "vendor/grammars/ampl"] + path = vendor/grammars/ampl + url = https://github.com/ampl/sublime-ampl [submodule "vendor/grammars/openscad.tmbundle"] path = vendor/grammars/openscad.tmbundle url = https://github.com/tbuser/openscad.tmbundle diff --git a/grammars.yml b/grammars.yml index caec63e9..3b7596b6 100644 --- a/grammars.yml +++ b/grammars.yml @@ -143,6 +143,8 @@ vendor/grammars/actionscript3-tmbundle: - text.xml.flex-config vendor/grammars/ada.tmbundle: - source.ada +vendor/grammars/ampl: +- source.ampl vendor/grammars/ant.tmbundle: - text.xml.ant vendor/grammars/antlr.tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 195f8b71..4bd9f71c 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -41,6 +41,14 @@ AGS Script: tm_scope: source.c++ ace_mode: c_cpp +AMPL: + type: programming + color: "#00008B" + extensions: + - .ampl + tm_scope: source.ampl + ace_mode: text + ANTLR: type: programming color: "#9DC3FF" diff --git a/samples/AMPL/toy.ampl b/samples/AMPL/toy.ampl new file mode 100644 index 00000000..0ca0c7cf --- /dev/null +++ b/samples/AMPL/toy.ampl @@ -0,0 +1,25 @@ +# A toy knapsack problem from the LocalSolver docs written in AMPL. + +set I; +param Value{I}; +param Weight{I}; +param KnapsackBound; +var Take{I} binary; + +maximize TotalValue: sum{i in I} Take[i] * Value[i]; +s.t. WeightLimit: sum{i in I} Take[i] * Weight[i] <= KnapsackBound; + +data; + +param: +I: Weight Value := +0 10 1 +1 60 10 +2 30 15 +3 40 40 +4 30 60 +5 20 90 +6 20 100 +7 2 15; + +param KnapsackBound := 102; diff --git a/vendor/grammars/ampl b/vendor/grammars/ampl new file mode 160000 index 00000000..2e399ebf --- /dev/null +++ b/vendor/grammars/ampl @@ -0,0 +1 @@ +Subproject commit 2e399ebf4aec6b5b81f01d4cbee965f77852ce86