mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Beautify diffs in README
This commit is contained in:
1 parent
f604194ba4
commit
8d0852e051
1 file changed
+8
-3
@@ -42,7 +42,7 @@ For example, making this one-line edit to the GIF codec leads to a compile time
|
|||||||
error. `puffs gen` fails to generate the C code, i.e. fails to compile
|
error. `puffs gen` fails to generate the C code, i.e. fails to compile
|
||||||
(transpile) the Puffs code to C code:
|
(transpile) the Puffs code to C code:
|
||||||
|
|
||||||
$ git diff
|
```diff
|
||||||
diff --git a/std/gif/decode_lzw.puffs b/std/gif/decode_lzw.puffs
|
diff --git a/std/gif/decode_lzw.puffs b/std/gif/decode_lzw.puffs
|
||||||
index f878c5e..f10dcee 100644
|
index f878c5e..f10dcee 100644
|
||||||
--- a/std/gif/decode_lzw.puffs
|
--- a/std/gif/decode_lzw.puffs
|
||||||
@@ -55,7 +55,9 @@ error. `puffs gen` fails to generate the C code, i.e. fails to compile
|
|||||||
+ this.suffixes[save_code] = (c + 1) as u8
|
+ this.suffixes[save_code] = (c + 1) as u8
|
||||||
this.prefixes[save_code] = prev_code as u16
|
this.prefixes[save_code] = prev_code as u16
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
$ puffs gen std/gif
|
$ puffs gen std/gif
|
||||||
check: expression "(c + 1) as u8" bounds [1..256] is not within bounds [0..255] at
|
check: expression "(c + 1) as u8" bounds [1..256] is not within bounds [0..255] at
|
||||||
/home/n/go/src/github.com/google/puffs/std/gif/decode_lzw.puffs:101. Facts:
|
/home/n/go/src/github.com/google/puffs/std/gif/decode_lzw.puffs:101. Facts:
|
||||||
@@ -63,11 +65,12 @@ error. `puffs gen` fails to generate the C code, i.e. fails to compile
|
|||||||
c < 256
|
c < 256
|
||||||
this.stack[s] == (c as u8)
|
this.stack[s] == (c as u8)
|
||||||
use_save_code
|
use_save_code
|
||||||
|
```
|
||||||
|
|
||||||
In comparison, this two-line edit will compile (but the "does it decode GIF
|
In comparison, this two-line edit will compile (but the "does it decode GIF
|
||||||
correctly" tests then fail):
|
correctly" tests then fail):
|
||||||
|
|
||||||
$ git diff
|
```diff
|
||||||
diff --git a/std/gif/decode_lzw.puffs b/std/gif/decode_lzw.puffs
|
diff --git a/std/gif/decode_lzw.puffs b/std/gif/decode_lzw.puffs
|
||||||
index f878c5e..b43443d 100644
|
index f878c5e..b43443d 100644
|
||||||
--- a/std/gif/decode_lzw.puffs
|
--- a/std/gif/decode_lzw.puffs
|
||||||
@@ -82,7 +85,9 @@ correctly" tests then fail):
|
|||||||
+ this.suffixes[save_code] = (c + 1) as u8
|
+ this.suffixes[save_code] = (c + 1) as u8
|
||||||
this.prefixes[save_code] = prev_code as u16
|
this.prefixes[save_code] = prev_code as u16
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```bash
|
||||||
$ puffs gen std/gif
|
$ puffs gen std/gif
|
||||||
gen wrote: /home/n/go/src/github.com/google/puffs/gen/c/gif.c
|
gen wrote: /home/n/go/src/github.com/google/puffs/gen/c/gif.c
|
||||||
gen unchanged: /home/n/go/src/github.com/google/puffs/gen/h/gif.h
|
gen unchanged: /home/n/go/src/github.com/google/puffs/gen/h/gif.h
|
||||||
@@ -118,7 +123,7 @@ correctly" tests then fail):
|
|||||||
|
|
||||||
puffs-test-c: some tests failed
|
puffs-test-c: some tests failed
|
||||||
puffs test: some tests failed
|
puffs test: some tests failed
|
||||||
|
```
|
||||||
|
|
||||||
# Background
|
# Background
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user