Goose  History of bs/parse/parser.cpp of d40e6470bf3d96f9

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

History of file bs/parse/parser.cpp at check-in d40e6470bf3d96f9

2024-09-15
20:24
Add clang format settings, reformat everything file: [ed854b8ea9] check-in: [0db147f117] user: achavasse branch: cir-ssa-refactor, size: 10274
2024-03-14
23:23
  • add type wrapper for unresolved compile time identifier, move undefined identifier handling to dropValue() of those
  • implemented dot operator for structs
  • fixed struct lazy parsing
  • implemented some tests for structs default construction
  • fixed struct default ctor generation
file: [bb168a565a] check-in: [75a719c020] user: zlodo branch: trunk, size: 10327
2023-12-26
15:41
Structs: add the Finalize extension point that finalizes the creation of a struct after gathering its content. file: [d6c2d71c1f] check-in: [f1458583b5] user: zlodo branch: trunk, size: 10376
2023-11-05
13:04
Implemented inline functions file: [84a62d84bb] check-in: [96c02f37d1] user: zlodo branch: trunk, size: 10375
2023-03-05
22:24
  • removed fmtlib, now use std::format
  • vastly improved the overload resolution debugging tools
  • prelude: started adding some extra error detection for small things that don't need to be builtin
  • prelude: started working on implementing #for for tuples, some stuff needs to be addressed still
  • fixed some type checking issue with wrapped args
  • fixed superfluous nested lifetime scope in brace blocks (which caused redundant calls to some extension points)
file: [2430c60b3e] check-in: [4d4d76607a] user: zlodo branch: trunk, size: 10261
2022-11-17
00:46
expose more compiler functionality to g0api:
  • local variable declarations
  • lifetime scopes
file: [91acda1940] check-in: [605ff0a654] user: zlodo branch: trunk, size: 10243
2022-09-02
21:42
  • Implemented a test for variadic functions
  • Fixed a million issues and missing things preventing the above from working
  • Implemented equality operators for types
file: [1cd1e7015f] check-in: [373a6ebd57] user: zlodo branch: trunk, size: 10239
2021-11-26
22:42
  • Fixed adding predicates to a type alias created with using that modified the original type
  • Fixed ambiguous parsing of using expressions that were mistook for overload redefinitions in some cases
file: [a39737bc0a] check-in: [35ff2a536e] user: zlodo branch: trunk, size: 10233
00:37
  • Parser: if an infix rules fails to parse, backtrack
  • Parser: it is now possible to define a contextual "default lhs value"
  • Parser: if an infix operator fails parsing, it is retried as an infix operator, using the default lhs value if there is one available
  • Type predicates: setup @val as the default lhs value inside of the proposition list context, so it is now possible to write u32[<10] instead of u32[@val<10]
file: [757b1fa6be] check-in: [0184a27429] user: zlodo branch: trunk, size: 10142
2021-11-13
14:09
The builder is now passed as the first param of the _DropValue extension point file: [8ca022354e] check-in: [c33b227735] user: zlodo branch: trunk, size: 9679
2021-11-11
20:05
Refactored the code builder: it is now carried around as a Value, and accessed through a bunch of extension points, so we can have different builders (and even user defined ones) later to make classes etc. file: [86f8bef3de] check-in: [1ad61a2717] user: zlodo branch: trunk, size: 9658
2021-10-26
18:43
Type predicates: implemented helper functions to append / filter out type predicate hashes in identities. file: [9ec63f3881] check-in: [d40e6470bf] user: zlodo branch: trunk, size: 9705
2021-09-13
21:52
  • Implemented a generic wrapper for the simple native types that can be embedded in Terms
  • Added more specific overloads for the assignment operator that should work only on builtin types, so that library and user defined types will be able to choose whether they're copyable
  • The EIR representation for all builtin runtime types are now prefixed with "rt_type" to more easily write generic matching rules against them
  • EIR: Fixed long standing bugs in Enumerate and Decompose that surfaced because of the above
  • Miscellaneous code cleaning
file: [f2655c551f] check-in: [51f288ba2a] user: achavasse branch: trunk, size: 9705
2021-09-12
16:48
  • Started work on extensibility api
  • some code cleanup
