Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheme parser fails to recognize function definition #177

Open
ceving opened this issue Nov 11, 2023 · 2 comments
Open

Scheme parser fails to recognize function definition #177

ceving opened this issue Nov 11, 2023 · 2 comments

Comments

@ceving
Copy link

ceving commented Nov 11, 2023

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.

@ceving
Copy link
Author

ceving commented Nov 12, 2023

Seems to be an upstream bug: https://bugs.kde.org/show_bug.cgi?id=476879

@jgm
Copy link
Owner

jgm commented Nov 13, 2023

Let us know when it's fixed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants