scan method

  1. @override
bool scan(
  1. GrammarContext<KeywordMixin> context
)
override

Implementation

@override
bool scan(GrammarContext<KeywordMixin> context) {
  try {
    final keyword = context.scanKeyword(type);

    if (keyword != null) {
      context.syntax = (context.syntax as dynamic).rebuild(
        (builder) => builder.keyword = keyword,
      );

      return true;
    }
    return !isRequired;
  } catch (e) {
    rethrow;
  }
}