コード例 #1
0
        public static List <LabeledInclude> parseLabeledIncludes(IIncludePathContext context, BuildObject beatsrc)
        {
            //-Logger.WriteLine("parseLabeledIncludes " + beatsrc.getRelativePath() + " context " + context.GetHashCode());

            List <LabeledInclude> outlist = new List <LabeledInclude>();
            //-Regex re = new Regex("^\\s*import\\s*([^\\s,]*(,\\s*[^\\s,]*)*)\\s*;");
            //- TODO allow commented-out imports until Beat accepts (ignores) them in ifcs files.
            Regex            import_re   = new Regex("^[\\s/-]*private-import\\s*([^\\s,]*(,\\s*[^\\s,]*)*)\\s*;");
            Regex            basmonly_re = new Regex("^[\\s/-]*private-basmonly-import\\s*([^\\s,]*(,\\s*[^\\s,]*)*)\\s*;");
            FetchModuleCache fmcache     = fetchModuleCaches.get(context);

            using (TextReader tr = BuildEngine.theEngine.getNuObjContents().openRead(beatsrc))
            {
                while (true)
                {
                    string line = tr.ReadLine();
                    if (line == null)
                    {
                        break;
                    }
                    Match match = import_re.Match(line);
                    if (match.Success)
                    {
                        outlist.Add(new LabeledInclude(ImportFilter.ForBeatOrBasm, fmcache.get(match.Groups[1].ToString())));
                    }
                    match = basmonly_re.Match(line);
                    if (match.Success)
                    {
                        outlist.Add(new LabeledInclude(ImportFilter.ForBasmOnly, fmcache.get(match.Groups[1].ToString())));
                    }
                }
                //-Logger.WriteLine(String.Format("{0} includes {1} things", dfysource.getFilesystemPath(), outlist.Count));
                return(outlist);
            }
        }
コード例 #2
0
 public BuildObject get(string module)
 {
     return(cache.get(module));
 }
コード例 #3
0
 public BuildObject search(IIncludePathContext context, string modName, ModPart modPart)
 {
     return(_contextResolutionCache.get(new Tuple <IIncludePathContext, string, ModPart>(context, modName, modPart)));
 }
コード例 #4
0
 public List <BeatIncludes.LabeledInclude> getParsedIncludes(IIncludePathContext context, BuildObject beatsrc)
 {
     return(_parsedIncludesCache.get(new Tuple <IIncludePathContext, BuildObject>(context, beatsrc)));
 }
コード例 #5
0
 public string hash(string filesystemPath)
 {
     return(_marshalledFilesystemPaths.get(filesystemPath));
 }