1.1 --- a/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Thu Nov 27 20:23:35 2014 +0100
1.2 +++ b/rt/vm/src/main/java/org/apidesign/vm4brwsr/VM.java Sun Nov 30 16:21:27 2014 +0100
1.3 @@ -263,7 +263,9 @@
1.4 if (emul == null) {
1.5 throw new IOException("Can't find " + resource);
1.6 }
1.7 + append("\n// resource from ").append(resource).append("\n");
1.8 readResource(emul, this);
1.9 + append("\n");
1.10 }
1.11
1.12 private static void readResource(InputStream emul, Appendable out) throws IOException {
1.13 @@ -277,35 +279,7 @@
1.14 if (ch < 0 || ch > 255) {
1.15 throw new IOException("Invalid char in emulation " + ch);
1.16 }
1.17 - switch (state) {
1.18 - case 0:
1.19 - if (ch == '/') {
1.20 - state = 1;
1.21 - } else {
1.22 - out.append((char)ch);
1.23 - }
1.24 - break;
1.25 - case 1:
1.26 - if (ch == '*') {
1.27 - state = 2;
1.28 - } else {
1.29 - out.append('/').append((char)ch);
1.30 - state = 0;
1.31 - }
1.32 - break;
1.33 - case 2:
1.34 - if (ch == '*') {
1.35 - state = 3;
1.36 - }
1.37 - break;
1.38 - case 3:
1.39 - if (ch == '/') {
1.40 - state = 0;
1.41 - } else {
1.42 - state = 2;
1.43 - }
1.44 - break;
1.45 - }
1.46 + out.append((char)ch);
1.47 }
1.48 } finally {
1.49 emul.close();