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

Introduces literals and type checker #90

Open
momeemt opened this issue Oct 19, 2024 · 0 comments
Open

Introduces literals and type checker #90

momeemt opened this issue Oct 19, 2024 · 0 comments
Labels
changes: major Breaking changes difficulty: hard Hard Issues size: large Arround 2months ~ type: enhancement New feature or request
Milestone

Comments

@momeemt
Copy link
Member

momeemt commented Oct 19, 2024

The compiler now treats the type of all tokens as Text. However, there are more kinds of data in general documents.
For instance Path, Integer, Record and Enum.
I felt so difficult and too complex to implement large amount of validations and castings when developing Brack plugins.
We'll introduce the brack in literals and handy type checker to make it easy to build plugins.

Literal

The literal can be written as `DATA.
For example, `123 is inferred as an Integer type, and `{ foo: 123 } is inferred as Record (to be precise, its type is Record{ foo: 123 }). As an exception, the statement whose first character is a dot (.) is inferred as Path (like Nix).

@momeemt momeemt added type: enhancement New feature or request difficulty: hard Hard Issues size: large Arround 2months ~ changes: major Breaking changes labels Oct 19, 2024
@momeemt momeemt pinned this issue Oct 19, 2024
@momeemt momeemt added this to the v0.3.0 milestone Oct 21, 2024
@momeemt momeemt unpinned this issue Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changes: major Breaking changes difficulty: hard Hard Issues size: large Arround 2months ~ type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant