Skip to content

Preprocessor lines don't recognize '_' #21

@fbrau

Description

@fbrau

Look at the pics, the "-include_lib" directive (parsed as preprocessor) displays
"-include" in color but the rest "_lib" in normal font. This commit fixes it.
I guess this also rules on C based languages too, so I post the patch here.

`
changeset: 108:805ca85ab8ba
branch: fran-stable
tag: tip
user: memo_ao756
date: Fri Jul 22 16:16:21 2016 -0300
files: dmsyntax.c
description:
fixes preprocessor parsing ends at '_' in preprocessor lines

In erlang, for example this is valid. Dont' know other languages...

diff -r c58302a54a7a -r 805ca85ab8ba dmsyntax.c
--- a/dmsyntax.c Fri Jun 24 00:16:30 2016 -0300
+++ b/dmsyntax.c Fri Jul 22 16:16:21 2016 -0300
@@ -1504,7 +1504,7 @@
{
sinfo->token = PREPWORD;
}

  •       else if (sinfo->token == PREPWORD && !elvalnum(*cp))
    
  •       else if (sinfo->token == PREPWORD && !elvalnum(*cp) && *cp != '_')
        {
            sinfo->token = PUNCT;
            expectprepq = ElvTrue;
    

`

faulty

fixed

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