Java Code Examples for com.google.javascript.jscomp.parsing.Config#LanguageMode

The following examples show how to use com.google.javascript.jscomp.parsing.Config#LanguageMode . 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_59_Compiler_s.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 2
Source File: Closure_59_Compiler_t.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 3
Source File: Closure_18_Compiler_t.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 4
Source File: Closure_18_Compiler_s.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 5
Source File: Closure_64_Compiler_s.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword());
  }
  return parserConfig;
}
 
Example 6
Source File: Closure_64_Compiler_t.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword());
  }
  return parserConfig;
}
 
Example 7
Source File: Closure_31_Compiler_s.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 8
Source File: Closure_31_Compiler_t.java    From coming with MIT License 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}
 
Example 9
Source File: Compiler.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
@Override
Config getParserConfig() {
  if (parserConfig == null) {
    Config.LanguageMode mode;
    switch (options.getLanguageIn()) {
      case ECMASCRIPT3:
        mode = Config.LanguageMode.ECMASCRIPT3;
        break;
      case ECMASCRIPT5:
        mode = Config.LanguageMode.ECMASCRIPT5;
        break;
      case ECMASCRIPT5_STRICT:
        mode = Config.LanguageMode.ECMASCRIPT5_STRICT;
        break;
      default:
        throw new IllegalStateException("unexpected language mode");
    }

    parserConfig = ParserRunner.createConfig(
      isIdeMode(),
      mode,
      acceptConstKeyword(),
      options.extraAnnotationNames);
  }
  return parserConfig;
}