mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Rename PUFFS to WUFFS, part 2 of N
This commit is contained in:
1 parent
c4fbf8732e
commit
0cea46531b
29 files changed
+69
-69
No files matched your search
@@ -64,7 +64,7 @@ index f878c5e..f10dcee 100644
|
|||||||
```bash
|
```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/wuffs/std/gif/decode_lzw.puffs:101. Facts:
|
||||||
n_bits < 8
|
n_bits < 8
|
||||||
c < 256
|
c < 256
|
||||||
this.stack[s] == (c as u8)
|
this.stack[s] == (c as u8)
|
||||||
@@ -93,12 +93,12 @@ index f878c5e..b43443d 100644
|
|||||||
|
|
||||||
```bash
|
```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/wuffs/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/wuffs/gen/h/gif.h
|
||||||
$ puffs test std/gif
|
$ puffs test std/gif
|
||||||
gen unchanged: /home/n/go/src/github.com/google/puffs/gen/c/gif.c
|
gen unchanged: /home/n/go/src/github.com/google/wuffs/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/wuffs/gen/h/gif.h
|
||||||
test: /home/n/go/src/github.com/google/puffs/test/c/gif
|
test: /home/n/go/src/github.com/google/wuffs/test/c/gif
|
||||||
gif/basic.c clang PASS (8 tests run)
|
gif/basic.c clang PASS (8 tests run)
|
||||||
gif/basic.c gcc PASS (8 tests run)
|
gif/basic.c gcc PASS (8 tests run)
|
||||||
gif/gif.c clang FAIL test_lzw_decode: bufs1_equal: wi: got 19311, want 19200.
|
gif/gif.c clang FAIL test_lzw_decode: bufs1_equal: wi: got 19311, want 19200.
|
||||||
@@ -220,7 +220,7 @@ might also have to install C compilers like clang and gcc, as well as C
|
|||||||
libraries (and their .h files) like libjpeg and libpng, as some tests compare
|
libraries (and their .h files) like libjpeg and libpng, as some tests compare
|
||||||
that Puffs produces exactly the same output as these other libraries.
|
that Puffs produces exactly the same output as these other libraries.
|
||||||
|
|
||||||
Running `go get -v github.com/google/puffs/cmd/...` will download and install
|
Running `go get -v github.com/google/wuffs/cmd/...` will download and install
|
||||||
the Puffs tools. Change `get` to `install` to re-install those programs without
|
the Puffs tools. Change `get` to `install` to re-install those programs without
|
||||||
downloading, e.g. after you've modified their source code, or after a manually
|
downloading, e.g. after you've modified their source code, or after a manually
|
||||||
issued `git pull`. The Puffs tools that you'll most often use are `puffsfmt`
|
issued `git pull`. The Puffs tools that you'll most often use are `puffsfmt`
|
||||||
@@ -262,8 +262,8 @@ you think it should be able to.
|
|||||||
## Running the Tests
|
## Running the Tests
|
||||||
|
|
||||||
If you've changed any of the tools (i.e. changed any `.go` code), re-run `go
|
If you've changed any of the tools (i.e. changed any `.go` code), re-run `go
|
||||||
install -v github.com/google/puffs/cmd/...` and `go test
|
install -v github.com/google/wuffs/cmd/...` and `go test
|
||||||
github.com/google/puffs/lang/...`.
|
github.com/google/wuffs/lang/...`.
|
||||||
|
|
||||||
If you've changed any of the libraries (i.e. changed any `.puffs` code), run
|
If you've changed any of the libraries (i.e. changed any `.puffs` code), run
|
||||||
`puffs test` or, ideally, `puffs test -mimic` to also check that Puffs' output
|
`puffs test` or, ideally, `puffs test -mimic` to also check that Puffs' output
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cf "github.com/google/puffs/cmd/commonflags"
|
cf "github.com/google/wuffs/cmd/commonflags"
|
||||||
)
|
)
|
||||||
|
|
||||||
func doGenlib(args []string) error {
|
func doGenlib(args []string) error {
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/base38"
|
"github.com/google/wuffs/lang/base38"
|
||||||
"github.com/google/puffs/lang/builtin"
|
"github.com/google/wuffs/lang/builtin"
|
||||||
"github.com/google/puffs/lang/check"
|
"github.com/google/wuffs/lang/check"
|
||||||
"github.com/google/puffs/lang/generate"
|
"github.com/google/wuffs/lang/generate"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -18,10 +18,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/builtin"
|
"github.com/google/wuffs/lang/builtin"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (g *gen) writeExpr(b *buffer, n *a.Expr, rp replacementPolicy, pp parenthesesPolicy, depth uint32) error {
|
func (g *gen) writeExpr(b *buffer, n *a.Expr, rp replacementPolicy, pp parenthesesPolicy, depth uint32) error {
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type funk struct {
|
type funk struct {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// genFilenameLineComments is whether to print "// foo.puffs:123\n" comments in
|
// genFilenameLineComments is whether to print "// foo.puffs:123\n" comments in
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errNeedDerivedVar = errors.New("internal: need derived var")
|
var errNeedDerivedVar = errors.New("internal: need derived var")
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"github.com/google/puffs/cmd/puffs-c/internal/cgen"
|
"github.com/google/wuffs/cmd/puffs-c/internal/cgen"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cf "github.com/google/puffs/cmd/commonflags"
|
cf "github.com/google/wuffs/cmd/commonflags"
|
||||||
)
|
)
|
||||||
|
|
||||||
func doBench(args []string) error { return doBenchTest(args, true) }
|
func doBench(args []string) error { return doBenchTest(args, true) }
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
cf "github.com/google/puffs/cmd/commonflags"
|
cf "github.com/google/wuffs/cmd/commonflags"
|
||||||
)
|
)
|
||||||
|
|
||||||
func doBench(puffsRoot string, args []string) error { return doBenchTest(puffsRoot, args, true) }
|
func doBench(puffsRoot string, args []string) error { return doBenchTest(puffsRoot, args, true) }
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/parse"
|
"github.com/google/wuffs/lang/parse"
|
||||||
"github.com/google/puffs/lang/render"
|
"github.com/google/wuffs/lang/render"
|
||||||
"github.com/google/puffs/lang/token"
|
"github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ bcheckOptimizeXxx methods."
|
|||||||
The benchmark programs aim to be runnable "out of the box" without any
|
The benchmark programs aim to be runnable "out of the box" without any
|
||||||
configuration or installation. For example, to run the `std/flate` benchmarks:
|
configuration or installation. For example, to run the `std/flate` benchmarks:
|
||||||
|
|
||||||
git clone https://github.com/google/puffs.git
|
git clone https://github.com/google/wuffs.git
|
||||||
cd puffs/test/c/std
|
cd puffs/test/c/std
|
||||||
gcc -O3 flate.c
|
gcc -O3 flate.c
|
||||||
./a.out -bench
|
./a.out -bench
|
||||||
@@ -48,7 +48,7 @@ As mentioned above, individual benchmark programs can be run manually. However,
|
|||||||
the canonical way to run the benchmarks (across multiple compilers and multiple
|
the canonical way to run the benchmarks (across multiple compilers and multiple
|
||||||
packages like GIF and PNG) is to use the `puffs` command line tool, as it will
|
packages like GIF and PNG) is to use the `puffs` command line tool, as it will
|
||||||
also re-generate (transpile) the C code whenever you edit the \*.puffs code.
|
also re-generate (transpile) the C code whenever you edit the \*.puffs code.
|
||||||
Running `go install -v github.com/google/puffs/cmd/...` will install the Puffs
|
Running `go install -v github.com/google/wuffs/cmd/...` will install the Puffs
|
||||||
tools. After that, you can say
|
tools. After that, you can say
|
||||||
|
|
||||||
puffs bench
|
puffs bench
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ package ast
|
|||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Kind is what kind of node it is. For example, a top-level func or a numeric
|
// Kind is what kind of node it is. For example, a top-level func or a numeric
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Eq returns whether n and o are equal.
|
// Eq returns whether n and o are equal.
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TopologicalSortStructs(ns []*Struct) (sorted []*Struct, ok bool) {
|
func TopologicalSortStructs(ns []*Struct) (sorted []*Struct, ok bool) {
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
package ast
|
package ast
|
||||||
|
|
||||||
import (
|
import (
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// String returns a string form of n.
|
// String returns a string form of n.
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ package ast_test
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/parse"
|
"github.com/google/wuffs/lang/parse"
|
||||||
"github.com/google/puffs/lang/token"
|
"github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestString(t *testing.T) {
|
func TestString(t *testing.T) {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
package builtin
|
package builtin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Status struct {
|
type Status struct {
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// otherHandSide returns the operator and other hand side when n is an
|
// otherHandSide returns the operator and other hand side when n is an
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var numTypeBounds = [256][2]*big.Int{
|
var numTypeBounds = [256][2]*big.Int{
|
||||||
|
|||||||
+4
-4
@@ -21,11 +21,11 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/base38"
|
"github.com/google/wuffs/lang/base38"
|
||||||
"github.com/google/puffs/lang/builtin"
|
"github.com/google/wuffs/lang/builtin"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Error struct {
|
type Error struct {
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/ast"
|
"github.com/google/wuffs/lang/ast"
|
||||||
"github.com/google/puffs/lang/parse"
|
"github.com/google/wuffs/lang/parse"
|
||||||
"github.com/google/puffs/lang/render"
|
"github.com/google/wuffs/lang/render"
|
||||||
"github.com/google/puffs/lang/token"
|
"github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func compareToPuffsfmt(tm *token.Map, tokens []token.Token, comments []string, src string) error {
|
func compareToPuffsfmt(tm *token.Map, tokens []token.Token, comments []string, src string) error {
|
||||||
|
|||||||
+2
-2
@@ -17,8 +17,8 @@
|
|||||||
package check
|
package check
|
||||||
|
|
||||||
import (
|
import (
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reasons = [...]struct {
|
var reasons = [...]struct {
|
||||||
|
|||||||
+2
-2
@@ -326,8 +326,8 @@ const header = `// Code generated by running "go generate". DO NOT EDIT.
|
|||||||
package check
|
package check
|
||||||
|
|
||||||
import (
|
import (
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var reasons = [...]struct {
|
var reasons = [...]struct {
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
// splitReceiverMethodArgs returns the "receiver", "method" and "args" in the
|
// splitReceiverMethodArgs returns the "receiver", "method" and "args" in the
|
||||||
|
|||||||
+3
-3
@@ -18,10 +18,10 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/builtin"
|
"github.com/google/wuffs/lang/builtin"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (q *checker) tcheckVars(block []*a.Node) error {
|
func (q *checker) tcheckVars(block []*a.Node) error {
|
||||||
|
|||||||
@@ -21,10 +21,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/ast"
|
"github.com/google/wuffs/lang/ast"
|
||||||
"github.com/google/puffs/lang/check"
|
"github.com/google/wuffs/lang/check"
|
||||||
"github.com/google/puffs/lang/parse"
|
"github.com/google/wuffs/lang/parse"
|
||||||
"github.com/google/puffs/lang/token"
|
"github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Generator func(packageName string, tm *token.Map, c *check.Checker, files []*ast.File) ([]byte, error)
|
type Generator func(packageName string, tm *token.Map, c *check.Checker, files []*ast.File) ([]byte, error)
|
||||||
|
|||||||
+3
-3
@@ -19,10 +19,10 @@ package parse
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/base38"
|
"github.com/google/wuffs/lang/base38"
|
||||||
|
|
||||||
a "github.com/google/puffs/lang/ast"
|
a "github.com/google/wuffs/lang/ast"
|
||||||
t "github.com/google/puffs/lang/token"
|
t "github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Parse(tm *t.Map, filename string, src []t.Token) (*a.File, error) {
|
func Parse(tm *t.Map, filename string, src []t.Token) (*a.File, error) {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/google/puffs/lang/token"
|
"github.com/google/wuffs/lang/token"
|
||||||
)
|
)
|
||||||
|
|
||||||
var newLine = []byte{'\n'}
|
var newLine = []byte{'\n'}
|
||||||
|
|||||||
Reference in new issue
Block a user