public override void Visit(SliceExpr expr) { if (expr.Target == null) { _needsAsync = true; } }
private Expr ParseIndexExpr(Expr prev) { var openBracket = Match("["); var next = GetToken(); Expr projectionFilter = null; if (next.Kind == "STRING" && GetToken(1).Kind == "]") { Match("STRING"); Match("]"); projectionFilter = new KeyExpr(GetLocation(next), prev, next.Text); } else if (next.Kind == "..") { Match(".."); next = GetToken(); if (next.Kind == "]") { Match("]"); projectionFilter = new SliceExpr(GetLocation(openBracket), prev, null, null); } else { var upperBound = ParseExpr(); projectionFilter = new SliceExpr(GetLocation(openBracket), prev, null, upperBound); } } else { var filter = ParseExpr(); next = GetToken(); if (next.Kind == "..") { Expr upperBound = null; Match(".."); next = GetToken(); if (next.Kind != "]") { upperBound = ParseExpr(); } Match("]"); projectionFilter = new SliceExpr(GetLocation(openBracket), prev, filter, upperBound); } else { Match("]"); projectionFilter = new IndexExpr(GetLocation(openBracket), prev, filter); } } return(projectionFilter); }
public virtual void Visit(SliceExpr expr) { }