[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdevelop/languages/ruby/parser
From:       Alexander Dymo <adymo () kdevelop ! org>
Date:       2006-10-17 18:45:41
Message-ID: 1161110741.264145.15258.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 596509 by dymo:

I don't want the parser to depend on Qt, so let's try char* here.


 M  +0 -1      CMakeLists.txt  
 M  +4 -4      ruby_io.cpp  


--- trunk/KDE/kdevelop/languages/ruby/parser/CMakeLists.txt #596508:596509
@@ -138,7 +138,6 @@
 
 kde4_automoc(kdevrubyparser_STAT ${kdevrubyparser_STAT_SRCS})
 kde4_add_library(kdevrubyparser STATIC ${kdevrubyparser_STAT_SRCS})
-target_link_libraries( kdevrubyparser ${QT_QTCORE_LIBRARY} )
 
 # generate the command-line parser
 add_executable(ruby-parser main.cpp)
--- trunk/KDE/kdevelop/languages/ruby/parser/ruby_io.cpp #596508:596509
@@ -31,7 +31,6 @@
 
 #include <iostream>
 #include <sstream>
-#include <QVarLengthArray>
 
 namespace ruby
 {
@@ -71,10 +70,10 @@
     token_type &token = token_stream->token(index);
     token_stream->start_position(index, &line, &col);
     size_t tokenLength = token.end - token.begin;
-    QVarLengthArray<char> tokenValue(tokenLength+1);
-    strncpy(tokenValue.data(), token.text + token.begin, tokenLength);
+    char *tokenValue = new char(tokenLength+1);
+    strncpy(tokenValue, token.text + token.begin, tokenLength);
     std::stringstream s;
-    s << " (current token: \"" << (token.kind != 0 ? tokenValue.data() : "EOF") <<
+    s << " (current token: \"" << (token.kind != 0 ? tokenValue : "EOF") <<
         "\" [" << token.kind << "] at line: " << line+1 << " col: " << col+1 << ")";
     report_problem(
         parser::error,
@@ -82,6 +81,7 @@
         //+ "'' instead of ``" + current_token_text
         + "''" + s.str()
     );
+    delete tokenValue;
 }
 
 } // end of namespace ruby
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic