We are implementing a new parser written in Darklang. This issue gathers the grammar updates that need to be done to match more of our full language. Expressions: - [x] unit - [x] bool - [x] signed and unsigned Ints (Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128) - [x] float - [x] char - [ ] TODO: the space in `'a '` shouldn't be ignored, and the test should fail - [x] string - [x] let expression - [x] if/else - [x] pretty-printer: fix the formatting for an `if` statement with an `else` whose root expression is also an `if` - [x] Fix the requirement for parentheses in a `then` expression within an inline if/else expression - [x] infix - [x] +, -, *, /, %, ^, >, <, >=, <=, ==, !=, ++ - [x] ||, && - [x] lambda - [x] field access - [x] variable - [x] list - [x] dict - [x] tuple - [x] pipe - [x] record - [x] enum - [x] match - [x] record update - [x] paren_expression - [x] fix apply - [x] constant Type references: - [x] Variable - [x] Unit - [x] Bool - [x] Signed and Unsigned Ints (Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128) - [x] Float - [x] Char - [x] String - [x] DateTime - [x] Uuid - [x] List - [x] Tuple - [x] Dict - [x] CustomType - [x] DB - [x] Fn Match pattern: - [x] Variable - [x] Enum - [x] Signed and Unsigned Ints (Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128) - [x] String - [x] Char - [x] Bool - [x] Unit - [x] Float - [x] List - [x] ListCons - [x] Tuple Source file: - [x] Type declaration - [x] Alias - [x] Record - [x] Enum - [x] Function declaration - [x] Constant declaration (Unit, Bool, Signed and Unsigned Ints, Float, Char, String, List, Tuple, Dict, Enum) - [x] Module declaration Other: - [x] Qualified function name - [x] Qualified type name - [ ] Comments (/// comments) - [x] indentation? - [x] generics ('a)? - [x] type parameter (GenericThing<'thing>)? - [x] string interpolation - [x] wildcard (eg. Error _ ->...)? - [x] DB - [ ] Http Handler - [ ] Worker - [ ] Cron - [ ] REPL?
We are implementing a new parser written in Darklang. This issue gathers the grammar updates that need to be done to match more of our full language.
Expressions:
'a 'shouldn't be ignored, and the test should failifstatement with anelsewhose root expression is also anifthenexpression within an inline if/else expressionType references:
Match pattern:
Source file:
Other: