NeverScript icon indicating copy to clipboard operation
NeverScript copied to clipboard

Syntax Plugins for Text Editors

Open R0X0RE0 opened this issue 2 years ago • 2 comments

Explanation

Syntax coloring makes coding easier because the programmer can distinguish what each part of the code is by color coding. For example, identifiers can be blue and keywords can be orange. Comments can be green.

The text editors that might be the most useful for

  • Notepad++
  • Eclipse
  • VS Code

If I were to contribute..

I would add syntax coloring to these text editors

  • VS Code
  • Vim

I would also add pictures to this thread during development of the plugins to display the syntax colors and check to see if they're all good

R0X0RE0 avatar Jul 01 '22 13:07 R0X0RE0

Good idea, but I wonder if it's easier just to use syntax highlighters for other languages.

At the moment I use C syntax highlighting in whichever editor I'm using cuz it covers the basics for me (highlights strings, keywords like break/return/if, integers, comments etc).

e.g. in neovim I use: :set syntax=c

I'd probably hold off on this functionality for a little while. The project is in a bit of a limbo at the moment while I've been busy with real life, but there are a few grammar changes being made at the moment and I like having the flexibility to keep making adjustments.

E.g. I'm changing the grammar for if-statements at the moment.

NS 0.8 syntax:

if Held X {
    // Do something
}

NS 0.9 syntax (WIP):

if {Held X} {
    // Do something
}

Note that I'm changing this specific part of the grammar to simplify the parser. The {} is ambiguous because it looks like a struct parameter and a block of code at the same time.

Feel free to try this any time, but be warned that it may be outdated soon. My only concern is that the language isn't completely set in stone yet.

byxor avatar Jul 06 '22 12:07 byxor

I'm just happy that there even exists an open source alternative to roq.exe at all and thanks for telling me that the syntax for NS is mostly copying C. Definitely some useful information!

R0X0RE0 avatar Jul 06 '22 14:07 R0X0RE0