skylighting
skylighting copied to clipboard
Scheme parser fails to recognize function definition
trafficstars
I am using skylighting 0.12.3.1.
I have the following example file:
(define-syntax grammar
(syntax-rules (→)
((_ (left1 → right11 right12 ...)
(left2 → right21 right22 ...)
...)
(vector (production left1 → right11 right12 ...)
(production left2 → right21 right22 ...)
...))))
(define grammar-production vector-ref)
(define (grammar-production-number g p)
(let ((l (vector-length g)))
(let loop ((i 0))
(if (>= i l)
#f
(if (equal? (grammar-production g i) p)
i
(loop (+ i 1)))))))
I run the following command:
skylighting -f native -s scheme test.scm
The first define works fine although I do not understand, why the white-space is part of FunctionTok:
, [ ( NormalTok , "(" )
, ( ExtensionTok , "define" )
, ( FunctionTok , " grammar-production " )
, ( KeywordTok , "vector-ref" )
, ( NormalTok , ")" )
]
But the second definition does not work:
, [ ( NormalTok , "(" )
, ( ExtensionTok , "define" )
, ( FunctionTok , " " )
, ( NormalTok , "(grammar-production-number g p)" )
]
The FunktionTok contains just the white-space.
Seems to be an upstream bug: https://bugs.kde.org/show_bug.cgi?id=476879
Let us know when it's fixed upstream.