From 26e1ef645205bc5b5a34a9b9834277019580bb02 Mon Sep 17 00:00:00 2001 From: Andrew Gvozdev Date: Fri, 28 Jun 2013 11:22:18 -0400 Subject: [PATCH] Bug 411894: Macros having unconventional but legal characters in names are not highlighted in Makefile Editor --- .../internal/ui/text/makefile/MacroDefinitionRule.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java index 0eb413832cf..b4fd6ea6a04 100644 --- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java +++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/text/makefile/MacroDefinitionRule.java @@ -157,9 +157,13 @@ class MacroDefinitionRule implements IPredicateRule { return true; } + protected boolean isValidCharacter(int c) { - char c0 = (char) c; - return Character.isLetterOrDigit(c0) || (c0 == '_'); + // From GNUMakefile manual: + // A variable name may be any sequence of characters not containing ‘:’, ‘#’, ‘=’, or leading or trailing whitespace. + // However, variable names containing characters other than letters, numbers, and underscores should be avoided, + // as they may be given special meanings in the future, and with some shells they cannot be passed through the environment to a sub-make + return !Character.isWhitespace(c) && c != ':' && c != '#' && c != '='; } }