public Expression Serialize(LexicalInfo location) { if (_preserveLexicalInfo && location.IsValid) { return(SerializeLexicalInfo(location)); } return(CreateReference(location, location.GetType().FullName + ".Empty")); }
private Expression SerializeLexicalInfo(LexicalInfo location) { var ctorInvocation = CreateInvocation(location, location.GetType().FullName); ctorInvocation.Arguments.Add(Serialize(location.FileName)); ctorInvocation.Arguments.Add(Serialize(location.Line)); ctorInvocation.Arguments.Add(Serialize(location.Column)); return(ctorInvocation); }