Archive for February 2010
For each line, the scanner accepts, in place of the first operator, any of the remaining operators, and outputs a token whose string (set in $GOROOT/src/go/token/token.go) is the first operator.
== =? ≟
To install, copy $GOROOT/src/pkg/go/scanner/scanner.go to another file.
Replace scanner.go with scanner.go
Run $GOROOT/src/all.bash and check for 0 unexpected errors.
Changes to scanner.go update gofmt, which accepts UTF-8 operators and outputs their ASCII equivalents. This mkfile production rule uses gofmt as a preprocessor to create a sharable and compilable file.
cat $stem.ℊℴ | gofmt > $stem.go
See these files for an example of each new operator form in the context of a simple Go program.
Please mail me privately if something doesn’t work with this code, to avoid noise on the golang-nuts list, since we’re no longer discussing officially-released code.