You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This model could be used in tooling, to highlight the things in the used ide, the lexer should implement 2 member functions(Add member functions with functional way #3) that could be evaluated in compile time:
highlight(token: T): PlankTokenType where T represents your Token enum(Add union, enums and type infer #6), and plank token type a common way to represent the colors in ide
lex(): [T] where T represents your Token enum, and it will be the entry point for the macro.
PS: The sample below uses generic structs that arent yet implemented.
The macro should pass a Expr or a Lexer type, if not, the macro should not compile and throw a error in the cli and ide, if you passes Expr(in this case it is not defined yet, but is supposed to be a representation of Expr in compiler source code) in parameter, the compiler will immediately use the Plank Lexer and Parser and validate the expression like this:
Add a syntax to build object that could be cool and powerful, like kotlin dsl or rust macros.
The text was updated successfully, but these errors were encountered: