icsharpcode/NRefactory — pull request #85 by erik-kallen (2012-07-24 14:32:49+00:00)
Title: Implemented QueryExpressionExpander.

Here is my implementation of the query expression transformation. It was a lot less work than getting the previous approach I tried to work, and I don't think the code ended up being too complicated. I think it returns enough information so it could be used in the ResolveVisitor to uncomplicate code there.

The only thing I am not sure about is my implementation of VisitIdentifierExpression. Is there any risk that inside in ```from i in arr select ```, the identifier ```i``` could resolve to anything except the range variable?

Also, the tests rely on parser bugs that report the wrong location for where and orderby statements, and will have to be patched when those bugs are addressed. Also, tests for nested ordering are coded to fail due to another parser bug that causes ThenBy to be reported as OrderBy.