Skip to content

Add support for highlighting based on the actual AST #464

Description

@manticore-projects

Greetings.

I do use and love this library very much and I think its great.
However, it seems to fall short for supporting complex languages like SQL or R where the meaning of a token can't be derived from a keyword only.

Example:

SELECT Overlaps( overlaps ) AS overlaps
FROM overlaps.overlaps overlaps
WHERE overlaps = 'overlaps'
    AND (CURRENT_TIME, INTERVAL '1' HOUR) OVERLAPS (CURRENT_TIME, INTERVAL -'1' HOUR)
;

In this example, OVERLAPS is an Expression, a Function, a Label, a Column Name -- and so the highlighting is wrong based on classifying it as keyword.

In my opinion, parsing the AST would help because it will give you precise information, what Token Type comes next.
Would you be willing to accept another TokenMaker implementation, which reads Tokens from an AST (generated by ANTLR or JavaCC)? I would like to start with an implementation for SQL because this bothers me most.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions