ConfigMate / configmate-gui

MIT License
1 stars 0 forks source link

Basic syntax highlighting #51

Closed ktminks closed 9 months ago

ktminks commented 10 months ago

Description

Implement basic syntax highlighting of rulebook files.

Tasks

Declarative Approach

Programmatic Approach

Resources

ktminks commented 9 months ago

Basic semantic highlighting

using regexes based off the grammar.

image

Right now, most non-primitive tokens are being recognized as 'keywords'.

image

API Route

Ideally, I would be able to send a request to the API with the path to a .cms file, and receive its tokenized contents in response.

There is also the option of a "superType" for each type, like primitives, and I can make use of any other relevant information that might be of interest to the user.

Technically all that is required, though, is:

{
   line,              //row number, 0-based index 
   startCharacter,    //col number, 0-based index
   length,            //string length
   tokenType: type,   //standard or custom type
   tokenModifiers: [] //standard or custom modifiers (declaration, definition, readonly, static, etc.), optional 
}