home: hub: minipeg

Download patch

ref: 5031195edcfd6b0b5ef30d7830199c27801d5ba3
parent: 34754eec1c13e7bdd1f2c73dead72c8122bbe620
author: Gregory Pakosz <gregory.pakosz@gmail.com>
date: Thu Nov 24 18:00:00 CST 2011

imported peg-0.1.7

--- a/README.md
+++ b/README.md
@@ -26,6 +26,8 @@
 
 ## Version history
 
+* **0.1.7** ([zip](peg/zipball/0.1.7), [tar.gz](peg/tarball/0.1.7)) &mdash; 2011-11-25  
+Fix matching of 8-bit chars to allow utf-8 sequences in matching expressions (thanks to Grégory Pakosz).
 * **0.1.6** ([zip](peg/zipball/0.1.6), [tar.gz](peg/tarball/0.1.6)) &mdash; 2011-11-24  
 Allow octal escapes in character classes.
 * **0.1.5** ([zip](peg/zipball/0.1.5), [tar.gz](peg/tarball/0.1.5)) &mdash; 2011-11-24  
--- a/compile.c
+++ b/compile.c
@@ -13,7 +13,7 @@
  * 
  * THE SOFTWARE IS PROVIDED 'AS IS'.  USE ENTIRELY AT YOUR OWN RISK.
  * 
- * Last edited: 2011-11-24 10:10:20 by piumarta on emilia
+ * Last edited: 2011-11-25 11:16:57 by piumarta on emilia
  */
 
 #include <stdio.h>
@@ -440,7 +440,7 @@
 YY_LOCAL(int) yymatchChar(int c)\n\
 {\n\
   if (yypos >= yylimit && !yyrefill()) return 0;\n\
-  if (yybuf[yypos] == c)\n\
+  if ((unsigned char)yybuf[yypos] == c)\n\
     {\n\
       ++yypos;\n\
       yyprintf((stderr, \"  ok   yymatchChar(%c) @ %s\\n\", c, yybuf+yypos));\n\
@@ -471,7 +471,7 @@
 {\n\
   int c;\n\
   if (yypos >= yylimit && !yyrefill()) return 0;\n\
-  c= yybuf[yypos];\n\
+  c= (unsigned char)yybuf[yypos];\n\
   if (bits[c >> 3] & (1 << (c & 7)))\n\
     {\n\
       ++yypos;\n\
--- a/peg.peg-c
+++ b/peg.peg-c
@@ -1,4 +1,4 @@
-/* A recursive-descent parser generated by peg 0.1.6 */
+/* A recursive-descent parser generated by peg 0.1.7 */
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -94,7 +94,7 @@
 YY_LOCAL(int) yymatchChar(int c)
 {
   if (yypos >= yylimit && !yyrefill()) return 0;
-  if (yybuf[yypos] == c)
+  if ((unsigned char)yybuf[yypos] == c)
     {
       ++yypos;
       yyprintf((stderr, "  ok   yymatchChar(%c) @ %s\n", c, yybuf+yypos));
@@ -125,7 +125,7 @@
 {
   int c;
   if (yypos >= yylimit && !yyrefill()) return 0;
-  c= yybuf[yypos];
+  c= (unsigned char)yybuf[yypos];
   if (bits[c >> 3] & (1 << (c & 7)))
     {
       ++yypos;
--- a/version.h
+++ b/version.h
@@ -1,3 +1,3 @@
 #define PEG_MAJOR	0
 #define PEG_MINOR	1
-#define PEG_LEVEL	6
+#define PEG_LEVEL	7