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)
|
ifeq ($(MAKECMDGOALS),parser)
|
||||||
include $(shell go list -f '{{.Dir}}' github.com/knieriem/peg)/Make.inc
|
include $(shell go list -f '{{.Dir}}' github.com/knieriem/peg)/Make.inc
|
||||||
%.leg.go: %.leg $(LEG)
|
%.leg.go: %.leg $(LEG)
|
||||||
$(LEG) -switch $<
|
$(LEG) -verbose -switch -O all $< > $@
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ func (d *Doc) parseRule(rule int, s string) {
|
|||||||
if m.ResetBuffer(s) != "" {
|
if m.ResetBuffer(s) != "" {
|
||||||
log.Fatalf("Buffer not empty")
|
log.Fatalf("Buffer not empty")
|
||||||
}
|
}
|
||||||
if !m.Parse(rule) {
|
if err := m.Parse(rule); err != nil {
|
||||||
m.PrintError()
|
log.Fatalln("markdown:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,8 +106,6 @@ type Doc struct {
|
|||||||
|
|
||||||
%YYSTYPE *element
|
%YYSTYPE *element
|
||||||
|
|
||||||
%switchexcl(HtmlBlock Code Title RefTitle)
|
|
||||||
|
|
||||||
Doc = a:StartList ( Block { a = cons($$, a) } )*
|
Doc = a:StartList ( Block { a = cons($$, a) } )*
|
||||||
{ p.tree = reverse(a) }
|
{ p.tree = reverse(a) }
|
||||||
commit
|
commit
|
||||||
|
15229
parser.leg.go
15229
parser.leg.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user