sync with peg

- Parse now returns an `error'
- leg parser generator writes to stdout now, doesn't
  create a file xy.leg.go anymore
- turn on new optimizations
This commit is contained in:
Michael Teichgräber 2012-04-24 00:15:47 +02:00
parent 0cbfa7b920
commit 0248d52f7e
4 changed files with 7716 additions and 8801 deletions

View File

@ -30,7 +30,7 @@ nuke:
ifeq ($(MAKECMDGOALS),parser)
include $(shell go list -f '{{.Dir}}' github.com/knieriem/peg)/Make.inc
%.leg.go: %.leg $(LEG)
$(LEG) -switch $<
$(LEG) -verbose -switch -O all $< > $@
endif

View File

@ -60,8 +60,8 @@ func (d *Doc) parseRule(rule int, s string) {
if m.ResetBuffer(s) != "" {
log.Fatalf("Buffer not empty")
}
if !m.Parse(rule) {
m.PrintError()
if err := m.Parse(rule); err != nil {
log.Fatalln("markdown:", err)
}
}

View File

@ -106,8 +106,6 @@ type Doc struct {
%YYSTYPE *element
%switchexcl(HtmlBlock Code Title RefTitle)
Doc = a:StartList ( Block { a = cons($$, a) } )*
{ p.tree = reverse(a) }
commit

File diff suppressed because it is too large Load Diff