elvis icon indicating copy to clipboard operation
elvis copied to clipboard

Preprocessor lines don't recognize '_'

Open fbrau opened this issue 9 years ago • 1 comments

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

fbrau avatar Jul 22 '16 20:07 fbrau

That would be fixed by your patch. See my comment under your pull request.

mbert avatar Jul 23 '16 12:07 mbert