// Returns true if the specified character is valid as the first character of an identifier. // If an identifier contains any other characters, it has to be surrounded by single quotation marks. public static bool IsIdentStart(char ch) { if (ch >= 128) { return((CharacterUtils.GetUniCatFlags(ch) & CharacterUtils.UniCatFlags.IdentStartChar) != 0); } return(((uint)(ch - 'a') < 26) || ((uint)(ch - 'A') < 26) || (ch == '_') || (ch == PAConstants.IdentifierDelimiter)); }
// Returns true if the specified character is a valid simple identifier character. public static bool IsSimpleIdentCh(char ch) { if (ch >= 128) { return((CharacterUtils.GetUniCatFlags(ch) & CharacterUtils.UniCatFlags.IdentPartChar) != 0); } return(((uint)(ch - 'a') < 26) || ((uint)(ch - 'A') < 26) || ((uint)(ch - '0') <= 9) || (ch == '_')); }