US/Eastern
Comment by ~ntietz on ~ntietz/hurl-lang
Nicole Tietz-Sokolskaya referenced this ticket in commit 6875b87.
REPORTED
RESOLVED IMPLEMENTEDComment by ~ntietz on ~ntietz/hurl-lang
Token definitions:
- Keywords: let, func, hurl, toss, try, catch, as, return, print, true, false.
- Identifiers: Sequences of ASCII alphanumeric characters and underscores, beginning with a letter or an underscore.
- String Literals: Sequences of characters enclosed in double quotes (" "). Special characters can be escaped with a backslash (), including " to represent a quote within the string, and \ to represent a backslash.
- Boolean Values: true, false.
- Numerical Values: Both integers and floating-point numbers. Integers are sequences of digits (0-9). Floating-point numbers consist of one or more digits, followed by a decimal point, followed by zero or more digits.
- Operators: +, -, *, /, %, ~.
- Punctuation: Parentheses (), curly braces {}, semicolons ;.
- Comments: Lines beginning with # are treated as comments and are ignored by the lexer.
~ntietz assigned ~ntietz to #2 on ~ntietz/hurl-lang
Comment by ~ntietz on ~ntietz/hurl-lang
Subtasks:
- Define Tokens: First, we should clearly define all the language tokens. Tokens are the smallest units of a program, such as keywords, identifiers, constants, operators, and special symbols.
- Define Syntax Rules: After defining the tokens, we can establish the syntax rules. Syntax rules define how tokens combine to form statements and expressions.
- Define Comment Syntax: As comments are part of the language grammar, we should also define the rules for them.
- Document the Grammar: Once we have the language grammar defined, we should document it thoroughly.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Write comprehensive tests for each component of the language's infrastructure to ensure their correct functionality. This includes tests for the language grammar, the lexer, the parser, and the formatter. For each component, the tests should:
- Validate the component against various code samples.
- Ensure edge cases are correctly handled.
- Confirm proper handling and preservation of comments during the formatting process.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Create a formatter that traverses the AST to generate formatted code. The formatter should apply rules for code indentation, line breaks, space between operators, and other formatting details, including handling of comments. Key components to focus on include:
- Code traversal from AST.
- Application of formatting rules as defined.
- Proper handling and formatting of comments.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Develop a parser that checks whether the sequence of tokens from the lexer conforms to the syntax rules defined in the language grammar. The parser should also construct an Abstract Syntax Tree (AST) from the tokens. Key features to implement include:
- Syntax validation according to language grammar.
- AST construction from valid tokens, including nodes for comments.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Implement a lexer that will break the input code into a sequence of tokens, including comments. The lexer should correctly identify all tokens as defined in the language grammar, including:
- All keywords.
- All constants.
- Variables and function names.
- All operators.
- Parentheses, curly braces, semicolons, and comments.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Develop a detailed specification of the language grammar. This includes identifying and defining all language tokens and writing syntax rules for all language constructs. Key aspects to consider include:
- Keywords: let, func, hurl, toss, try, catch, as, return, print.
- Constants: string literals, boolean values, numerical values.
- Variables and function names (identifier rules).
- Operators: +.
- Other tokens: parentheses (), curly braces {}, semicolons ;, and comments.
- Syntax rules for function definitions, control flow with try-catch blocks, exception throwing using hurl and toss, and printing with print.
Ticket created by ~ntietz on ~ntietz/hurl-lang
Currently, no one can use Hurl for any real-world tasks, as there is not a license. This is problematic and will limit the language's reach and growth. To ensure that everyone can put this into production at their workplaces, let's add a license.
We need to decide which license to use. Suggestions are welcome.