]> dreyeck.freedombox.rocks Git - topic-maps.git/blobdiff - src/ctm/lexer.lisp
feat(ctm): read associations and roles with merge-safe topic references
[topic-maps.git] / src / ctm / lexer.lisp
index 6331cde1dc9449229f02e7ab1c6d55115be15a69..116b55c6d4c8abf7d24a3e2a9f0f1624e13a45d2 100644 (file)
                  (eql #\/ (peek-character lexer 1)) (eql #\/ (peek-character lexer 2)))
             (incf (lexer-cursor lexer) 3)
             (loop while (and (peek-character lexer) (not (whitespace-p (peek-character lexer)))
                  (eql #\/ (peek-character lexer 1)) (eql #\/ (peek-character lexer 2)))
             (incf (lexer-cursor lexer) 3)
             (loop while (and (peek-character lexer) (not (whitespace-p (peek-character lexer)))
-                             (not (find (peek-character lexer) "<>\"{}|^`\\[](")))
+                             (not (find (peek-character lexer) "<>\"{}|^`\\[]()")))
                   do (take-character lexer))
             (loop while (and (> (lexer-cursor lexer) start)
                              (find (char text (1- (lexer-cursor lexer))) ";.)"))
                   do (take-character lexer))
             (loop while (and (> (lexer-cursor lexer) start)
                              (find (char text (1- (lexer-cursor lexer))) ";.)"))
             (scan-name lexer)
             (make-token :kind :qname :value (subseq text start (lexer-cursor lexer)) :position start))
            (t (make-token :kind :identifier :value head :position start)))))
             (scan-name lexer)
             (make-token :kind :qname :value (subseq text start (lexer-cursor lexer)) :position start))
            (t (make-token :kind :identifier :value head :position start)))))
-      ((find c ".;-=^:") (make-token :kind :punctuation :value c :position start))
-      ((find c "%?[$@~()")
+      ((find c ".;-=^:(),") (make-token :kind :punctuation :value c :position start))
+      ((find c "%?[$@~")
        (problem 'ctm-unsupported :unsupported-construct start
        (problem 'ctm-unsupported :unsupported-construct start
-                (format nil "Construct starting with ~S is outside Slice 1." c)))
+                (format nil "Construct starting with ~S is outside the implemented subset." c)))
       (t (problem 'ctm-rejection :unexpected-character start (format nil "Unexpected character ~S." c))))))
       (t (problem 'ctm-rejection :unexpected-character start (format nil "Unexpected character ~S." c))))))