Java Code Examples for com.intellij.psi.tree.TokenSet

The following are top voted examples for showing how to use com.intellij.psi.tree.TokenSet. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: intellij-ce-playground   File: IndentsPass.java   Source Code and License 6 votes vote down vote up
private boolean isComment(int offset) {
  final HighlighterIterator it = myEditor.getHighlighter().createIterator(offset);
  IElementType tokenType = it.getTokenType();
  Language language = tokenType.getLanguage();
  TokenSet comments = myComments.get(language);
  if (comments == null) {
    ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(language);
    if (definition != null) {
      comments = definition.getCommentTokens();
    }
    if (comments == null) {
      return false;
    }
    else {
      myComments.put(language, comments);
    }
  }
  return comments.contains(tokenType);
}
 
Example 2
Project: intellij-ce-playground   File: StubBasedPsiElementBase.java   Source Code and License 6 votes vote down vote up
/**
 * @return children of specified type, taken from stubs (if this element is currently stub-based) or AST (otherwise).
 */
public <Psi extends PsiElement> Psi[] getStubOrPsiChildren(TokenSet filter, ArrayFactory<Psi> f) {
  T stub = myStub;
  if (stub != null) {
    //noinspection unchecked
    return (Psi[])stub.getChildrenByType(filter, f);
  }
  else {
    final ASTNode[] nodes = getNode().getChildren(filter);
    Psi[] psiElements = f.create(nodes.length);
    for (int i = 0; i < nodes.length; i++) {
      //noinspection unchecked
      psiElements[i] = (Psi)nodes[i].getPsi();
    }
    return psiElements;
  }
}
 
Example 3
Project: intellij-ce-playground   File: TypeDefinition.java   Source Code and License 6 votes vote down vote up
private static IElementType parseEnumBody(@NotNull PsiBuilder builder,
                                          @NotNull String enumName,
                                          @NotNull GroovyParser parser) {
  PsiBuilder.Marker ebMarker = builder.mark();

  if (!ParserUtils.getToken(builder, GroovyTokenTypes.mLCURLY)) {
    ebMarker.rollbackTo();
    return GroovyElementTypes.WRONGWAY;
  }

  ParserUtils.getToken(builder, GroovyTokenTypes.mNLS);

  if (EnumConstant.parseConstantList(builder, parser)) {
    if (!ParserUtils.lookAhead(builder, GroovyTokenTypes.mRCURLY)) {
      ParserUtils.getToken(builder, TokenSet.create(GroovyTokenTypes.mNLS, GroovyTokenTypes.mSEMI), GroovyBundle.message("separator.or.rcurly.expected"));
    }
  }

  parseMembers(builder, enumName, parser, false);

  ParserUtils.getToken(builder, GroovyTokenTypes.mRCURLY, GroovyBundle.message("rcurly.expected"));

  ebMarker.done(GroovyElementTypes.ENUM_BODY);
  return GroovyElementTypes.ENUM_BODY;
}
 
Example 4
Project: intellij-ce-playground   File: TypedHandler.java   Source Code and License 6 votes vote down vote up
private static boolean isInsideStringLiteral(@NotNull Editor editor, @NotNull PsiFile file) {
  int offset = editor.getCaretModel().getOffset();
  PsiElement element = file.findElementAt(offset);
  if (element == null) return false;
  final ParserDefinition definition = LanguageParserDefinitions.INSTANCE.forLanguage(element.getLanguage());
  if (definition != null) {
    final TokenSet stringLiteralElements = definition.getStringLiteralElements();
    final ASTNode node = element.getNode();
    if (node == null) return false;
    final IElementType elementType = node.getElementType();
    if (stringLiteralElements.contains(elementType)) {
      return true;
    }
    PsiElement parent = element.getParent();
    if (parent != null) {
      ASTNode parentNode = parent.getNode();
      if (parentNode != null && stringLiteralElements.contains(parentNode.getElementType())) {
        return true;
      }
    }
  }
  return false;
}
 
