Comment detail

α置換 (Nested Flatten)

This comment is reply for 6157 syat: Cのソースを変換します。 1文字ずつ結...(α置換). Go to thread root.

文字列の処理がうまくいってませんでした。。。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
--- alpha.cs.release1   2008-04-09 01:11:32.000000000 +0900
+++ alpha.cs.release2   2008-04-09 01:14:15.000000000 +0900
@@ -65,13 +65,12 @@
       
       switch (st) {
       case State.InStr:  //文字列リテラルの中
+        buf.Append(c);
         if (c == '\\') {
-          buf.Append(c);
           if (++pos < strIn.Length) {
             buf.Append(strIn[pos]);
           }
         } else if (c == '"') {
-          buf.Append(c);
           this.state.Pop();
         }
         break;

Index

Feed

Other

Link

Pathtraq

loading...