tokay-lang / tokay

Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
https://tokay.dev
MIT License
236 stars 7 forks source link

Implement character-classes by `Char<...>` keyword token #98

Closed phorward closed 1 year ago

phorward commented 1 year ago

This PR replaces the given [...]-syntax by a new syntax Char<...> for the following reasons:

  1. The [...] syntax should become valid to specify lists (#100)
  2. Tokay is by-design a programming language, not a parser generator. The usage of character-class definitions is generally kept low, so the tradeoff is clear; Lists will be defined and used more often than character-classes.
  3. The new Char keyword underlines the future support of generics; A Char is generally any character. A Char<...> is an specialization for specific characters only. As this feature is built-in and generates statics, having its own syntax is valid.

This PR substitutes...

It generally cleans up the concept of characters and character-classes in the Tokay language.