The attached patches add XHTML support to dgcc-r19 and dmd-0.167.
Changes:
* treat "<code />" correctly
* handle "<![CDATA[" and "]]>"
* support the file extension ".xhtml"
Comment #1 by thomas-dloop — 2006-09-23T07:08:25Z
Created attachment 31
XHTML support for dgcc (subversion revision 19)
Comment #2 by thomas-dloop — 2006-09-23T07:08:50Z
Created attachment 32
XHTML support for DMD-0.167
Comment #3 by bugzilla — 2006-10-04T20:00:03Z
Incorporated DMD 0.168
Comment #4 by thomas-dloop — 2006-10-12T03:35:21Z
The html.c source included in dmd-0.168/0.169 isn't the source used for compiling dmd-0.168/0.169. Thus the dmd binaries don't support parsing of XHTML source files.
html.c:529: int lineSepLength = isLineSeperator(p);
The implementation of isLineSeparator can't be found in DMD's frontend
sources(it was introduced into GDC-0.10's frontend for simplifying parsing).
Due to a typo, GDC calls this function isLineSeperator instead of isLineSeparator.
/**
* identify DOS, Linux, Mac, Next and Unicode line endings
* 0 if this is no line separator
* >0 the length of the separator
* Note: input has to be UTF-8
*/
static int isLineSeparator(const unsigned char* p){
// Linux
if( p[0]=='\n'){
return 1;
}
// Mac & Dos
if( p[0]=='\r'){
return (p[1]=='\n') ? 2 : 1;
}
// Unicode (line || paragraph sep.)
if( p[0]==0xE2 && p[1]==0x80 && (p[2]==0xA8 || p[2]==0xA9)){
return 3;
}
// Next
if( p[0]==0xC2 && p[1]==0x85){
return 2;
}
return 0;
}