upgrade to xpdf 3.00.
[swftools.git] / pdf2swf / xpdf / Lexer.cc
index 4ca8cfe..1fa166f 100644 (file)
@@ -2,11 +2,13 @@
 //
 // Lexer.cc
 //
-// Copyright 1996 Derek B. Noonburg
+// Copyright 1996-2003 Glyph & Cog, LLC
 //
 //========================================================================
 
-#ifdef __GNUC__
+#include <aconf.h>
+
+#ifdef USE_GCC_PRAGMAS
 #pragma implementation
 #endif
 
@@ -44,22 +46,22 @@ static char specialChars[256] = {
 // Lexer
 //------------------------------------------------------------------------
 
-Lexer::Lexer(Stream *str) {
+Lexer::Lexer(XRef *xref, Stream *str) {
   Object obj;
 
   curStr.initStream(str);
-  streams = new Array();
+  streams = new Array(xref);
   streams->add(curStr.copy(&obj));
   strPtr = 0;
   freeArray = gTrue;
   curStr.streamReset();
 }
 
-Lexer::Lexer(Object *obj) {
+Lexer::Lexer(XRef *xref, Object *obj) {
   Object obj2;
 
   if (obj->isStream()) {
-    streams = new Array();
+    streams = new Array(xref);
     freeArray = gTrue;
     streams->add(obj->copy(&obj2));
   } else {
@@ -204,11 +206,15 @@ Object *Lexer::getObj(Object *obj) {
 
       case '(':
        ++numParen;
+       c2 = c;
        break;
 
       case ')':
-       if (--numParen == 0)
+       if (--numParen == 0) {
          done = gTrue;
+       } else {
+         c2 = c;
+       }
        break;
 
       case '\\':