parseFunctionDeclaration method

Statement parseFunctionDeclaration()

Implementation

Statement parseFunctionDeclaration() {
  int start = token?.startOffset??0;
  int line = token?.line??0;
  assert(token?.text == 'function');
  FunctionNode func = parseFunction();
  if (func.name == null) {
    fail(message: 'Function declaration must have a name');
  }
  return new FunctionDeclaration(func)
    ..start = start
    ..end = endOffset
    ..line = line;
}