]> www.ginac.de Git - ginac.git/blobdiff - ginac/input_lexer.ll
fixed a bug where quo() would call vector::reserve() with a negative argument
[ginac.git] / ginac / input_lexer.ll
index 6c22ec08dbca76c800fea1654292a3c23c4ae9b0..e4757b9d8181584e48f6f91de150e5b889fb74dd 100644 (file)
@@ -38,6 +38,7 @@
 #include "fail.h"
 #include "numeric.h"
 #include "symbol.h"
+#include "lst.h"
 
 using namespace GiNaC;
 namespace GiNaC {
@@ -101,10 +102,6 @@ Digits                     ginac_yylval = (long)Digits; return T_DIGITS;
 "<="                   return T_LESSEQ;
 ">="                   return T_GREATEREQ;
 
-                       /* matrix delimiters */
-\[\[                   return T_MATRIX_BEGIN;
-\]\]                   return T_MATRIX_END;
-
                        /* numbers */
 {D}+                   |
 "#"{D}+"R"{AN}+                |
@@ -173,18 +170,18 @@ void set_lexer_string(const std::string &s)
 void set_lexer_symbols(ex l)
 {
        syms.clear();
-       if (!is_ex_exactly_of_type(l, lst))
+       if (!is_exactly_a<lst>(l))
                return;
-       for (int i=0; i<l.nops(); i++) {
-               if (is_ex_exactly_of_type(l.op(i), symbol))
-                       syms[ex_to_symbol(l.op(i)).get_name()] = sym_def(l.op(i), true);
+       for (unsigned i=0; i<l.nops(); i++) {
+               if (is_exactly_a<symbol>(l.op(i)))
+                       syms[ex_to<symbol>(l.op(i)).get_name()] = sym_def(l.op(i), true);
        }
 }
 
 // Check whether symbol was predefined
 bool is_lexer_symbol_predefined(const ex &s)
 {
-       sym_tab::const_iterator i = syms.find(ex_to_symbol(s).get_name());
+       sym_tab::const_iterator i = syms.find(ex_to<symbol>(s).get_name());
        if (i == syms.end())
                return false;
        else