BorisChumichev / modelicaSublimeTextPackage

Syntax definitions for the Modelica language
MIT License
11 stars 10 forks source link

Constraint should be a keyword #6

Open r-barnes opened 9 years ago

r-barnes commented 9 years ago

constraint and optimization should be keywords, like equation and algorithm are.

These terms are used in optimization. See here for details.

thorade commented 9 years ago

Could you upload a sample code file to https://gist.github.com or can you link to sample code on github? Is the code sample on the linked page a complete file? Once there is some sample code on github, syntax highlight can be tested with Lightshow.

r-barnes commented 9 years ago

Sure thing, I've put a code sample on gist here. I do use this model for some of my work, so the code should be well-formed.

thorade commented 9 years ago

OK, here is the link to highlight your file with Lightshow: http://bit.ly/1hZXOp9 This does of course not fix your problem, but at least it does demonstrate it and the link can be used to test future fixes.

Note: Your file has the extension .mop (instead of .mo). Do all Optimica files have that extension? Then the extension would also have to be added to the list of accepted extensions. What other keywords does Optimica add that are not present in standard Modelica? finalTime and initialGuess? Anything else?

r-barnes commented 9 years ago

Lightshow's pretty cool!

I'm afraid I don't know about the extensions; I think that one copies an example file I downloaded from the JModelica documentation, but cannot recall for sure.

finalTime and startTime strike me as being more like arguments than language keywords in the sense that equation, function, and end are. Whatever category they fall under would also include objective, though. I don't see where you saw initialGuess.