Example 5
Project: intellij-ce-playground   File: RncFoldingBuilder.java   Source Code and License 6 votes vote down vote up
@Nullable
private static ASTNode checkNodeAndSiblings(@Nullable ASTNode node, TokenSet tokens, ArrayList<FoldingDescriptor> regions, Document document) {
  if (node != null && tokens.contains(node.getElementType())) {
    final ASTNode start = node;
    ASTNode end = start;

    node = node.getTreeNext();
    if (node != null) {
      do {
        end = node;
        node = node.getTreeNext();
      } while (node != null && tokens.contains(node.getElementType()));
    }
    if (end != start) {
      while (end.getPsi() instanceof PsiWhiteSpace) {
        end = end.getTreePrev();
      }
      if (isOnDifferentLine(start, end, document)) {
        regions.add(new FoldingDescriptor(start, new TextRange(start.getStartOffset(), end.getTextRange().getEndOffset())));
      }
    }
  }
  return node;
}
 
Example 6
Project: intellij-ce-playground   File: PyConditionalStatementPartFixer.java   Source Code and License 6 votes vote down vote up
@Override
public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyConditionalStatementPart statementPart)
  throws IncorrectOperationException {
  final PyExpression condition = statementPart.getCondition();
  final Document document = editor.getDocument();
  final PsiElement colon = PyPsiUtils.getFirstChildOfType(statementPart, PyTokenTypes.COLON);
  if (colon == null) {
    if (condition != null) {
      final PsiElement firstNonComment = PyPsiUtils.getNextNonCommentSibling(condition.getNextSibling(), false);
      if (firstNonComment != null && !":".equals(firstNonComment.getNode().getText())) {
        document.insertString(firstNonComment.getTextRange().getEndOffset(), ":");
      }
    }
    else {
      final TokenSet keywords = TokenSet.create(PyTokenTypes.IF_KEYWORD, PyTokenTypes.ELIF_KEYWORD, PyTokenTypes.WHILE_KEYWORD);
      final PsiElement keywordToken = PyPsiUtils.getChildByFilter(statementPart,
                                                                  keywords, 0);
      final int offset = sure(keywordToken).getTextRange().getEndOffset();
      document.insertString(offset, " :");
      processor.registerUnresolvedError(offset + 1);
    }
  }
  else if (condition == null) {
    processor.registerUnresolvedError(colon.getTextRange().getStartOffset());
  }
}
 
Example 7
Project: intellij-ce-playground   File: TodoIndex.java   Source Code and License 6 votes vote down vote up
@Override
public boolean acceptInput(@NotNull final VirtualFile file) {
  if (!file.isInLocalFileSystem()) {
    return false; // do not index TODOs in library sources
  }

  final FileType fileType = file.getFileType();

  if (fileType instanceof LanguageFileType) {
    final Language lang = ((LanguageFileType)fileType).getLanguage();
    final ParserDefinition parserDef = LanguageParserDefinitions.INSTANCE.forLanguage(lang);
    final TokenSet commentTokens = parserDef != null ? parserDef.getCommentTokens() : null;
    return commentTokens != null;
  }

  return PlatformIdTableBuilding.isTodoIndexerRegistered(fileType) ||
         fileType instanceof CustomSyntaxTableFileType;
}
 
Example 8
Project: TS-IJ   File: TSFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(
            new TSLexerAdapter(),
            TokenSet.create(TSTypes.ID),
            TokenSet.create(TSTypes.COMMENT),
            TokenSet.EMPTY
    );
}
 
Example 9
Project: AppleScript-IDEA   File: AppleScriptFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(new AppleScriptLexerAdapter(),
          TokenSet.create(AppleScriptTypes.IDENTIFIER),
          TokenSet.create(AppleScriptTypes.COMMENT),
          TokenSet.create(AppleScriptTypes.STRING_LITERAL));
}
 
Example 10
Project: bamboo-soy   File: SoyFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
  return new DefaultWordsScanner(
      new SoyLexer(),
      TokenSet.create(SoyTypes.IDENTIFIER_WORD),
      TokenSet.create(SoyTypes.COMMENT_BLOCK),
      TokenSet.EMPTY);
}
 
