Package dtool.parser.common.LexerResult

Examples of dtool.parser.common.LexerResult.TokenAtOffsetResult


 
  protected void testFindTokenAtOffset(String source, int offset, Token expectedLeft, Token expectedRight) {
    LexerResult lexerResult = new LexerResult(source,
      new LexElementProducer().produceLexTokens(new DeeLexer(source)));
   
    TokenAtOffsetResult tokenAtOffsetResult = lexerResult.findTokenAtOffset(offset);
    if(expectedLeft == expectedRight) {
      assertTrue(tokenAtOffsetResult.atLeft == tokenAtOffsetResult.atRight);
    }
   
    checkToken(tokenAtOffsetResult.atLeft, expectedLeft);
View Full Code Here


  public static CompletionSearchResult completionSearch(DeeParserResult parseResult, int offset,
      IModuleResolver mr) {
   
    assertTrue(isInRange(0, offset, parseResult.source.length()));
   
    TokenAtOffsetResult tokenAtOffsetResult = parseResult.findTokenAtOffset(offset);
    IToken tokenAtOffsetLeft = tokenAtOffsetResult.atLeft;
    IToken tokenAtOffsetRight = tokenAtOffsetResult.atRight;
   
    if(tokenAtOffsetResult.isSingleToken()
      && isInsideRange(tokenAtOffsetLeft.getStartPos(), offset, tokenAtOffsetLeft.getEndPos())
      && canCompleteInsideToken(tokenAtOffsetLeft)
    ) {
      return new CompletionSearchResult(ECompletionResultStatus.INVALID_TOKEN_LOCATION);
    }
View Full Code Here

TOP

Related Classes of dtool.parser.common.LexerResult.TokenAtOffsetResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.