mirror of
https://github.com/Cekis/SWG-ScriptConverter.git
synced 2026-09-11 22:44:59 -04:00
21 lines
554 B
C#
21 lines
554 B
C#
using ScriptConverter.Ast.Expressions;
|
|
|
|
namespace ScriptConverter.Parser.Parselets.Expressions
|
|
{
|
|
class PrefixOperatorParselet : IPrefixParselet
|
|
{
|
|
private readonly int _precedence;
|
|
|
|
public PrefixOperatorParselet(PrecedenceValue precedence)
|
|
{
|
|
_precedence = (int)precedence;
|
|
}
|
|
|
|
public Expression Parse(ScriptParser parser, ScriptToken token)
|
|
{
|
|
var right = parser.ParseExpression(_precedence);
|
|
return new PrefixOperatorExpression(token, right);
|
|
}
|
|
}
|
|
}
|