Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font-locking #10

Open
christophe-gouel opened this issue Dec 14, 2023 · 1 comment
Open

Font-locking #10

christophe-gouel opened this issue Dec 14, 2023 · 1 comment

Comments

@christophe-gouel
Copy link
Contributor

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:

  • GAMS dollar commands are not colorized if written without dollar on the same line of another dollar command.
  • Labels are colorized differently if written with or without quotes. With quotes, the font used is the one used for set elements.

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
Copy link
Contributor Author

christophe-gouel commented Dec 25, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant