mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-05 23:22:25 +00:00
Record curpos on every inR.Read. Add more debug to catch OpenBSD read failure.
This commit is contained in:
parent
c7e88f4634
commit
cf2da3000f
8 changed files with 47 additions and 32 deletions
|
|
@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len)
|
|||
|
||||
void OPM_Get (CHAR *ch)
|
||||
{
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
|
||||
if (*ch == 0x0d) {
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
} else {
|
||||
OPM_curpos += 1;
|
||||
if ((OPM_curpos == 0 && OPM_inR.eot)) {
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
|
||||
OPM_LogWNum((INT16)*ch, 1);
|
||||
OPM_LogW('.');
|
||||
}
|
||||
if ((*ch < 0x09 && !OPM_inR.eot)) {
|
||||
*ch = ' ';
|
||||
|
|
|
|||
|
|
@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len)
|
|||
|
||||
void OPM_Get (CHAR *ch)
|
||||
{
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
|
||||
if (*ch == 0x0d) {
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
} else {
|
||||
OPM_curpos += 1;
|
||||
if ((OPM_curpos == 0 && OPM_inR.eot)) {
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
|
||||
OPM_LogWNum((INT16)*ch, 1);
|
||||
OPM_LogW('.');
|
||||
}
|
||||
if ((*ch < 0x09 && !OPM_inR.eot)) {
|
||||
*ch = ' ';
|
||||
|
|
|
|||
|
|
@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len)
|
|||
|
||||
void OPM_Get (CHAR *ch)
|
||||
{
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
|
||||
if (*ch == 0x0d) {
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
} else {
|
||||
OPM_curpos += 1;
|
||||
if ((OPM_curpos == 0 && OPM_inR.eot)) {
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
|
||||
OPM_LogWNum((INT16)*ch, 1);
|
||||
OPM_LogW('.');
|
||||
}
|
||||
if ((*ch < 0x09 && !OPM_inR.eot)) {
|
||||
*ch = ' ';
|
||||
|
|
|
|||
|
|
@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len)
|
|||
|
||||
void OPM_Get (CHAR *ch)
|
||||
{
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
|
||||
if (*ch == 0x0d) {
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
} else {
|
||||
OPM_curpos += 1;
|
||||
if ((OPM_curpos == 0 && OPM_inR.eot)) {
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
|
||||
OPM_LogWNum((INT16)*ch, 1);
|
||||
OPM_LogW('.');
|
||||
}
|
||||
if ((*ch < 0x09 && !OPM_inR.eot)) {
|
||||
*ch = ' ';
|
||||
|
|
|
|||
|
|
@ -484,11 +484,13 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, ADDRESS mname__len)
|
|||
|
||||
void OPM_Get (CHAR *ch)
|
||||
{
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
Texts_Read(&OPM_inR, Texts_Reader__typ, &*ch);
|
||||
if (*ch == 0x0d) {
|
||||
OPM_curpos = Texts_Pos(&OPM_inR, Texts_Reader__typ);
|
||||
} else {
|
||||
OPM_curpos += 1;
|
||||
if ((OPM_curpos == 0 && OPM_inR.eot)) {
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)"DEBUG: OPM.Get returned inR.eot at curpos = 0, ch = ", 53);
|
||||
OPM_LogWNum((INT16)*ch, 1);
|
||||
OPM_LogW('.');
|
||||
}
|
||||
if ((*ch < 0x09 && !OPM_inR.eot)) {
|
||||
*ch = ' ';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue