Add tokens to startTokensExpression
This commit is contained in:
parent
a14df2bfbb
commit
a80b6ad74e
|
@ -5,7 +5,12 @@ import "git.tebibyte.media/sashakoshka/fspl/entity"
|
|||
|
||||
var descriptionExpression = "Expression"
|
||||
var startTokensExpression = []lexer.TokenKind {
|
||||
// TODO
|
||||
lexer.Ident,
|
||||
lexer.LBracket,
|
||||
lexer.LParen,
|
||||
lexer.Int,
|
||||
lexer.Float,
|
||||
lexer.String,
|
||||
}
|
||||
|
||||
func (this *Parser) parseExpression () (entity.Expression, error) {
|
||||
|
@ -20,6 +25,10 @@ func (this *Parser) parseExpression () (entity.Expression, error) {
|
|||
// 4. Repeat from step 2 if needed.
|
||||
// 5. Return the expression, whether it was directly parsed or is a tree
|
||||
// of infix operator(s).
|
||||
err := this.expectDescription (
|
||||
descriptionExpression,
|
||||
startTokensDescription...)
|
||||
if err != nil { return nil, err }
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue