mail[Wesnoth-commits] r25405 - in /trunk: changelog data/core/about.cfg src/serialization/preprocessor.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by jeremy . rosen on March 31, 2008 - 21:24:
Author: boucman
Date: Mon Mar 31 21:24:25 2008
New Revision: 25405

URL: http://svn.gna.org/viewcvs/wesnoth?rev=25405&view=rev
Log:
report an error when a macro is not resolved and is not a correct filename 
either, patch 1035 by cjhopman

Modified:
    trunk/changelog
    trunk/data/core/about.cfg
    trunk/src/serialization/preprocessor.cpp

Modified: trunk/changelog
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/changelog?rev=25405&r1=25404&r2=25405&view=diff
==============================================================================
--- trunk/changelog (original)
+++ trunk/changelog Mon Mar 31 21:24:25 2008
@@ -71,6 +71,8 @@
    * new [switch] conditional command
    * new [fire_event] event tag to fire any custom event
    * new [unit_side] theme element : this is the side of the current unit 
(flag)
+   * Preprocessor now logs when it encounters an undefined macro, and when it
+     fails opening a file.
  * miscellaneous and bug fixes:
    * Added new commandline options (patch #1031)
      -s or --server [host] connect to host specified or to the first server

Modified: trunk/data/core/about.cfg
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/core/about.cfg?rev=25405&r1=25404&r2=25405&view=diff
==============================================================================
--- trunk/data/core/about.cfg (original)
+++ trunk/data/core/about.cfg Mon Mar 31 21:24:25 2008
@@ -763,6 +763,9 @@
     [entry]
         name = "Tommy (yobbo)"
     [/entry]
+    [entry]
+        name = "Chris Hopman (cjhopman)"
+    [/entry]
 [/about]
 
 [about]

Modified: trunk/src/serialization/preprocessor.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/serialization/preprocessor.cpp?rev=25405&r1=25404&r2=25405&view=diff
==============================================================================
--- trunk/src/serialization/preprocessor.cpp (original)
+++ trunk/src/serialization/preprocessor.cpp Mon Mar 31 21:24:25 2008
@@ -311,8 +311,15 @@
 {
        if (is_directory(name))
                get_files_in_dir(name, &files_, NULL, ENTIRE_FILE_PATH, 
SKIP_MEDIA_DIR, DO_REORDER);
-       else
-               new preprocessor_data(t, called_macros_, istream_file(name), 
"", name, 1, directory_name(name), t.textdomain_);
+       else {
+               std::istream * file_stream = istream_file(name);
+               if (!file_stream->good()) {
+                       ERR_CF << "Could not open file " << name << "\n";
+                       delete file_stream;
+               }
+               else
+                       new preprocessor_data(t, called_macros_, file_stream, 
"", name, 1, directory_name(name), t.textdomain_);
+       }
        pos_ = files_.begin();
        end_ = files_.end();
 }
@@ -843,6 +850,7 @@
                                        strings_.back() += res.str();
                                }
                        } else if (target_.depth_ < 40) {
+                               LOG_CF << "Macro definition not found for " 
<< symbol << " , attempting to open as file.\n";
                                pop_token();
                                std::string prefix;
                                std::string nfname;




Related Messages


Powered by MHonArc, Updated Mon Mar 31 22:02:01 2008