Skip to content

Conversation

@EndeyshentLabs
Copy link
Contributor

@EndeyshentLabs EndeyshentLabs commented Dec 23, 2025

I'm not entirely sure what else to add and would appreciate corrections. So far, I'm only sure about cfor, csize, and cusize.

As far as I understand, lambda, has, typeof, true, and false aren't used anywhere, but they seem to have implementations (though lambda doesn't work for me, but maybe I'm using it incorrectly).

\ void

syn keyword glintPrimitiveTypes
\ Bool
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do they have to be capitalized? In lexer.cc, tests and examples they're all lowercase.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They used to have to be, but they no longer are; IIRC I left it because I meant to make everything case-insensitive, but never got around to it. bool, byte, etc is the proper "modern" Glint styling for built-in types

@LensPlaysGames
Copy link
Owner

I haven't tested lambdas at all yet, I'll add some cases for it and make sure it's working. A lambda is basically supposed to act like name : before a function signature, and it just generates a unique name.

has is used to implement match; that is, match statements get rewritten into if else chain with has conditionals. It's often not used by the user but will be for certain cases.

typeof is used by semantic templates (the templates that sema uses to rewrite things), and it's effectively just decltype from cpp (gets the type of the expression without emitting it).

true and false are just constants, they are used to initialize variables, often (like the sdl example initializing running to true).

This PR looks good, and I'd merge it unless you want to add anything else

@LensPlaysGames
Copy link
Owner

LensPlaysGames commented Dec 23, 2025

There is a list of keywords in lib/glint/lexer.cc right near the top if you want an exhaustive list

@LensPlaysGames
Copy link
Owner

I haven't tested lambdas at all yet, I'll add some cases for it and make sure it's working. A lambda is basically supposed to act like name : before a function signature, and it just generates a unique name.

There are some test cases for lambdas now; they appear to be working afaik?

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.

2 participants