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:
parent
0cbfa7b920
commit
0248d52f7e
2
Makefile
2
Makefile
@ -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
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
16509
parser.leg.go
16509
parser.leg.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user