validate method

bool validate(
  1. ComputeContext ctx,
  2. Token<TokenType>? previousToken,
  3. String rawBuildingToken,
  4. Token<TokenType>? nextToken,
)

Signals the caller if the token type is compatible with the next and previous tokens.

Implementation

bool validate(ComputeContext ctx, Token? previousToken,
    String rawBuildingToken, Token? nextToken) {
  return validatePrevious(ctx, rawBuildingToken, previousToken) &&
      validateNext(ctx, rawBuildingToken, nextToken);
}