file: [260bb22707] check-in: [55beba911a] user: achavasse branch: trunk, size: 9727
2021-03-02
22:51
Removed magic "tuple of types to tuple type" conversions and moved them into extension points so that any type can implement similar semantics file: [17660a322b] check-in: [2370e98869] user: achavasse branch: trunk, size: 9733
2021-01-03
18:34
Fixed a bug with addresses computed during compilation time execution. Mutating values through references passed as parameters now works, at compilation time at least. file: [782036bff7] check-in: [3eebbcff0c] user: achavasse branch: trunk, size: 9700
2021-01-02
18:00
Some more renaming. file: [c8ba389518] check-in: [0345b9f807] user: achavasse branch: trunk, size: 9724
2020-07-05
20:15
Implemented reference parsing. file: [7f65098766] check-in: [086a58a7a3] user: achavasse branch: trunk, size: 9739
2020-07-02
00:47
  • Added overloads to the comma operator to be able to construct tuples of references.
  • Fixed reference typechecking rules so that overloads taking values directly have priority over overloads taking references.
  • Fixed a template function expression parsing bug.
file: [2f42d3af62] check-in: [04aea08600] user: achavasse branch: trunk, size: 9745
2020-06-26
23:34
Cleanup:
  • Removed the poorly thought out "domain" system that was intended to allow for different implementations of functions for runtime and for compilation time, which was adding an absurd amount of crap everywhere and should be unnecessary with the current planned approach for implementing data structures.
  • The using statement doesn't do lazy parsing anymore. Lazy parsing is better left to specific constructs that require them (such as function bodies and later on class/structs). This removes the only case of significant newline character in the language.
file: [94fb79e4ad] check-in: [568c366a36] user: achavasse branch: trunk, size: 9710
2020-02-17
23:15
Register temporary values returned from function calls for destruction, so that DestroyValue() is invoked on them. file: [6502993cfb] check-in: [a0ee0dfc2e] user: achavasse branch: trunk, size: 9749
2020-01-11
18:28
  • Moved the cfg and lifetime management stuff into a CodeBuilder object owned by sema::Context. This is in preparation to allow alternative implementations of the builder, for instance to build classes.
  • Pass the context to intrinsic functions, which removes their dependency to the parser the need for the ugly "GetCurrentParser" static function.
file: [80c98fbef0] check-in: [b3aeaae2df] user: achavasse branch: trunk, size: 9748
2020-01-04
15:17
  • verifier: check compilation-time function calls.
  • verifier: improved error messages wording.
file: [969a748d1d] check-in: [353fcc252a] user: achavasse branch: trunk, size: 10011
2019-12-11
15:38
  • Compile-time execution: don't attempt to perform a compile time evaluation of every invocation. Instead, wait until a type is being used by a decl to try and evaluate it.
  • Diagnostics: simplify accordingly (no need for the mode that silences all errors during attempted comptime evaluation)
  • Added some verification conditions to the mandelbrot sample, and created a broken variant as a verification diagnostics test.
file: [7b8622593c] check-in: [b702561850] user: achavasse branch: trunk, size: 10248
2019-11-04
19:53
Verifier: more work on loop verification. file: [fa2ec840f5] check-in: [b4385d9930] user: achavasse branch: trunk, size: 9663
2019-09-26
23:37
Refactored the parsing of verification statements so that it works properly in all cases (regular functions, template functions, function type expressions, lambdas). file: [acd52081ff] check-in: [4fe418f4d0] user: achavasse branch: trunk, size: 9663
2019-09-22
14:37
Project renaming. file: [bd472306d5] check-in: [af650a9e95] user: achavasse branch: trunk, size: 10102
2019-09-21
21:43
  • Implemented the 'requires' and 'ensures' verification statements.
  • Verification statements are lazily parsed even for non template functions, so that they can see functions defined out of order, just like in function bodies.
file: [ff2ebc0e7f] check-in: [2e993951e6] user: achavasse branch: trunk, size: 10108
2019-09-17
22:34
parser: fill in the unparsed verification statements in tfunctype. file: [39fc1d9821] check-in: [035c904764] user: achavasse branch: trunk, size: 9956
20:08
  • parser: add an utility function to retrieve a sub expression in its unparsed form.
  • tfunc type: store a pointer to a vector of unparsed tokens for the verification statements.