Example 11
Project: bamboo-soy   File: ClosingBraceSanityAnnotator.java   Source Code and License 5 votes vote down vote up
@Override
public void annotate(@NotNull PsiElement psiElement, @NotNull AnnotationHolder annotationHolder) {
  if (psiElement instanceof TagElement) {
    TagElement tagElement = (TagElement) psiElement;

    TokenSet allowedRBraces = SoyTokenTypes.RIGHT_BRACES;
    if (mustCloseRBraceTags.contains(tagElement.getClass())) {
      allowedRBraces = TokenSet.andNot(allowedRBraces, SoyTokenTypes.SLASH_R_BRACES);
    } else if (mustCloseSlashRBraceTags.contains(tagElement.getClass())) {
      allowedRBraces = TokenSet.andSet(allowedRBraces, SoyTokenTypes.SLASH_R_BRACES);
    }

    if (tagElement.isDoubleBraced()) {
      allowedRBraces = TokenSet.andSet(allowedRBraces, SoyTokenTypes.DOUBLE_BRACES);
    } else {
      allowedRBraces = TokenSet.andNot(allowedRBraces, SoyTokenTypes.DOUBLE_BRACES);
    }

    if (!allowedRBraces.contains(tagElement.getClosingBraceType())) {
      annotationHolder.createErrorAnnotation(tagElement, "Must close by " +
          Stream.of(allowedRBraces.getTypes())
              .map(SoyTokenTypes.BRACE_TYPE_TO_STRING::get)
              .sorted()
              .collect(Collectors.joining(" or ")));
    }
  }
}
 
Example 12
Project: hybris-integration-intellij-idea-plugin   File: FlexibleSearchFormattingModelBuilder.java   Source Code and License 5 votes vote down vote up
private static SpacingBuilder createSpaceBuilder(final CodeStyleSettings settings) {

        return new SpacingBuilder(settings, FlexibleSearchLanguage.getInstance())
            .after(FlexibleSearchTypes.COMP_OP)
            .spaceIf(true)

            .before(FlexibleSearchTypes.COMP_OP)
            .spaceIf(true)

            .after(FlexibleSearchTypes.LEFT_DOUBLE_BRACE)
            .spaceIf(true)

            .before(FlexibleSearchTypes.RIGHT_DOUBLE_BRACE)
            .spaceIf(true)

            .before(FlexibleSearchTypes.LEFT_BRACE)
            .spaceIf(true)

            .after(FlexibleSearchTypes.RIGHT_BRACE)
            .spaceIf(true)

            .before(FlexibleSearchTypes.LEFT_PAREN)
            .spaceIf(true)

            .after(FlexibleSearchTypes.RIGHT_PAREN)
            .spaceIf(true)

            .around(TokenSet.create(FlexibleSearchTypes.WHERE, FlexibleSearchTypes.WHERE_CLAUSE))
            .spaceIf(true)
            ;
    }
 
Example 13
Project: hybris-integration-intellij-idea-plugin   File: ImpexFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(
        new ImpexLexerAdapter(),
        orSet(
            create(ImpexTypes.MACRO_NAME_DECLARATION),
            create(ImpexTypes.MACRO_DECLARATION),
            create(ImpexTypes.MACRO_USAGE)
        ),
        create(ImpexTypes.COMMENT),
        TokenSet.ANY
    );
}
 
Example 14
Project: intellij-plugin   File: CoffigYamlFileImpl.java   Source Code and License 5 votes vote down vote up
public List<YAMLDocument> getDocuments() {
    final ArrayList<YAMLDocument> result = new ArrayList<>();
    for (ASTNode node : getNode().getChildren(TokenSet.create(YAMLElementTypes.DOCUMENT))) {
        result.add((YAMLDocument) node.getPsi());
    }
    return result;
}
 
Example 15
Project: intellij-plugin   File: CoffigFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new YAMLFlexLexer(),
            TokenSet.create(YAMLTokenTypes.SCALAR_KEY),
            TokenSet.create(YAMLTokenTypes.COMMENT),
            TokenSet.create(YAMLTokenTypes.SCALAR_TEXT, YAMLTokenTypes.SCALAR_DSTRING, YAMLTokenTypes.SCALAR_STRING));
}
 
Example 16
Project: intellij-crystal   File: CrystalFindUsagesProvider.java   Source Code and License 5 votes vote down vote up
@Nullable
@Override
public WordsScanner getWordsScanner() {
    return new DefaultWordsScanner(new CrystalLexerAdapter(),
            TokenSet.create(CrystalTypes.KEY),
            TokenSet.create(CrystalTypes.COMMENT),
            TokenSet.EMPTY);
}
 
