scan static method

TokenIndex scan(
  1. String text
)

Implementation

static TokenIndex scan(String text) {
  final tokens = _tokenize(text);
  final identifiers = <IdentToken>[
    for (final t in tokens)
      if (t.isIdent) IdentToken(t.value, t.start, t.end),
  ];
  final declarations = _extractDeclarations(tokens);
  return TokenIndex._(identifiers, declarations);
}