pike.git/
lib/
modules/
Parser.pmod/
Pike.pmod
Branch:
Tag:
Non-build tags
All tags
No tags
2000-08-19
2000-08-19 11:23:19 by Andreas Lange <andreas@lange.cx>
5f450dc9099b709389fdb8d975bf71fb730f7a15 (
15
lines) (+
13
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
A Pike-parser should understand the '#charset' statement
Rev: lib/modules/Parser.pmod/Pike.pmod:1.2
6:
int line=1; array(string) ret=({}); int pos;
-
data+
="
\0
";
+
data +
=
"
\n\0
";
/* End sentinel. */
while(1) {
29:
error("Failed to find end of preprocessor statement.\n"); while(data[pos-1]=='\\') pos=search(data,"\n",pos+1);
+
sscanf(data[start..pos],
+
"#%*[ \t]charset%*[ \t\\]%s%*[ \n]", string charset);
+
if(charset)
+
data = (data[0..pos]+
+
master()->decode_charset(data[pos+1..sizeof(data)-3],
+
charset)
+
+"\n\0"); // New end sentinel.
break; case 'a'..'z': case 'A'..'Z':
-
+
case 128..: // Lets simplify things for now...
case '_': while(1) {
41:
case 'a'..'z': case 'A'..'Z': case '0'..'9':
+
case 128..: // Lets simplify things for now...
case '_': pos++; continue;
88:
break; default:
-
werror("Unknown token %
s\n
",data[pos..
pos+5
]);
+
werror("
%O\n",ret);
+
werror("
Unknown token %
O\n
",data[pos..
pos+20
]);
exit(1); case '`':