ptomato / sublime_autotools

Autotools syntax highlighting for Sublime Text
GNU General Public License v3.0
17 stars 15 forks source link

Embedded `)`s(?) confuse the highlighter, trailing `)` highlighted red #13

Open nabijaczleweli opened 1 year ago

nabijaczleweli commented 1 year ago

Consider the following snippet (part of dash):

AC_ARG_ENABLE(test-workaround, AS_HELP_STRING(--enable-test-workaround, \
    [Guard against faccessat(2) that tells root all files are executable]),,
    [enable_test_workaround=auto])

This is correct and uses all-upstream-autoconf macros. However, it highlights as such:

Cf. also:

AC_LINK_IFELSE([AC_LANG_PROGRAM([void t() {}
                                 void a() __attribute__((__alias__("t")));],
                                [a();])],
               [dash_cv_have_attribute_alias=yes])

ptomato commented 1 year ago

I'm not sure if ignoring the parentheses inside the bracketed argument to AS_HELP_STRING would be technically correct or not. What if you preceded it with m4_define([faccessat], [...])? But regardless, the current result, with an unbalanced bracket in the enclosing macro, seems incorrect. I'd welcome a pull request to fix this.

dnicolson commented 9 months ago

The following code might have the same problem:

AC_DEFUN([FUNC],[
  AC_SUBST([XXX],[YYY])
])

PixelSnap 2023-11-27 at 20 16 07@2x