shithub: pprolog

Download patch

ref: 901224d36c3f488e4118a1fd804da2b3372d8ed6
parent: 0c22d3d73005e7b956742bd5fc75f183b8784989
author: Peter Mikkelsen <peter@pmikkelsen.com>
date: Tue Jul 20 18:38:03 EDT 2021

Add support for character code constants like 0'a

--- a/parser.c
+++ b/parser.c
@@ -404,6 +404,11 @@
 		if(peek == L'0'){
 			peek = Bgetrune(parsein);
 			switch(peek){
+			case L'\'': /* Character code */
+				peek = Bgetrune(parsein);
+				lookahead.tag = IntTok;
+				lookahead.ival = peek;
+				return;
 			case L'o': /* Octal */
 			case L'x': /* Hexadecimal */
 			case L'b': /* Binary */