فهرست منبع

added comment support

Noah 4 سال پیش
والد
کامیت
2dd3afa1f1
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      src/tibasic.cpp

+ 8 - 0
src/tibasic.cpp

@@ -56,8 +56,16 @@ bool Compiler::compile(string inFile, string outFile)
     {
     {
         getline(f, tmpLine, '\n');
         getline(f, tmpLine, '\n');
 
 
+        // ignore comments
+        tmpLine = tmpLine.substr(0, tmpLine.find("#", 0));
+
+        // ignore empty lines
         if(!tmpLine.length())
         if(!tmpLine.length())
+        {
+            //log(Debug, "Line with only whitespaces / comments detected!");
             continue;
             continue;
+        }
+
 
 
         // Parse.
         // Parse.
         token_t token;
         token_t token;