|
|
@ -71,6 +71,11 @@ type Quote struct {
|
|
|
|
Value Quotation `parser:"'#' @@"`
|
|
|
|
Value Quotation `parser:"'#' @@"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type PropertyAccess struct {
|
|
|
|
|
|
|
|
Receiver IdentifierOrParenthesis `parser:"@@"`
|
|
|
|
|
|
|
|
Accesses []IdentifierOrParenthesis `parser:"('.' @@)*"`
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type Quotation interface{}
|
|
|
|
type Quotation interface{}
|
|
|
|
|
|
|
|
|
|
|
|
type ExpressionFactor interface{}
|
|
|
|
type ExpressionFactor interface{}
|
|
|
@ -81,6 +86,8 @@ type BinaryOperation struct {
|
|
|
|
Rhs Expression `parser:" @@ )?"`
|
|
|
|
Rhs Expression `parser:" @@ )?"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type IdentifierOrParenthesis interface{}
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
var (
|
|
|
|
scriptLexer = lexer.MustSimple([]lexer.SimpleRule{
|
|
|
|
scriptLexer = lexer.MustSimple([]lexer.SimpleRule{
|
|
|
|
{Name: "Comment", Pattern: `--[^\n]*\n?`},
|
|
|
|
{Name: "Comment", Pattern: `--[^\n]*\n?`},
|
|
|
@ -128,6 +135,10 @@ var (
|
|
|
|
&Identifier{},
|
|
|
|
&Identifier{},
|
|
|
|
&ParenthesizedExpression{},
|
|
|
|
&ParenthesizedExpression{},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
participle.Union[IdentifierOrParenthesis](
|
|
|
|
|
|
|
|
&Identifier{},
|
|
|
|
|
|
|
|
&ParenthesizedExpression{},
|
|
|
|
|
|
|
|
),
|
|
|
|
participle.UseLookahead(2),
|
|
|
|
participle.UseLookahead(2),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|