file: [b646ce03b7] check-in: [0c3c9488af] user: achavasse branch: trunk, size: 9947
2019-08-27
21:10
When parsing a decl that immediately precedes a paren block (ie a function decl), use a lower precedence than the comma operator, to allow a non-parenthesized tuple to be used as the return type. file: [ce1c2c3ae5] check-in: [0052ff08b3] user: achavasse branch: trunk, size: 9660
20:27
Tuples containing only types or other tuples of types are now considered types. file: [7874bbfd43] check-in: [533d2ce579] user: achavasse branch: trunk, size: 8318
2019-08-26
00:18
Implemented local variable destruction (through the DestroyValue() extension point), and setup proper visibility and lifetime rules for variables declared inside of statements. file: [63e3e107e6] check-in: [c2b2425c0c] user: achavasse branch: trunk, size: 8315
2019-08-21
13:38
  • Automatically compile the samples during the build.
  • Added a --forcecolors to the front-end, since it can't detect whether colors are allowed when launched by Ninja.
  • while: if the condition evaluates to constant true and there is no break statement in the body, use a different code generation strategy to avoid generating a continuation block which makes a return statement mandatory after the loop even though it's unreachable.
file: [d1c515fbdf] check-in: [20d317a921] user: achavasse branch: trunk, size: 7441
2019-08-20
02:09
  • Implemented the ct_char type.
  • Implemented character literals.
  • Replaced the ridiculous hash based stringid implementation to just use string interning instead, which is something I remembered exists (duh)
file: [831788e57b] check-in: [932f41fd6a] user: achavasse branch: trunk, size: 7442
2019-08-18
18:52
  • Implemented the break and the continue statements.
  • Fixed cfg generation issues with nested control statements.
  • Fixed unreachable code error messages not emitted in some cases.
file: [9fe155f4f3] check-in: [a504aedf6c] user: achavasse branch: trunk, size: 7234
2019-08-17
14:49
  • Intrinsics automatically set their domain depending on the domain restrictions of the builtin types that they use.
  • Declaring a local variable of a compile-time only type is now properly rejected during codegen.
  • Improved error messages for operators and extension point invocations.
file: [1a73439854] check-in: [48a020a1fa] user: achavasse branch: trunk, size: 6846
2019-08-15
22:37
  • Fixed some bugs related to dropping values.
  • Implemented local variable declarations with default initialization.
  • codegen: Fixed allocas not properly grouped up at the start of the first basic block of functions.
file: [b5cfd6310a] check-in: [3d8b581261] user: achavasse branch: trunk, size: 6825
01:27
  • Implemented the DropValue() extension point, called when a previously pushed value is dropped without being used.
  • ir, sema: the complexity of an ir expression is now directly counted by ir::Vector, so that we don't have to deal with it in every unification rule (and it was missing from most of them, which caused incorrect overload resolutions in some cases).
file: [3bcd6b7421] check-in: [75bcd81044] user: achavasse branch: trunk, size: 6512
2019-08-14
15:21
Implemented the "InitializeLocalVar" extension point, with a builtin overload for integers. file: [6e7e5fbd90] check-in: [ffbb9276bb] user: achavasse branch: trunk, size: 6433
2019-08-13
21:21
  • Completed the diagnostics renderer.
  • Fixed a few places where value poisoning wasn't correctly propagated.
file: [a61dda02d7] check-in: [ec58d0ff48] user: achavasse branch: trunk, size: 6432
12:14
diagnostics: simplify the code a bit by merging the LocationManager as static methods in Location. file: [2d7129d76a] check-in: [17905bf47a] user: achavasse branch: trunk, size: 6405
00:42
Diagnostics: use value poisoning to (hopefully) fix most cases of superfluous cascading error messages. file: [4940c2ae8e] check-in: [59ecc02baa] user: achavasse branch: trunk, size: 6441
2019-08-12
20:15
  • Implemented a system to temporarily silence error outputs.
  • Syntax errors now silence further errors encountered while parsing the same block and nested children blocks.
  • All errors are also silenced while speculatively attempting to evaluate invocations at compilation time.
file: [51a891ea84] check-in: [972c1d8b47] user: achavasse branch: trunk, size: 6195
2019-08-11
17:18
  • Converted more error messages to the new system.
  • Propagated value locations in some missing places.
  • Added the location of template function calls as diagnostics context.
file: [32603efaab] check-in: [b8548d8b24] user: achavasse branch: trunk, size: 6212
13:36
Ported more error messages to the DiagnosticsManager. file: [023d3b381d] check-in: [157221e014] user: achavasse branch: trunk, size: 5792
01:26
  • ir: created a new type for LocationId which is handled in a specific way so that two LocationIds are always considered equal by pattern matching. This prevent the values' locationIds stored in ir expressions from fucking up everything.
  • propagate value locations in a few places: in the parser, when resolving invocations and when doing eager evaluation. There are probably a lot of other places still missing.
  • converted all the builtin statements to use the DiagnosticsManager.
