home: hub: minipeg

Download patch

ref: fd42edfe6fc500c76edbb047c6b3cd86d000c576
parent: df19b6dc50e821ae5f7ff96961d866bcff61839e
author: Gregory Pakosz <gregory.pakosz@gmail.com>
date: Thu Aug 30 19:00:00 CDT 2007

imported peg-0.1.2

--- a/README.md
+++ b/README.md
@@ -26,5 +26,9 @@
 
 ## Version history
 
+* **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.  
+Add more basic examples.  
 * **0.1.1** ([zip](peg/zipball/0.1.1), [tar.gz](peg/tarball/0.1.1)) &mdash; 2007-05-15  
 First public release.
--- a/compile.c
+++ b/compile.c
@@ -13,7 +13,7 @@
  * 
  * THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
  * 
- * Last edited: 2007-05-15 10:31:16 by piumarta on emilia
+ * Last edited: 2007-08-31 13:55:23 by piumarta on emilia.local
  */
 
 #include <stdio.h>
@@ -387,7 +387,7 @@
 YY_LOCAL(int) yyrefill(void)\n\
 {\n\
   int yyn;\n\
-  if (yybuflen - yypos < 512)\n\
+  while (yybuflen - yypos < 512)\n\
     {\n\
       yybuflen *= 2;\n\
       yybuf= realloc(yybuf, yybuflen);\n\
@@ -452,7 +452,7 @@
 \n\
 YY_LOCAL(void) yyDo(yyaction action, int begin, int end)\n\
 {\n\
-  if (yythunkpos >= yythunkslen)\n\
+  while (yythunkpos >= yythunkslen)\n\
     {\n\
       yythunkslen *= 2;\n\
       yythunks= realloc(yythunks, sizeof(yythunk) * yythunkslen);\n\
@@ -470,7 +470,7 @@
     yyleng= 0;\n\
   else\n\
     {\n\
-      if (yytextlen < (yyleng - 1))\n\
+      while (yytextlen < (yyleng - 1))\n\
 	{\n\
 	  yytextlen *= 2;\n\
 	  yytext= realloc(yytext, yytextlen);\n\
--- a/leg.c
+++ b/leg.c
@@ -115,7 +115,7 @@
 YY_LOCAL(int) yyrefill(void)
 {
   int yyn;
-  if (yybuflen - yypos < 512)
+  while (yybuflen - yypos < 512)
     {
       yybuflen *= 2;
       yybuf= realloc(yybuf, yybuflen);
@@ -180,7 +180,7 @@
 
 YY_LOCAL(void) yyDo(yyaction action, int begin, int end)
 {
-  if (yythunkpos >= yythunkslen)
+  while (yythunkpos >= yythunkslen)
     {
       yythunkslen *= 2;
       yythunks= realloc(yythunks, sizeof(yythunk) * yythunkslen);
@@ -198,7 +198,7 @@
     yyleng= 0;
   else
     {
-      if (yytextlen < (yyleng - 1))
+      while (yytextlen < (yyleng - 1))
 	{
 	  yytextlen *= 2;
 	  yytext= realloc(yytext, yytextlen);
--- a/version.h
+++ b/version.h
@@ -1,3 +1,3 @@
 #define PEG_MAJOR	0
 #define PEG_MINOR	1
-#define PEG_LEVEL	1
+#define PEG_LEVEL	2