modelica-tools / atom-language-modelica

Modelica language support for the atom editor
https://atom.io/packages/language-modelica
Other
8 stars 4 forks source link

min and max #29

Open thorade opened 8 years ago

thorade commented 8 years ago

Another minor mismatch: In the following code example, min and maxshould have the same colour as quantity and unit.

type Efficiency = Real (
    final quantity="Efficiency",
    final unit="1",
    min=0,
    max=1);
bilderbuchi commented 8 years ago

This apparently broke some time between 0.2.1 (where it was working) and 0.3.0.

bilderbuchi commented 8 years ago

OK, it was 38a8b438f42a3b6cf97077870e36e393ff6c6187 that broke it (which makes sense). Did this work with Boris' grammar?

thorade commented 8 years ago

We replaced Raphaels grammar (v0.2.1) with Boris' grammar (v0.3.1). With Raphaels version, the min and max have the same color as the "final" keyword. Do you see what line of the grammar is responsible for the highlighting?

bilderbuchi commented 8 years ago

ah, of course, my bad, I didn't look closely enough. :-/ Presumably, it's because of these lines.

bilderbuchi commented 8 years ago

argh, min is also in here :-/

thorade commented 8 years ago

One idea: all function calls use parantheses. So maybe we can search for min( and min ( instead of just min. And so on. Or are there functions that do not take an argument (and can thus be called without parantheses)? Or maybe just change it for minand max. These two take an argument for sure.

bilderbuchi commented 8 years ago

Or are there functions that do not take an argument (and can thus be called without parantheses)

I am not a Modelica expert, but even functions taking no arguments are (in other languages) typically invoked with func(), not func.