예제 #1
0
        static Document Load(string path)
        {
            Document document;

            if (_astCache.TryGetValue(path, out document))
            {
                return(document);
            }

            var fullPath = Path.Combine(_basePath, path);
            var source   = File.ReadAllText(fullPath);

            var lexer  = new ScriptLexer(source, Path.GetFileName(path));
            var parser = new ScriptParser(Preprocessor(lexer, "DEBUG"));

            document = parser.ParseAll();
            //_astCache.Add(path, document);

            return(document);
        }