Changeset 31432 for lang

Show
Ignore:
Timestamp:
03/21/09 23:07:19 (5 years ago)
Author:
hoge1e3
Message:

ref #134 文字列の包含関係を superstring.txt に格納

Location:
lang/csharp/soyText/soyText
Files:
2 added
1 removed
5 modified

Legend:

Unmodified
Added
Removed
  • lang/csharp/soyText/soyText/Indexer.cs

    r31425 r31432  
    2323            } 
    2424        } 
    25         public static String token2PathPart(String token) 
     25       /* public static String token2PathPart(String token) 
    2626        { 
    2727            if (token.Length == 0) return "/empty.txt"; 
     
    5252        { 
    5353            return indexPath+token2PathPart(token)+"/document.txt"; 
     54        }*/ 
     55        public Token createToken(String t) 
     56        { 
     57            return new Token(this, t); 
    5458        } 
    5559        public void make(Document d) 
     
    6165            { 
    6266                if (str[0] < ' ') return; 
    63                 var f = (strs.ContainsKey(str)? strs[str]:null); 
     67                var tk = createToken(str); 
     68                var path = tk.documentPath; 
     69                var f = (strs.ContainsKey(path) ? strs[path] : null); 
    6470                if (f == null) 
    6571                { 
    66                     f = new StreamWriter(Mkdir.openStream(path(str), true)); 
    67                     strs[str] = f; 
     72                    Inclusion.process(tk); 
     73                    f = new StreamWriter(Mkdir.openStream(tk.documentPath , true)); 
     74                    strs[path] = f; 
    6875                    f.Write("\n" + h); 
    6976                } 
  • lang/csharp/soyText/soyText/Mkdir.cs

    r31425 r31432  
    1212            return openStream(fileName, false); 
    1313        } 
    14         public static FileStream openStream(String fileName, Boolean append) 
     14        public static FileStream openStream(String fileName, bool append) 
    1515        { 
    1616            Directory.CreateDirectory(Path.GetDirectoryName(fileName)); 
     
    2626            return Directory.GetFiles(dirName); 
    2727        } 
    28         public static StreamWriter openTextoutStream(String fileName) { 
    29             return new StreamWriter(openStream(fileName)); 
    30  
     28        public static StreamWriter openTextoutStream(String fileName) 
     29        { 
     30            return openTextoutStream(fileName, true); 
     31        } 
     32        public static StreamWriter openTextoutStream(String fileName,bool append) { 
     33            return new StreamWriter(openStream(fileName,append)); 
    3134        } 
    3235    } 
  • lang/csharp/soyText/soyText/soyText.csproj

    r31425 r31432  
    8787      <DesignTimeSharedInput>True</DesignTimeSharedInput> 
    8888    </Compile> 
     89    <Compile Include="Inclusion.cs" /> 
    8990    <Compile Include="TimeFormat.cs" /> 
     91    <Compile Include="Token.cs" /> 
    9092    <Compile Include="Tokenizer.cs" /> 
    9193    <Compile Include="Workspace.cs" />