MARC interface implemented. Minor bugs fixed. fmltest can
[egate.git] / fml / fmltoken.c
index 77f9139..fc4d189 100644 (file)
@@ -2,7 +2,12 @@
  * FML interpreter. Europagate, 1995
  *
  * $Log: fmltoken.c,v $
- * Revision 1.2  1995/02/07 16:09:24  adam
+ * Revision 1.3  1995/02/10 15:50:57  adam
+ * MARC interface implemented. Minor bugs fixed. fmltest can
+ * be used to format single MARC records. New function '\list'
+ * implemented.
+ *
+ * Revision 1.2  1995/02/07  16:09:24  adam
  * The \ character is no longer INCLUDED when terminating a token.
  * Major changes in tokenization routines. Bug fixes in expressions
  * with lists (fml_sub0).
@@ -86,7 +91,6 @@ struct fml_node *fml_group (Fml fml)
             struct fml_node *sptr = fml_group (fml);
             if (sptr)
             {
-#if 1
                 ptr2 = fml_node_alloc (fml);
                 if (!ptr0)
                     ptr0 = ptr2;
@@ -94,28 +98,6 @@ struct fml_node *fml_group (Fml fml)
                         ptr1->p[1] = ptr2;
                 ptr2->p[0] = sptr;
                 ptr2->is_atom = 0;
-
-#else
-/* make group of one become an element ... */
-                if (sptr->p[1])
-                {
-                    ptr2 = fml_node_alloc (fml);
-                    if (!ptr0)
-                        ptr0 = ptr2;
-                    else
-                        ptr1->p[1] = ptr2;
-                    ptr2->p[0] = sptr;
-                    ptr2->is_atom = 0;
-                }  
-                else
-                {
-                    ptr2 = sptr;
-                    if (!ptr0)
-                        ptr0 = ptr2;
-                    else
-                        ptr1->p[1] = ptr2;
-                }
-#endif
             }
             else
             {
@@ -168,6 +150,20 @@ static void lexer (Fml fml)
         look_type = '}';
         look_char = (*fml->read_func)();
     }        
+    else if (look_char == '\'')
+    {
+        off = 0;
+        look_char = (*fml->read_func)();
+        while (look_char != fml->eof_mark && look_char != '\'')
+        {
+            lex_buf[off++] = look_char;
+            look_char = (*fml->read_func)();
+        } 
+        lex_buf[off] = '\0';
+        look_type = 'a';
+        if (look_char == '\'')
+            look_char = (*fml->read_func)();
+    }
     else
     {
         off = 0;