handlePrecedings method

bool handlePrecedings()

To handle the comments & empty lines before a expr;

Implementation

bool handlePrecedings() {
  bool handled = false;
  while (curTok is TokenComment || curTok is TokenEmptyLine) {
    handled = true;
    ASTAnnotation documentation;
    if (curTok is TokenComment) {
      documentation = ASTComment.fromCommentToken(advance() as TokenComment);
    } else {
      final token = advance();
      documentation = ASTEmptyLine(
        source: currentSource,
        line: token.line,
        column: token.column,
        offset: token.offset,
        length: token.length,
      );
    }
    currentPrecedings.add(documentation);
  }
  return handled;
}