ShiroTakeda / gams-mode

GAMS mode for Emacs
http://shirotakeda.org/en/gams/gams-mode/
12 stars 4 forks source link

Font-locking #10

Open christophe-gouel opened 6 months ago

christophe-gouel commented 6 months ago

Hi,

I have put in my auto-completion branch which is in the last PR a file to test font-locking: https://github.com/christophe-gouel/gams-mode/blob/auto-completion/test_fontlocking.gms.

I have identified in it two small issues:

I am sorry but my elisp skills are not good enough to help fix these issues.

These are small issues (the first one is not even dealt with in GAMS Studio), but there may be an easy fix. If not, don't bother.

christophe-gouel commented 6 months ago

After thinking, there are a few difficulties in having font-locking for dollar commands without $. Indeed, when you remove the $, a few commands are the same as standard GAMS commands. For example, $Set and $if.

However, interestingly, font-locking already works for dollar commands when the $ is separated from the command. Example:

$ifThen not %gams.logOption% == 3
$  ifI %system.fileSys% == UNIX  $set nullFile > /dev/null
$  ifI %system.fileSys% == MSNT  $set nullFile > nul
$  if not set nullFile $abort %system.fileSys% not recognized
$else
$  set nullFile
$endIf