Skip to content

syntax mode parsing could improve just a little #20

@fbrau

Description

@fbrau

Hi. I've been reading syntax mode code and it seems very clever to avoid full parsing
but I've encountered several times with cases when multiline tokens where:

considering the code:
char* hello = "hello \ world \ godbye"; int x = 1;

and having
world \ goodbye"; int x = 1;
on focus, the syntax mode 'world goodbye' are displayed in normal text and
'"; int x = 1...' is displayed a string token.

The "parser" doesnt recognize "world \ godbye" comes from a string
opening just a few lines before the focused text. I've searching a few points in the
code and there is actually a function in dmsyntax.c (setup(...)) which implements some
king of backtraking to detect this case. Managed to understand it somehow but
it is never evaluated.

I want to implement a buffer option to effect in the parsing code to
"alternate" the syntax detection considering the first token is part of
a multilinetoken (coment or string), nothing smart, just an option.

I modified the setup(...) function to do just that by this is not in the path
of syntax drawing.

Where this feature should go in the code or where begins the parsing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions