1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 411894: Macros having unconventional but legal characters in names are not highlighted in Makefile Editor

This commit is contained in:
Andrew Gvozdev 2013-06-28 11:22:18 -04:00
parent 1f57a45477
commit 26e1ef6452

View file

@ -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 != '=';
}
}