Example 17
Project: intellij-ce-playground   File: SyntaxHighlighterBase.java   Source Code and License 5 votes vote down vote up
/**
 * Tries to update the map by associating given keys with a given value.
 * Throws error if the map already contains different mapping for one of given keys.
 */
protected static void safeMap(@NotNull final Map<IElementType, TextAttributesKey> map,
                              @NotNull final TokenSet keys,
                              @NotNull final TextAttributesKey value) {
  for (final IElementType type : keys.getTypes()) {
    safeMap(map, type, value);
  }
}
 
Example 18
Project: intellij-ce-playground   File: StubBase.java   Source Code and License 5 votes vote down vote up
@Override
public <E extends PsiElement> E[] getChildrenByType(final TokenSet filter, final ArrayFactory<E> f) {
  final int count = countChildren(filter);

  E[] array = f.create(count);
  if (count == 0) return array;

  fillFilteredChildren(filter, array);

  return array;
}
 
Example 19
Project: intellij-ce-playground   File: LightTreeUtil.java   Source Code and License 5 votes vote down vote up
@NotNull
public static List<LighterASTNode> getChildrenOfType(@NotNull LighterAST tree, @NotNull LighterASTNode node, @NotNull TokenSet types) {
  List<LighterASTNode> result = null;

  List<LighterASTNode> children = tree.getChildren(node);
  for (int i = 0, size = children.size(); i < size; ++i) {
    LighterASTNode child = children.get(i);
    if (types.contains(child.getTokenType())) {
      if (result == null) result = new SmartList<LighterASTNode>();
      result.add(child);
    }
  }

  return result != null ? result: Collections.<LighterASTNode>emptyList();
}
 
Example 20
Project: intellij-ce-playground   File: TreeUtil.java   Source Code and License 5 votes vote down vote up
@Nullable
public static ASTNode findSibling(ASTNode start, TokenSet types) {
  ASTNode child = start;
  while (true) {
    if (child == null) return null;
    if (types.contains(child.getElementType())) return child;
    child = child.getTreeNext();
  }
}
 
Example 21
Project: intellij-ce-playground   File: PyBaseElementImpl.java   Source Code and License 5 votes vote down vote up
@NotNull
protected <T extends PyElement> T childToPsiNotNull(TokenSet filterSet, int index) {
  final PyElement child = childToPsi(filterSet, index);
  if (child == null) {
    throw new RuntimeException("child must not be null: expression text " + getText());
  }
  //noinspection unchecked
  return (T)child;
}
 
Example 22
Project: intellij-ce-playground   File: RegExpSetOptionsImpl.java   Source Code and License 5 votes vote down vote up
public RegExpOptions getOffOptions() {
    final ASTNode[] nodes = getNode().getChildren(TokenSet.create(RegExpElementTypes.OPTIONS));
    for (ASTNode node : nodes) {
        if (node.textContains('-')) {
            return (RegExpOptions)node.getPsi();
        }
    }
    return null;
}
 
Example 23
Project: lua-for-idea   File: LuaPsiBuilder.java   Source Code and License 5 votes vote down vote up
public boolean compareAndEat(final TokenSet types) {
	boolean found = compare(types);
	if (found) {
		advanceLexer();
	}
	return found;
}
 
Example 24
Project: intellij-ce-playground   File: XmlParser.java   Source Code and License 5 votes vote down vote up
@Override
@NotNull
public ASTNode parse(final IElementType root, final PsiBuilder builder) {
  builder.enforceCommentTokens(TokenSet.EMPTY);
  builder.putUserDataUnprotected(PsiBuilderImpl.CUSTOM_COMPARATOR, REPARSE_XML_TAG_BY_NAME);
  final PsiBuilder.Marker file = builder.mark();
  new XmlParsing(builder).parseDocument();
  file.done(root);
  return builder.getTreeBuilt();
}
 
