Java Code Examples for com.google.javascript.rhino.TokenStream#isKeyword()

The following examples show how to use com.google.javascript.rhino.TokenStream#isKeyword() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Closure_94_NodeUtil_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 2
Source File: Closure_61_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 3
Source File: Closure_80_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 4
Source File: Closure_80_NodeUtil_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 5
Source File: Closure_86_NodeUtil_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 6
Source File: Closure_86_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 7
Source File: Closure_75_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 8
Source File: Closure_60_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 9
Source File: jKali_003_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 10
Source File: jKali_003_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 11
Source File: Closure_10_NodeUtil_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 12
Source File: Cardumen_0087_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 13
Source File: Cardumen_0014_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 14
Source File: Cardumen_0014_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 15
Source File: Cardumen_00149_t.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name is a valid variable name.
 */
static boolean isValidSimpleName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, Unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 16
Source File: Closure_75_NodeUtil_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 17
Source File: Closure_61_NodeUtil_s.java    From coming with MIT License 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 18
Source File: 1_NodeUtil.java    From SimFix with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Determines whether the given name can appear on the right side of
 * the dot operator. Many properties (like reserved words) cannot.
 */
static boolean isValidPropertyName(String name) {
  return TokenStream.isJSIdentifier(name) &&
      !TokenStream.isKeyword(name) &&
      // no Unicode escaped characters - some browsers are less tolerant
      // of Unicode characters that might be valid according to the
      // language spec.
      // Note that by this point, unicode escapes have been converted
      // to UTF-16 characters, so we're only searching for character
      // values, not escapes.
      isLatin(name);
}
 
Example 19
Source File: Closure_122_IRFactory_t.java    From coming with MIT License 4 votes vote down vote up
private boolean isReservedKeyword(String identifier) {
  if (config.languageMode == LanguageMode.ECMASCRIPT3) {
    return TokenStream.isKeyword(identifier);
  }
  return reservedKeywords != null && reservedKeywords.contains(identifier);
}
 
Example 20
Source File: Closure_122_IRFactory_s.java    From coming with MIT License 4 votes vote down vote up
private boolean isAllowedProp(String identifier) {
  if (config.languageMode == LanguageMode.ECMASCRIPT3) {
    return !TokenStream.isKeyword(identifier);
  }
  return true;
}