class Sass::Script::Parser

def defn_arglist!(must_have_parens)

def defn_arglist!(must_have_parens)
  if must_have_parens
    assert_tok(:lparen)
  else
    return [] unless try_tok(:lparen)
  end
  return [] if try_tok(:rparen)
  res = []
  must_have_default = false
  loop do
    line = @lexer.line
    offset = @lexer.offset + 1
    c = assert_tok(:const)
    var = Script::Variable.new(c.value)
    if tok = try_tok(:colon)
      val = assert_expr(:space)
      must_have_default = true
    elsif must_have_default
      raise SyntaxError.new("Required argument #{var.inspect} must come before any optional arguments.")
    end
    res << [var, val]
    break unless try_tok(:comma)
  end
  assert_tok(:rparen)
  res
end