Feature: Tokenize Keywords #6

Closed
opened 2023-09-22 00:18:05 +00:00 by j · 1 comment
Owner

Feature Progress

  • Decide which keywords are absolutely necessary
  • Create keyword types and tokenization rules
    • else
    • for
    • fn
    • if
    • in
    • let
    • while
    • match
    • ...

Feature description

Keywords are reserved identifiers with special meaning, which combine with other language elements to produce a unique effect.
Examples of keywords in other languages:

  • if, else, match, switch: conditional control flow
  • fn, let: starts a declaration
  • try: marks the next expression as potentially containing fallible elements
    ...

Example

// Example is in (unstable) Rust; Conlang currently has no keywords, block expressions, or control flow
fn main () {
    let x = try {
        something_fallible?;
    };
}
# Feature Progress <!-- Describe the steps for implementing this feature in libconlang --> - [x] Decide which keywords are absolutely necessary - [x] Create keyword types and tokenization rules - [x] `else` - [x] `for` - [x] `fn` - [x] `if` - [x] `in` - [x] `let` - [x] `while` - [ ] `match` - [ ] ... # Feature description <!-- [Feature name] does a cool thing that you should describe here --> Keywords are reserved identifiers with special meaning, which combine with other language elements to produce a unique effect. Examples of keywords in other languages: - `if`, `else`, `match`, `switch`: conditional control flow - `fn`, `let`: starts a declaration - `try`: marks the next expression as potentially containing fallible elements ... # Example <!-- Demonstrate this feature with a clear, concise code example Right now, we're (ab)using Rust syntax highlighting, since it most closely matches what I'm currently aiming for --> ```rust // Example is in (unstable) Rust; Conlang currently has no keywords, block expressions, or control flow fn main () { let x = try { something_fallible?; }; } ```
j added the
enhancement
label 2023-09-22 00:18:05 +00:00
j added this to the Basic Syntax project 2023-09-22 00:18:05 +00:00
j changed title from Feature: Keywords to Feature: Tokenize Keywords 2023-09-23 05:19:41 +00:00
j added a new dependency 2023-09-23 05:40:36 +00:00
Author
Owner

The initial set of keywords will be:

- `break`
- `continue`
- `else`
- `false`
- `for`
- `fn`
- `if`
- `in`
- `let`
- `return`
- `true`
- `while`

🥳

The initial set of keywords will be: ``` - `break` - `continue` - `else` - `false` - `for` - `fn` - `if` - `in` - `let` - `return` - `true` - `while` ``` 🥳
j closed this issue 2023-10-17 04:05:52 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Blocks
Reference: j/Conlang#6
No description provided.