parseProgram method

Program parseProgram()

Implementation

Program parseProgram() {
  int? start = token!.startOffset;
  int? line = token!.line;
  List<Statement> statements = <Statement>[];
  while (token!.type != Token.EOF) {
    statements.add(parseStatement());
  }
  endOffset ??= start;
  return Program(statements)
    ..start = start
    ..end = endOffset
    ..line = line;
}