KubaP / glsl-lsp

A language server implementation for the OpenGL Shading Langauge, written in Rust.
12 stars 1 forks source link

Improve internal representation of define directives #16

Open KubaP opened 6 months ago

KubaP commented 6 months ago

Currently, the lexer parses a define directive as a TokenStream::Define which just contains a vector of DefineTokens for the macro signature part and a vector of normal Tokens for the body part.

This setup inherently has a number of invariants that are not expressed through the type system and have already caused some confusion after a long break on working on this project, (not a comprehensive list):

This is unnecessarily ambigious and complicated. We should refactor this to more cleanly express the invariants, probably through a new enum type.