예제 #1
0
 public Expression Serialize(LexicalInfo location)
 {
     if (_preserveLexicalInfo && location.IsValid)
     {
         return(SerializeLexicalInfo(location));
     }
     return(CreateReference(location, location.GetType().FullName + ".Empty"));
 }
예제 #2
0
        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);
        }