浏览代码

allow a semicolon within a comment

David Rose 21 年之前
父节点
当前提交
4974c1615d
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      pandatool/src/palettizer/txaFile.cxx

+ 8 - 1
pandatool/src/palettizer/txaFile.cxx

@@ -188,7 +188,14 @@ int TxaFile::
 get_line_or_semicolon(istream &in, string &line) {
   line = string();
   int ch = in.get();
-  while (ch != EOF && ch != '\n' && ch != ';') {
+  char semicolon = ';';
+
+  while (ch != EOF && ch != '\n' && ch != semicolon) {
+    if (ch == '#') {
+      // We don't consider a semicolon within a comment to be a line
+      // break.
+      semicolon = EOF;
+    }
     line += ch;
     ch = in.get();
   }