Commit Graph

167 Commits

Author SHA1 Message Date
z78078 ebd25af38b nac3standalone: allow classes without explicit init (#221)
Reviewed-on: #304
Co-authored-by: z78078 <cc@m-labs.hk>
Co-committed-by: z78078 <cc@m-labs.hk>
2022-07-07 10:36:25 +08:00
ychenfo ffac37dc48 nac3core: fix exception type in primitive store 2022-05-29 19:14:00 +08:00
Sebastien Bourdeauducq a321b13bec fix typos 2022-04-27 11:08:10 +08:00
wylited 35b6459c58 nac3core: replace paramter with parameter 2022-04-13 15:42:26 +08:00
wylited e94b25f544 spelling (#264)
Co-authored-by: wylited <ds@m-labs.hk>
Co-committed-by: wylited <ds@m-labs.hk>
2022-04-13 11:32:31 +08:00
Sebastien Bourdeauducq f5a6d29106 update insta snapshots 2022-04-12 09:56:49 +08:00
Sebastien Bourdeauducq ca07cb66cd format typevars consistently 2022-04-12 09:28:17 +08:00
ychenfo 0e0871bc38 nac3core, artiq: to_basic_value_enum takes an argument indicating the expected type 2022-04-10 01:28:22 +08:00
ychenfo c29cbf6ddd nac3core: add bound check for list slice 2022-04-05 18:21:46 +08:00
ychenfo c3156afebd nac3core: fix broken tests 2022-03-30 04:05:47 +08:00
ychenfo 388c9b7241 nac3core: better check and err msg for default param 2022-03-30 04:05:47 +08:00
ychenfo 6ab73a223c nac3core/artiq: support default param of option type 2022-03-30 04:05:47 +08:00
ychenfo 26a4834254 fix warnings 2022-03-26 18:52:08 +08:00
ychenfo 80631fc92b Option type support (#224)
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2022-03-26 15:09:15 +08:00
pca006132 24a26b53ae nac3core/toplevel: fixed broken tests
We should not include class type variables in functions type variables.
2022-03-24 21:33:09 +08:00
pca006132 1084ba2158 nac3core: fixed typevar with finite range
1. Function type variables should not include class type variables,
   because they are not bound to the function.
2. Defer type variable constraint evaluation until we get all fields
   definition.
2022-03-24 21:31:51 +08:00
pca006132 41d62f7325 nac3core/toplevel: fixed typevar substitution bug 2022-03-23 00:25:10 +08:00
pca006132 b97c016629 nac3core: fixed test breakage 2022-03-18 16:52:28 +08:00
pca006132 35ac5cb6f6 nac3core: fixed typevar bug 2022-03-18 01:07:44 +08:00
Sebastien Bourdeauducq 0ca2797428 fix compilation warning 2022-03-17 21:31:45 +08:00
Sebastien Bourdeauducq c5993c2a58 composer: improve class field typevar error message 2022-03-17 21:04:42 +08:00
pca006132 642e3b2bad nac3core: moved all builtin errors to nac3artiq code
This remove the need for hard-coding those definition IDs.
2022-03-17 00:04:49 +08:00
pca006132 e126fef012 nac3artiq: support more builtin errors 2022-03-16 23:42:08 +08:00
ychenfo 5006028e2d nac3core: abs builtin function 2022-03-08 23:23:36 +08:00
ychenfo 8241a29908 nac3core: max builtin function 2022-03-08 22:22:00 +08:00
ychenfo adb5c69e67 nac3core: min builtin function 2022-03-08 21:59:37 +08:00
ychenfo f7e62ab5b7 nac3ast/parser/core: use i128 for u64 constants 2022-03-08 18:21:14 +08:00
ychenfo 9f6c7b3359 nac3core: type conversion to/from uint 2022-03-08 13:42:45 +08:00
ychenfo 79c469301a basic unsigned integer support 2022-03-08 13:34:02 +08:00
ychenfo 8602852241 nac3core: use signed extension to convert i32 to i64 2022-03-06 04:49:02 +08:00
pca006132 63b0f29728 Fix broken tests 2022-03-05 00:27:51 +08:00
pca006132 294943e303 nac3core: get exception ID from symbol resolver
We need to store the exception class somewhere in order to create them
back in the host. Fixes #200
2022-03-05 00:26:35 +08:00
Sebastien Bourdeauducq da039e3acf fix error message string 2022-03-02 08:04:15 +08:00
pca006132 323d77a455 nac3artiq: improve error message for out of range error 2022-02-28 23:09:14 +08:00
Sebastien Bourdeauducq 5d8e87d923 more readable type annotation error string 2022-02-28 16:24:03 +08:00
Sebastien Bourdeauducq 17792b76b7 rename exception symbols 2022-02-23 11:04:35 +08:00
pca006132 3ad25c8f07 nac3core: sort error messages for determinism 2022-02-22 14:33:43 +08:00
pca006132 f97f93d92c applied rustfmt and clippy auto fix 2022-02-21 18:27:46 +08:00
pca006132 d9cb506f6a nac3core: refactored for better error messages 2022-02-21 18:24:19 +08:00
pca006132 352831b2ca nac3core: removed legacy location definition 2022-02-13 22:39:24 +08:00
pca006132 21d9182ba2 nac3core: disallow methods/fields in Exception subclass
Fixes #192
2022-02-13 21:45:22 +08:00
pca006132 b18626b149 Fix compilation and test failures 2022-02-12 22:50:32 +08:00
pca006132 e303248261 nac3core: exception type check and codegen 2022-02-12 22:50:32 +08:00
pca006132 b267a656a8 nac3core: added exception type and fixed primitive representation
- Added `Exception` primitive type and some builtin exception types.
  Note that all exception types share the same layout, and should
  inherit from the base `Exception` type. There are some hacks in the
  toplevel module for handling exception types, we should revisit and
  fix them later.
- Added new primitive types to concrete type module, otherwise there
  would be some weird type errors.
- Changed the representation of strings to CSlice<u8>, instead of
  CString.
2022-02-12 22:13:59 +08:00
pca006132 050c862c1a nac3core: function codegen callback changes
Added code generator argument to the callback, so it would be easier to
write complicated codegen with that callback. To prepare for RPC
codegen.
2022-02-12 21:24:41 +08:00
Sebastien Bourdeauducq 1288624218 lock insta version (#179) 2022-01-31 15:18:49 +08:00
Sebastien Bourdeauducq de065cfa14 update dependencies 2022-01-31 12:28:40 +08:00
ychenfo ae8f82ccb0 nac3core: fix broken tests 2022-01-14 16:28:37 +08:00
ychenfo 4a1a4dc076 nac3core/artiq/standalone: symbol resolver return error msg for type error of host variables 2022-01-14 16:28:34 +08:00
ychenfo 4976e89ae2 nac3core: list slice support 2022-01-13 16:53:32 +08:00