file: [febf1f252e] check-in: [2efa23555d] user: achavasse branch: trunk, size: 5748
2019-08-10
20:15
parser: custom parsing rules are now passed the location id of the value that resolved to them. file: [44f4df547d] check-in: [e7fce87609] user: achavasse branch: trunk, size: 5625
19:33
Implemented a DiagnosticsContext class which can be used to push contextual informations that are printed when an error is emitted. file: [c8ee40534e] check-in: [ffa2c830dd] user: achavasse branch: trunk, size: 5706
14:26
Refactored the lexer (and the resolver) to output Terms associated with location Ids. file: [b73af13fa5] check-in: [c4abb2a3ed] user: achavasse branch: trunk, size: 5626
2019-08-09
19:54
Cleanup: got rid of the half-assed location and poisoning systems in ir::Terms. file: [2456258c8c] check-in: [aee388d9c0] user: achavasse branch: trunk, size: 5585
2019-08-08
14:29
Implemented the assignment operator of an expression to a decl of the same type, which declares and initialize a local variable. file: [31597e0a8d] check-in: [90ab7b489f] user: achavasse branch: trunk, size: 5618
2019-08-05
17:46
Implemented a wrapper around llvm::APSInt for compile time integers to manage mixing operations on integers of different bitsizes, and to automatically extend them as needed. file: [bef5bb0d42] check-in: [2bee844d3c] user: achavasse branch: trunk, size: 5572
2019-08-03
17:16
  • lexer: handle hex and binary integer literals.
  • builtins: implemented the logic and the compile-time bitwise xor operator.
file: [dd432e3c24] check-in: [bd7954bf0c] user: achavasse branch: trunk, size: 5624
2019-08-01
21:11
parser: implemented ComplexValue, which is a value bundled with a CFG whose execution or insertion is a prerequisite to use the value. file: [af828bfa2f] check-in: [79a134aa8e] user: achavasse branch: trunk, size: 5602
2019-07-31
14:05
Fixed some cyclic reference issues with cyclic CFGs:
  • Moved and renamed sema::CFGBuilder to llr::CFG.
  • llr::Func now owns a CFG pointer, rather than a pointer to its entry BB.
  • Branch and CondBranch now store weak pointers to their target BB.
file: [6ed25d6b3d] check-in: [d19a6bf065] user: achavasse branch: trunk, size: 5572
00:07
Compile time integers are now represented with infinite precision by using llvm::APSInt. file: [275ccf6ca9] check-in: [9988bc3dc8] user: achavasse branch: trunk, size: 5586
2019-07-30
20:20
Implemented the if statement. file: [6338d24d3e] check-in: [866b8caaca] user: achavasse branch: trunk, size: 5581
2019-07-09
22:46
codegen: added builtin functions to create a module and to dump it as llvm assembly text. file: [a502f16816] check-in: [429f55ae3c] user: achavasse branch: trunk, size: 5546
2019-07-07
16:22
Parser: parse function type modifiers. file: [746f1fa0b1] check-in: [105ba83ebf] user: achavasse branch: trunk, size: 5515
2019-04-14
14:53
Fixed a few bugs and started to turn the haphazard test code into proper, automated tests of the core language features. file: [fb88cd47e9] check-in: [f78ccdd8a8] user: achavasse branch: trunk, size: 5405
2019-04-12
19:37
  • cleaned up and refactored llr into a proper cfg representation.
  • added a CFG builder class in sema, currently very rudimentary.
  • split the parser's value building workflow from the llr construction workflow, which now goes through a CFG builder.
  • implemented the return statement.
file: [76c9bef5bd] check-in: [5ea39472a2] user: achavasse branch: trunk, size: 5431
2019-03-30
15:30
  • Changed type's type representation to be able to pass types around as value anywhere.
  • Fixed a bunch of bugs.
