From d5e7262b6258bf3ae8fbff8a34115988113a1ade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Wed, 29 Jun 2011 20:04:44 +0200 Subject: [PATCH] leg compiler: use switch optimization --- Makefile | 2 +- parser.leg | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6395f84..03ba9ac 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ VCS-PULLFLAGS = # LEG = ./peg/leg/leg %.leg.go: %.leg $(LEG) - $(LEG) $< + $(LEG) -switch $< $(LEG): if(! test -d peg); then make peg; fi diff --git a/parser.leg b/parser.leg index bd80bb4..cd513ac 100644 --- a/parser.leg +++ b/parser.leg @@ -105,6 +105,7 @@ type Doc struct { %YYSTYPE *element +%switchexcl(HtmlBlock Code Title RefTitle) Doc = a:StartList ( Block { a = cons($$, a) } )* { p.tree = reverse(a) }