Skip to content

Instantly share code, notes, and snippets.

@knieriem
knieriem / peg.go.patch
Created March 25, 2011 10:31
fix compilation of peg.go Compilation failed with error(s): <label> defined and not used due to a recent change to the Go compilers: http://code.google.com/p/go/source/detail?r=570c3ce8 This temporary fix introduces bookkeeping about labels being
diff --git a/peg.go b/peg.go
--- a/peg.go
+++ b/peg.go
@@ -1135,7 +1135,7 @@
}
var printRule func(node Node)
- var compile func(expression Node, ko uint)
+ var compile func(expression Node, ko uint) (usedko bool)
var label uint
@knieriem
knieriem / gist:723666
Created December 1, 2010 15:49
avoid panic'ing in `used but not defined' cases
diff --git a/peg.go b/peg.go
--- a/peg.go
+++ b/peg.go
@@ -36,6 +36,7 @@
TypeStar
TypePlus
TypePeg
+ TypeNil
TypeLast
)