/[projet1]/public/pc/tools/osdk/main/bas2tap/sources/bas2tap.cpp
Defence Force logotype

Diff of /public/pc/tools/osdk/main/bas2tap/sources/bas2tap.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1479 by dbug, Sun May 6 13:55:26 2018 UTC revision 1480 by dbug, Mon Jun 25 17:06:22 2018 UTC
# Line 132  void Bas2Tap(const char *sourceFile,cons Line 132  void Bas2Tap(const char *sourceFile,cons
132    while (lineIt!=textData.end())    while (lineIt!=textData.end())
133    {    {
134      const std::string& currentLine=StringTrim(*lineIt);      const std::string& currentLine=StringTrim(*lineIt);
135        ++lineIt;
136      ++currentLineNumber;      ++currentLineNumber;
137    
138      if (!currentLine.empty())      if (!currentLine.empty())
# Line 157  void Bas2Tap(const char *sourceFile,cons Line 157  void Bas2Tap(const char *sourceFile,cons
157        }        }
158        else        else
159        {        {
         // Standard line  
         buf[i++]=0;  
         buf[i++]=0;  
   
160          int number=get_value(ligne,-1);          int number=get_value(ligne,-1);
161          if (number<0)          if (number<0)
162          {          {
163              char car = *ligne++;
164              if (car != 0)
165              {
166                char car2 = *ligne++;
167                if ((car == '\'') || (car == ';') || ( (car == '/') && (car2 == '/'))  )
168                {
169                  // We accept the usual C, Assembler and BASIC comments are actual comments that do not count as normal lines
170                  // Technically we could have used a decent pre-processor, or even a full file filter, but I'm aiming at "more bangs for the bucks" approach.
171                  // If necessary we can refactor later
172                  continue;
173                }
174              }
175    
176            // Mike: Need to add better diagnostic here            // Mike: Need to add better diagnostic here
177            ShowError("Missing line number in file %s line %d",currentFile.c_str(),currentLineNumber);            ShowError("Missing line number in file %s line %d",currentFile.c_str(),currentLineNumber);
178            break;            break;
179          }          }
180    
181            // Standard line
182            buf[i++] = 0;
183            buf[i++] = 0;
184    
185          buf[i++]=number&0xFF;          buf[i++]=number&0xFF;
186          buf[i++]=number>>8;          buf[i++]=number>>8;
187    
# Line 223  void Bas2Tap(const char *sourceFile,cons Line 237  void Bas2Tap(const char *sourceFile,cons
237          buf[i++]=0;          buf[i++]=0;
238        }        }
239      }      }
     ++lineIt;  
240    }    }
241    buf[i++]=0;    buf[i++]=0;
242    buf[i++]=0;    buf[i++]=0;

Legend:
Removed from v.1479  
changed lines
  Added in v.1480

  ViewVC Help
Powered by ViewVC 1.1.26