home: hub: minipeg

Download patch

ref: 7c4282f079e0b8b2f7c25c2a46256878d841c6f9
parent: fd42edfe6fc500c76edbb047c6b3cd86d000c576
author: Gregory Pakosz <gregory.pakosz@gmail.com>
date: Wed Sep 12 19:00:00 CDT 2007

imported peg-0.1.3

--- a/README.md
+++ b/README.md
@@ -26,6 +26,10 @@
 
 ## Version history
 
+* **0.1.3** ([zip](peg/zipball/0.1.3), [tar.gz](peg/tarball/0.1.3)) &mdash; 2007-09-13  
+Allow matched braces inside `leg` actions.  
+Handle empty rules.  
+Handle empty grammars.  
 * **0.1.2** ([zip](peg/zipball/0.1.2), [tar.gz](peg/tarball/0.1.2)) &mdash; 2007-08-31  
 Grow buffers while (not if) they are too small.  
 Remove dependencies on grammar files.  
--- a/leg.c
+++ b/leg.c
@@ -1,4 +1,4 @@
-/* A recursive-descent parser generated by peg 0.1.0 */
+/* A recursive-descent parser generated by peg 0.1.1 */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -1048,7 +1048,8 @@
   for (; headers;  headers= headers->next)
     fprintf(output, "%s\n", headers->text);
 
-  Rule_compile_c(rules);
+  if (rules)
+    Rule_compile_c(rules);
 
   if (trailer)
     fprintf(output, "%s\n", trailer);
--- a/leg.leg
+++ b/leg.leg
@@ -15,7 +15,7 @@
 # 
 # THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
 # 
-# Last edited: 2007-05-15 10:34:05 by piumarta on emilia
+# Last edited: 2007-09-12 00:22:41 by piumarta on emilia.local
 
 %{
 # include "tree.h"
@@ -279,7 +279,8 @@
   for (; headers;  headers= headers->next)
     fprintf(output, "%s\n", headers->text);
 
-  Rule_compile_c(rules);
+  if (rules)
+    Rule_compile_c(rules);
 
   if (trailer)
     fprintf(output, "%s\n", trailer);
--- a/peg.c
+++ b/peg.c
@@ -13,7 +13,7 @@
  * 
  * THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
  * 
- * Last edited: 2007-05-15 10:34:42 by piumarta on emilia
+ * Last edited: 2007-09-12 00:27:30 by piumarta on vps2.piumarta.com
  */
 
 #include "tree.h"
@@ -167,7 +167,7 @@
       Rule_print(n);
 
   Rule_compile_c_header();
-  Rule_compile_c(rules);
+  if (rules) Rule_compile_c(rules);
 
   return 0;
 }