Example 25
Project: intellij-ce-playground   File: AlignmentInColumnsHelper.java   Source Code and License 5 votes vote down vote up
private static List<IElementType> findSubNodeTypes(ASTNode node, TokenSet types) {
  List<IElementType> foundTypes = new SmartList<IElementType>();
  for (ASTNode child = node.getFirstChildNode(); child != null && child.getTreeParent() == node; child = child.getTreeNext()) {
    IElementType type = child.getElementType();
    if (types.contains(type)) {
      foundTypes.add(type);
    }
  }
  return foundTypes;
}
 
Example 26
Project: intellij-ce-playground   File: XPathLexer.java   Source Code and License 5 votes vote down vote up
private static boolean lookingAt(Lexer lexer, TokenSet tokenSet) {
  final LexerPosition position = lexer.getCurrentPosition();
  try {
    lexer.advance();
    skipWhitespaceAnComments(lexer);
    return tokenSet.contains(lexer.getTokenType());
  } finally {
    lexer.restore(position);
  }
}
 
Example 27
Project: intellij-ce-playground   File: PsiUtil.java   Source Code and License 5 votes vote down vote up
private static PsiElement skipSet(PsiElement elem, boolean forward, TokenSet set, boolean skipNLs) {
  while (elem != null &&
         elem.getNode() != null &&
         set.contains(elem.getNode().getElementType()) &&
         (skipNLs || elem.getText().indexOf('\n') == -1)) {
    if (forward) {
      elem = elem.getNextSibling();
    }
    else {
      elem = elem.getPrevSibling();
    }
  }
  return elem;
}
 
Example 28
Project: intellij-ce-playground   File: JspIndexPatternBuilder.java   Source Code and License 5 votes vote down vote up
@Override
public TokenSet getCommentTokenSet(@NotNull final PsiFile file) {
  final JspFile jspFile = JspPsiUtil.getJspFile(file);
  TokenSet commentTokens = TokenSet.orSet(JavaIndexPatternBuilder.XML_COMMENT_BIT_SET, StdTokenSets.COMMENT_BIT_SET);
  final ParserDefinition parserDefinition =
    LanguageParserDefinitions.INSTANCE.forLanguage(jspFile.getViewProvider().getTemplateDataLanguage());
  if (parserDefinition != null) {
    commentTokens = TokenSet.orSet(commentTokens, parserDefinition.getCommentTokens());
  }
  return commentTokens;
}
 
Example 29
Project: intellij-ce-playground   File: StubBase.java   Source Code and License 5 votes vote down vote up
private int countChildren(final TokenSet types) {
  int count = 0;
  List<StubElement> childrenStubs = getChildrenStubs();
  //noinspection ForLoopReplaceableByForEach
  for (int i = 0, childrenStubsSize = childrenStubs.size(); i < childrenStubsSize; i++) {
    StubElement childStub = childrenStubs.get(i);
    if (types.contains(childStub.getStubType())) count++;
  }

  return count;
}
 
Example 30
Project: intellij-ce-playground   File: SimplifyBooleanCheckQuickFix.java   Source Code and License 5 votes vote down vote up
private static String createReplacementText(PyBinaryExpression expression) {
  PyExpression resultExpression;
  final PyExpression leftExpression = expression.getLeftExpression();
  final PyExpression rightExpression = expression.getRightExpression();
  boolean positiveCondition = !TokenSet.create(PyTokenTypes.NE, PyTokenTypes.NE_OLD).contains(expression.getOperator());
  positiveCondition ^= isFalse(leftExpression) || isFalse(rightExpression) || isNull(rightExpression) || isNull(leftExpression)
                       || isEmpty(rightExpression) || isEmpty(leftExpression);
  if (isTrue(leftExpression) || isFalse(leftExpression) || isNull(leftExpression) || isEmpty(leftExpression)) {
    resultExpression = rightExpression;
  } else {
    resultExpression = leftExpression;
  }
  return ((positiveCondition) ? "" : "not ") + resultExpression.getText();
}
 
Example 31
Project: intellij-ce-playground   File: LightTreeUtil.java   Source Code and License 5 votes vote down vote up
@Nullable
public static LighterASTNode firstChildOfType(@NotNull List<LighterASTNode> children, @NotNull TokenSet types) {
  for (int i = 0; i < children.size(); ++i) {
    LighterASTNode child = children.get(i);
    if (types.contains(child.getTokenType())) return child;
  }

  return null;
}
 
