Beispiel #1
0
        public override AuthoringScope ParseSource(ParseRequest req)
        {
            if (null == req)
            {
                throw new ArgumentNullException("req");
            }
            Debug.Print("ParseSource at ({0}:{1}), reason {2}", req.Line, req.Col, req.Reason);
            PythonSource source = null;

            if (specialSources.TryGetValue(req.View, out source) && (null != source.ScopeCreator))
            {
                return(source.ScopeCreator(req));
            }
            PythonSink sink = new PythonSink(req.Sink);

            return(new PythonScope(modules.AnalyzeModule(sink, req.FileName, req.Text), this));
        }
 public override AuthoringScope ParseSource(ParseRequest req)
 {
     if (null == req) {
         throw new ArgumentNullException("req");
     }
     Debug.Print("ParseSource at ({0}:{1}), reason {2}", req.Line, req.Col, req.Reason);
     PythonSource source = null;
     if (specialSources.TryGetValue(req.View, out source) && (null != source.ScopeCreator)) {
         return source.ScopeCreator(req);
     }
     PythonSink sink = new PythonSink(req.Sink);
     return new PythonScope(modules.AnalyzeModule(sink, req.FileName, req.Text), this);
 }