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

Builtin / default constants #51

Open
6 of 10 tasks
phorward opened this issue May 5, 2022 · 2 comments
Open
6 of 10 tasks

Builtin / default constants #51

phorward opened this issue May 5, 2022 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@phorward
Copy link
Member

phorward commented May 5, 2022

With Tokay v0.5, the language is entering a phase where modularity becomes an important part.

For example, the new builtin native tokens Int and Float can be grouped by a pure Tokay parselet Number, defined as

Number : Float | Int

And together with #10, generic parselets are needed in various ways to provide tools for different use-cases.

Currently, there is no way to define such default parselets, except hacking directly in Compiler::get_constant() or Compiler::set_constant() as with the Whitespace defaults handling.

For sure, Float and Int could either be implemented in pure Tokay code on their own, but this may end in performance lose.

Ideas for this issue (partly from #10):

  • Number: Float | Int
  • Token: Word | Number | AsciiPunctuation
  • Until : @<P, Escape: Void>
  • String: @<Start, End: void, Escape: void>
  • Repeat : @<P> min=1, max=0
  • Not : @<P>
  • Peek : @<P>
  • Expect : @<P> msg=void
  • Separated : @<P, Separator: ',', empty: true>
  • Csv : @<Separator: ';'|','|'\t'|' ', String: '"'>
@phorward
Copy link
Member Author

First step towards this is done by 38a130d

@phorward phorward pinned this issue May 21, 2022
@phorward
Copy link
Member Author

Token-parselet added by 8ff20f7.

@phorward phorward added the feature New feature or request label Oct 9, 2022
@phorward phorward self-assigned this Oct 17, 2022
@phorward phorward unpinned this issue Dec 20, 2022
@phorward phorward pinned this issue Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant