Skip to content

fix contents of encapsulated strings being lexed #11

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

teatwig
Copy link

@teatwig teatwig commented Mar 26, 2025

I encountered a similar issue as in #10 where creating a window rule like on created if app_id is "f.exe" then maximize would lead to the following error:

on created if app_id is "f.exe" then maximize
                        ^ Literal parser error. Text could not be converted to float. text:"f.exe"

This is because the lexer tries to parse the contents of encapsulated literals.

The only issue I can see with the solution is that it might not handle encapsulated character literals properly? Although I couldn't find a place where character literals are used.
Apart from that it doesn't really make sense to try to parse for example "false" as a boolean instead of a window with the title "false".

It might make sense to handle only literals encapsulated with " differently since at least the comments in lexer.hpp imply that it's supposed to be generic and there might eventually be a use case for encapsulated literals that aren't strings.

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

Successfully merging this pull request may close these issues.

1 participant