Commit Graph

418 Commits

Author SHA1 Message Date
0e0871bc38 nac3core, artiq: to_basic_value_enum takes an argument indicating the expected type 2022-04-10 01:28:22 +08:00
26187bff0b nac3core: add missing bound check and negative index handling for list subscription assignment 2022-04-09 04:56:31 +08:00
c29cbf6ddd nac3core: add bound check for list slice 2022-04-05 18:21:46 +08:00
7443c5ea0f nac3core: add location information to codegen context 2022-04-05 18:21:46 +08:00
710904f975 nac3core: fix powi with negative integer power 2022-04-04 22:10:56 +08:00
2edeb31d21 nac3core: do not get llvm value too eagerly for kernel invariant 2022-03-31 10:28:16 +08:00
c3156afebd nac3core: fix broken tests 2022-03-30 04:05:47 +08:00
388c9b7241 nac3core: better check and err msg for default param 2022-03-30 04:05:47 +08:00
6ab73a223c nac3core/artiq: support default param of option type 2022-03-30 04:05:47 +08:00
a38cc04444 nac3core: assert statement 2022-03-29 06:56:40 +08:00
1f5826d352 fix ternary if (#250)
Use store and load to handle if expression as the blocks might be changed when generating sub-expressions.

Reviewed-on: M-Labs/nac3#250
Co-authored-by: ychenfo <yc@m-labs.hk>
Co-committed-by: ychenfo <yc@m-labs.hk>
2022-03-29 06:54:00 +08:00
8d7e300a4a nac3core: do not use const struct for tuple 2022-03-27 10:13:17 +08:00
10d623e36f nac3core/artiq: fix tuple representation 2022-03-27 07:47:14 +08:00
1a82d296e7 nac3core/codegen: prevent users from modifying loop counter
Fixes #211
2022-03-26 20:58:37 +08:00
bf067e2481 nac3artiq: implement attribute writeback
We will only writeback attributes that are supported by the current RPC
implementation: primitives, tuple and lists of lists... of primitives.
2022-03-26 20:13:58 +08:00
26a4834254 fix warnings 2022-03-26 18:52:08 +08:00
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
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
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
be75fa7368 nac3core: fix assign to constant 2022-03-24 07:13:13 +08:00
d9be8d3978 nac3core/typecheck/unification_table: fixed snapshot restore bug
Closes 229
2022-03-23 00:25:10 +08:00
41d62f7325 nac3core/toplevel: fixed typevar substitution bug 2022-03-23 00:25:10 +08:00
9332d1643c irrt: normalize end-of-line characters. Closes #231 2022-03-22 16:04:48 +08:00
718b076e50 irrt: use __builtin_alloca 2022-03-22 15:41:25 +08:00
9d86b46e86 nac3core: add DEBUG_DUMP_IRRT 2022-03-22 15:39:15 +08:00
b97c016629 nac3core: fixed test breakage 2022-03-18 16:52:28 +08:00
35ac5cb6f6 nac3core: fixed typevar bug 2022-03-18 01:07:44 +08:00
0ca2797428 fix compilation warning 2022-03-17 21:31:45 +08:00
c5993c2a58 composer: improve class field typevar error message 2022-03-17 21:04:42 +08:00
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
e126fef012 nac3artiq: support more builtin errors 2022-03-16 23:42:08 +08:00
2f85bb3837 nac3core: impl call attributes
sret for returning large structs, and byval for struct args in extern
function calls.
2022-03-09 22:09:36 +08:00
5006028e2d nac3core: abs builtin function 2022-03-08 23:23:36 +08:00
8241a29908 nac3core: max builtin function 2022-03-08 22:22:00 +08:00
adb5c69e67 nac3core: min builtin function 2022-03-08 21:59:37 +08:00
f7e62ab5b7 nac3ast/parser/core: use i128 for u64 constants 2022-03-08 18:21:14 +08:00
9f6c7b3359 nac3core: type conversion to/from uint 2022-03-08 13:42:45 +08:00
142e99a0f1 nac3core: fix broken tests 2022-03-08 13:34:08 +08:00
79c469301a basic unsigned integer support 2022-03-08 13:34:02 +08:00
8602852241 nac3core: use signed extension to convert i32 to i64 2022-03-06 04:49:02 +08:00
42fbe8e383 nac3core: fix err msg of too many args 2022-03-05 03:59:45 +08:00
63b0f29728 Fix broken tests 2022-03-05 00:27:51 +08:00
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
59ac5aae8a fix error message string (2) 2022-03-02 08:33:13 +08:00
da039e3acf fix error message string 2022-03-02 08:04:15 +08:00
323d77a455 nac3artiq: improve error message for out of range error 2022-02-28 23:09:14 +08:00
5d8e87d923 more readable type annotation error string 2022-02-28 16:24:03 +08:00
846d1726ef nac3core: fixed keyword arguments handling 2022-02-26 16:34:30 +08:00
0686e83f4c nac3core/typecheck: fixed incorrect rollback 2022-02-25 20:01:11 +08:00
e710b6c320 nac3core: fix exception final branch handling
According to https://github.com/m-labs/artiq/pull/1855
Passed the test cases from 1855.
Fixes #196.
2022-02-25 17:42:47 +08:00