file: [75a8dce6b5] check-in: [0e66d22527] user: achavasse branch: trunk, size: 5718
2019-03-27
22:46
Template: recognize template function types as texprs, so they can be used in parameter declarations. file: [1ef3a3e219] check-in: [302667d2d9] user: achavasse branch: trunk, size: 5746
2019-03-16
23:19
Overloading: parse function overloading, and multiple fixes. Overloading now works. file: [276edda2ce] check-in: [9089b014a2] user: achavasse branch: trunk, size: 5746
2019-03-02
21:01
Function calls are now eagerly evaluated during parsing. file: [256f5e80b5] check-in: [8a8e76084e] user: achavasse branch: trunk, size: 5485
2019-02-23
17:04
Templates: parse template function types, expressions and declarations. file: [88e6e15f40] check-in: [bc7b56fb86] user: achavasse branch: trunk, size: 5012
2019-02-20
22:34
Implemented the colon infix operator to explicitely build a Decl, TDecl or TNamedDecl. It will be useful in the future to build TDecls with a more complex TExpr than just a TVar on the rhs, it can be omitted otherwise. file: [510d0abae1] check-in: [c22f37bc75] user: achavasse branch: trunk, size: 5017
20:42
Templates: parse template named decls (like regular decls, but with a TExpr instead of a type). file: [df09441de2] check-in: [6a9c80643f] user: achavasse branch: trunk, size: 5144
2019-02-18
21:54
Parser:
  • Make the resolver skip newlines by default, and provide an additional "raw" api to retrieve unresolved tokens without skipping newlines.
  • Parsing rules now only return a bool to indicate whether they were successful, and can push any number of values themselves as needed.
  • Stop trying to shoehorn implicit separators in the pratt parser. Instead, use the pratt parser only for expressions, and use a different parsing loop for sequences of expressions (ie for brace blocks and top level).
file: [d265505fd5] check-in: [23e0cd5dc7] user: achavasse branch: trunk, size: 4795
2019-02-11
22:44
  • Resolver: implemented an utility function to gather blocks as lists of tokens without parsing them, for when we want to perform lazy parsing.
  • Parser: fixed some bugs with the current delimiter getting lost in nested parsers, which caused spurious misplaced end delimiter error messages.
file: [7725921ed0] check-in: [91eda406ef] user: achavasse branch: trunk, size: 4837
2019-02-04
21:41
Parser: parse function type expressions. file: [e3ffb019c9] check-in: [63faac8273] user: achavasse branch: trunk, size: 4717
2019-02-03
21:35
  • Moved decl and function invocation rules out of sema and into builtins, as it makes more sense.
  • Implemented a helper to determine if a tuple is a valid parameter list.
file: [3e5aff3711] check-in: [2e672cd033] user: achavasse branch: trunk, size: 4362
12:01
Parser: parse decls. file: [87d28da343] check-in: [bbef786dbb] user: achavasse branch: trunk, size: 4358
2019-01-31
20:29
Builtins: implemented the semicolon operator. file: [cf2827d1b3] check-in: [0ebd777925] user: achavasse branch: trunk, size: 3783
20:08
Parser: handle implicit statement separation. file: [a195790560] check-in: [53c43bd74d] user: achavasse branch: trunk, size: 3541
2019-01-30
22:39
First draft of the compile-time interpreter. A simple builtin function call works. file: [d070f0ff18] check-in: [b844506db4] user: achavasse branch: trunk, size: 3439
2019-01-27
16:05
Sema: added a placeholder implementation for the function invocation rule. file: [8a42873bd5] check-in: [61cece933d] user: achavasse branch: trunk, size: 3408
2019-01-24
14:32
Refactored c++ <-> value conversions into a centralized api that can be invoked through generic code. This will be needed to wrap native compile-time functions. file: [e3080be824] check-in: [58cc4d39e9] user: achavasse branch: trunk, size: 3482
2019-01-23
15:51
Parser: parenthese blocks. file: [1a5b3e9247] check-in: [13f2fade56] user: achavasse branch: trunk, size: 3638
13:35
Parser: fixed a couple of error handling issues. file: [89a44a5794] check-in: [81d676111f] user: achavasse branch: trunk, size: 4037
2019-01-22
22:46
Builtins: implemented the comma operator. file: [65f703a037] check-in: [5aab57179e] user: achavasse branch: trunk, size: 3957
2019-01-20
17:59
Parser: added helpers to register parsing rules for prefix operators, postfix operators, and infix operators (either left or right associative). file: [d3a0219264] check-in: [3e4339b34a] user: achavasse branch: trunk, size: 3488
16:45
Parser: when the resolver yields custom parsing rules wrapped as values, invoke them. file: [265bcd31c1] check-in: [15b15050d1] user: achavasse branch: trunk, size: 3484
2019-01-19
14:11
Parser: undefined identifiers. file: [a47f5cf350] check-in: [ca60f1c1d0] user: achavasse branch: trunk, size: 2125
13:59
Parser: literals. file: [86371c0295] check-in: [f3ac0d15e2] user: achavasse branch: trunk, size: 1796
2019-01-18
16:19
Added: Parser: implemented the Pratt parser skeleton. file: [091a885d69] check-in: [73972ef6be] user: achavasse branch: trunk, size: 1459