Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Worked on #65. Renamed 'parseExpressions' to 'parseArrayExprs', and u…
Browse files Browse the repository at this point in the history
…pdatd the comment to better represent the grammar.
  • Loading branch information
mjstahl committed May 30, 2013
1 parent 376bf46 commit 09d377f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/soma/parse/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ import (
func (p *Parser) parseArray() (a *ast.Array) {
p.expect(scan.LBRACK)

a = &ast.Array{Exprs: p.parseExpressions([]rt.Expr{})}
a = &ast.Array{Exprs: p.parseArrayExprs([]rt.Expr{})}

p.expect(scan.RBRACK)
return
}

// expressions :=
// [expr ('.' expressions)*]*
// '[' [expression [. expression]]* ']'
//
func (p *Parser) parseExpressions(exprs []rt.Expr) []rt.Expr {
func (p *Parser) parseArrayExprs(exprs []rt.Expr) []rt.Expr {
if p.tok != scan.RBRACK {
exprs = append(exprs, p.parseExpr())
}
Expand All @@ -46,7 +46,7 @@ func (p *Parser) parseExpressions(exprs []rt.Expr) []rt.Expr {
return exprs
case scan.PERIOD:
p.next()
exprs = p.parseExpressions(exprs)
exprs = p.parseArrayExprs(exprs)
default:
p.error(p.pos, "expected expression, '.', or ']', found '%s'", p.lit)
p.next()
Expand Down

0 comments on commit 09d377f

Please sign in to comment.