Example 32
Project: intellij-ce-playground   File: CompositeElement.java   Source Code and License 5 votes vote down vote up
@Override
@Nullable
public ASTNode findChildByType(@NotNull TokenSet typesSet, ASTNode anchor) {
  if (DebugUtil.CHECK_INSIDE_ATOMIC_ACTION_ENABLED){
    ApplicationManager.getApplication().assertReadAccessAllowed();
  }
  ASTNode child = anchor;
  while (true) {
    if (child == null) return null;
    if (typesSet.contains(child.getElementType())) return child;
    child = child.getTreeNext();
  }
}
 
Example 33
Project: intellij-ce-playground   File: FindManagerImpl.java   Source Code and License 5 votes vote down vote up
public CommentsLiteralsSearchData(VirtualFile lastFile, Set<Language> relevantLanguages,
                                  SyntaxHighlighterOverEditorHighlighter highlighter, TokenSet tokensOfInterest,
                                  StringSearcher searcher, Matcher matcher, FindModel model) {
  this.lastFile = lastFile;
  this.highlighter = highlighter;
  this.tokensOfInterest = tokensOfInterest;
  this.searcher = searcher;
  this.matcher = matcher;
  this.relevantLanguages = relevantLanguages;
  this.model = model;
}
 
Example 34
Project: intellij-ce-playground   File: PythonTokenSetContributor.java   Source Code and License 5 votes vote down vote up
@NotNull
@Override
public TokenSet getStatementTokens() {
  return TokenSet.create(EXPRESSION_STATEMENT, ASSIGNMENT_STATEMENT, AUG_ASSIGNMENT_STATEMENT, ASSERT_STATEMENT,
                         BREAK_STATEMENT, CONTINUE_STATEMENT, DEL_STATEMENT, EXEC_STATEMENT, FOR_STATEMENT,
                         FROM_IMPORT_STATEMENT, GLOBAL_STATEMENT, IMPORT_STATEMENT, IF_STATEMENT, PASS_STATEMENT,
                         PRINT_STATEMENT, RAISE_STATEMENT, RETURN_STATEMENT, TRY_EXCEPT_STATEMENT, WITH_STATEMENT,
                         WHILE_STATEMENT, NONLOCAL_STATEMENT, CLASS_DECLARATION, FUNCTION_DECLARATION);
}
 
Example 35
Project: intellij-ce-playground   File: GroovyParser.java   Source Code and License 5 votes vote down vote up
private boolean parseGenericStatement(PsiBuilder builder, TokenSet until) {
  boolean plainStatement = parseStatement(builder, false);

  if (plainStatement || parseExtendedStatement(builder)) {
    if (parseSeparatorsWithoutLastNls(builder, plainStatement, until)) {
      return false;
    }
  }
  else {
    builder.error(GroovyBundle.message("wrong.statement"));
    assert builder.getTokenType() != GroovyTokenTypes.mLCURLY && builder.getTokenType() != GroovyTokenTypes.mRCURLY;
    builder.advanceLexer();
  }
  return true;
}
 
Example 36
Project: TS-IJ   File: TSParserDefinition.java   Source Code and License 4 votes vote down vote up
@NotNull
@Override
public TokenSet getWhitespaceTokens() {
    return WHITE_SPACES;
}
 
Example 37
Project: TS-IJ   File: TSParserDefinition.java   Source Code and License 4 votes vote down vote up
@NotNull
@Override
public TokenSet getCommentTokens() {
    return COMMENTS;
}
 
Example 38
Project: TS-IJ   File: TSParserDefinition.java   Source Code and License 4 votes vote down vote up
@NotNull
@Override
public TokenSet getStringLiteralElements() {
    return STRINGS;
}
 
Example 39
Project: AppleScript-IDEA   File: AppleScriptParserDefinition.java   Source Code and License 4 votes vote down vote up
@NotNull
public TokenSet getWhitespaceTokens() {
  return WHITE_SPACES;
}
 
Example 40
Project: AppleScript-IDEA   File: AppleScriptParserDefinition.java   Source Code and License 4 votes vote down vote up
@NotNull
public TokenSet getCommentTokens() {
  return COMMENTS;
}