Richard Feldman
b2ea0b842c
Revert "Do some checked SoA stuff"
...
This reverts commit c79d7745f6eb345fd50a7cb4a2a7dd6fb6f8f1fc.
2024-10-21 22:10:43 -04:00
Richard Feldman
a8d3280b02
Do some checked SoA stuff
2024-10-21 22:10:42 -04:00
hrishisd
cb98c45e88
Remove deprecated string interpolation syntax
2024-10-08 16:31:22 -04:00
Sam Mohr
2da08be8ef
Remove old record builder syntax
2024-09-21 04:44:44 -07:00
snobee
e82dd43465
Merge remote-tracking branch 'upstream/MAIN' into early-return-if-else
2024-09-06 17:11:28 -07:00
Elias Mulhall
19931ecd43
Support passing values into dbg
with the pipe operator
...
In order to desugar `dbg` in a pipeline we need to allow a bare `dbg`
node in desugaring and only report it as an error if the bare node
survives to the next step of canonicalization. This means we move the
error code out of `desugar_expr` and into `canonicalize_expr`. This is
much simpler to do now that these functions use the same `env` struct,
since previously we would have had to pass down extra args to
`canonicalize_expr`. Sharing the `env` struct means that we also don't
have to worry about calculating `line_info` more than once.
2024-09-05 20:13:54 -04:00
snobee
a7afac7ac7
Add boolean flag to Expr::If for indented else statement
2024-09-05 16:28:44 -07:00
Anton-4
02cf61f985
Merge pull request #7038 from mulias/expr-dbg
...
Support `dbg` in expressions
2024-09-02 13:30:32 +02:00
Elias Mulhall
56c5b790a7
Refactor dbg expression parsing to work more like function application
...
Instead of parsing dbg with an expression block, parse the dbg keyword
with no additional arguments. This way the parser treats dbg just like a
variable in function application. We desugar by pattern matching on
`Apply(Dbg, args, called_via)` nodes. This changes the output of syntax
tests since the initial AST is different, but does not change the output
of can or mono.
Add two new errors for dbg in expression position with either no args or
too many args. This is similar to the error behavior of `crash`.
Continue to parse dbg statements with an expression block, as before.
2024-08-29 15:36:48 -04:00
Elias Mulhall
9dae102603
Allow dbg expression inside string interpolation
2024-08-28 11:53:44 -04:00
Elias Mulhall
335265e15c
Parse dbg in expression position
...
Add dbg parsing logic everywhere we parse normal expressions. Add
special case to statement parsing to handle a series of statements
ending in a `dbg` in expression position.
Rename existing `dbg_help` function to `dbg_stmt_help`, similarly rename
syntax snapshot test files to specify which ones are for dbg statements.
2024-08-28 11:53:44 -04:00
Agus Zubiaga
287a8fa2e7
Merge branch 'main' into lower-module-params
2024-08-28 08:50:40 -03:00
Agus Zubiaga
49a6b1bfba
Capture whole params record when needed
2024-08-27 11:20:59 -03:00
Agus Zubiaga
80770fae11
Handle aliases at call instead
2024-08-27 02:51:23 -03:00
Agus Zubiaga
36df43fadc
Handle simple aliased fn in params value def
2024-08-27 01:27:54 -03:00
Agus Zubiaga
b667753a32
Capture import params def
2024-08-26 23:31:42 -03:00
Agus Zubiaga
2f4e80b696
Gather arities while building can declarations
2024-08-26 22:39:35 -03:00
Agus Zubiaga
50887e6265
Capture params in nested defs
2024-08-17 16:13:44 -03:00
Agus Zubiaga
e80e3e5b2d
Convert top-level value def to fn taking params
2024-08-17 11:21:21 -03:00
Agus Zubiaga
7a8b9f7d6d
Add variable to ParamsVar
2024-08-16 20:54:16 -03:00
Sam Mohr
b1a972ab21
Implement &foo
record updater syntax sugar
2024-08-16 01:41:59 -07:00
Sam Mohr
0fd0cc11aa
Format code
2024-08-14 22:26:32 -07:00
Sam Mohr
3bc5c1dc12
Combine ! and ? into single TrySuffix AST node
2024-08-14 22:14:08 -07:00
Agus Zubiaga
762799052e
Merge branch 'main' into typecheck-module-params
2024-08-07 18:55:33 -03:00
Sam Mohr
cb8040f629
Ignore underscore-prefixed fields in record builders
2024-08-06 22:49:35 -07:00
Sam Mohr
fe1b6d71fc
Update from PR comments
2024-07-07 18:33:20 -07:00
Sam Mohr
f415017c90
Implement new builder syntax alongside old one
2024-07-07 03:28:59 -07:00
Agus Zubiaga
0cbb352a89
Move unexpected params warning to solve
2024-07-06 21:36:26 -03:00
Agus Zubiaga
63e722f61d
Rename symbol and module lookup struts
2024-07-06 11:42:53 -03:00
Agus Zubiaga
f80cb341a6
Move ScopeModules to can
2024-07-05 21:35:52 -03:00
Agus Zubiaga
922b1c44ef
Report missing params
2024-07-02 11:10:00 -03:00
Agus Zubiaga
db76ab4015
Replace params in abilities TODOs with unimplemented!
2024-07-02 11:09:59 -03:00
Agus Zubiaga
5ec4b042bb
Constrain and solve import params
...
No reporting yet
2024-07-02 04:10:46 -03:00
Agus Zubiaga
674adf1fad
Wrap import params expr so we can constrain later
2024-07-02 04:10:46 -03:00
Agus Zubiaga
1526fc4aee
can::Expr::ParamsVar for lookups with params
2024-07-02 04:10:44 -03:00
Agus Zubiaga
5aebb7b570
Unqualified lookups return params
2024-07-02 04:10:44 -03:00
Agus Zubiaga
9d26adb228
Qualified lookups return params
2024-07-02 04:10:44 -03:00
Agus Zubiaga
96e2d32fa6
Canonicalize import params record
2024-07-02 04:10:44 -03:00
Kiryl Dziamura
de9ed734c5
remove EmptyDefsFinal
2024-07-01 18:45:23 +02:00
Kiryl Dziamura
967da48969
Fix typo
2024-06-03 16:58:40 +02:00
Agus Zubiaga
a8a829aadd
Merge branch 'main' into inline-imports
2024-04-28 00:11:29 -03:00
Luke Boswell
74e531b994
remove suffixed from Ident::Access and cleanup
2024-04-28 08:48:08 +10:00
Luke Boswell
2fe03e6c91
remove suffixed from Expr::Var
2024-04-28 08:47:08 +10:00
Joshua Warner
6080c12ca8
Parse !
suffixes as an Expr::TaskAwaitBang instead of using suffix field in ident
2024-04-28 08:47:07 +10:00
Agus Zubiaga
7efc7a4a3e
Canonicalize ingested files directly instead of creating AST nodes
2024-04-23 18:55:41 -03:00
Agus Zubiaga
5112e064e5
Add module_path to can env instead of threading it through
2024-04-21 10:30:34 -03:00
Agus Zubiaga
d5a38a26db
Merge branch 'main' into inline-imports
2024-04-20 12:01:11 -03:00
Luke Boswell
129ca94733
remove unit type from EmptyDefsFinal
2024-04-14 13:45:07 +10:00
Luke Boswell
c32fa5b600
support optional suffied last def
2024-04-14 13:45:06 +10:00
Luke Boswell
8b9e08bd76
WIP try simplification
2024-04-14 13:45:05 +10:00