Commit Graph

126 Commits

Author SHA1 Message Date
gingerBill
4b831dbddd Try try and or_else built-in procedures with operators try and try else 2021-07-04 12:37:21 +01:00
gingerBill
574ceb37a9 Correct selector call expression chaining behaviour (a bit of a hack) 2021-06-16 17:04:05 +01:00
gingerBill
f19bb0f4d4 Make default calling convention code more correct to read 2021-06-08 14:33:49 +01:00
gingerBill
795a5910cf Add support for Addressing_OptionalOkPtr
Allowing for `i, ok := &x.(T);` (type assertions) and `v, ok := &m[k];` (map indexing)
2021-06-06 12:18:45 +01:00
gingerBill
599d18f26f Experimental support for inline swizzling for array types of len <= 4 e.g. v.xyz, v.argb, v.xxx 2021-06-05 17:22:39 +01:00
gingerBill
9c54ed5792 Add range-based error messages to -verbose-errors
Example:
Cannot convert '(1 + 2)' to 'untyped bool' from 'untyped integer'

	x := (1 + 2) * true;
	     ^~~~~~^
2021-05-19 14:15:57 +01:00
gingerBill
7b7081d607 Remove old dead code 2021-05-15 18:59:54 +01:00
gingerBill
63b54ce7c6 Add minor ignoring hint on type assertions to get better code generation with no optimizations enabled 2021-05-13 12:48:12 +01:00
gingerBill
c81f7b31c6 Add explicit numbers to enum AddressingMode 2021-05-12 23:22:43 +01:00
gingerBill
278de3a92f Unify AstTernaryExpr with AstTernaryIfExpr
Allow for both syntaxes `x if cond else y` and `cond ? x : y`
Removes the confusing semantics behind `?:` which could be `if` or `when` depending on the context.
2021-05-05 15:22:54 +01:00
gingerBill
24fce21d90 Add "naked" calling convention (removes prologue and epilogue) 2021-04-28 10:49:30 +01:00
gingerBill
c29b643a58 Move out some intrinsics into separate procedures in llvm_backend.cpp; Rename InlineRangeStmt to UnrollRangeStmt (eventually merge the two AST nodes) 2021-04-24 15:00:01 +01:00
gingerBill
47c7dc6a9b Add new intrinsics: debug_trap, trap, read_cycle_counter, expect 2021-04-22 10:35:17 +01:00
gingerBill
f1bdd2e60f Improve #optional_ok logic for procedures; Add #optional_second for package runtime usage 2021-04-19 22:31:14 +01:00
gingerBill
fbd01660ee Experiment with new grammatical parsing rule for expression level (-strict-style) idea 2021-03-30 11:48:32 +01:00
gingerBill
0e3ecc350a Make the parser support as many identifiers on the LHS in for in loops to improve error messages 2021-03-24 12:11:00 +00:00
gingerBill
15dbc99cb9 Minimize TokenPos size by using i32 for line/column/offset and file_id instead of String
To make `i32` safe, the parser limits the file size of odin files to a maximum of 2GiB (which will be good enough for the vast vast majority of cases)
2021-03-04 16:45:30 +00:00
gingerBill
2d88c6c6a5 Begin work on aarch64 ABI for -llvm-api 2021-02-24 16:49:19 +00:00
gingerBill
8f9111e552 Build tag to make all declarations within a file private to the package //+private 2021-02-23 20:40:48 +00:00
gingerBill
41b854f192 Remove #opaque types 2021-02-23 15:45:06 +00:00
gingerBill
28f279329d Remove bit_field keyword and parsing logic 2021-02-23 15:29:54 +00:00
gingerBill
28ed310f31 Remove "pure" and "pure_none" calling conventions 2021-02-23 13:10:23 +00:00
gingerBill
c653e400db Add extra error checking in parser.cpp 2021-01-15 16:15:03 +00:00
gingerBill
6416a6f39c Allow string literals for [N]byte 2020-11-20 16:01:59 +00:00
gingerBill
9408eb9580 Update odin doc to support multiple package outputs by passing multiple paths; Replace -all with -short
Example:
odin doc core/path core/path/filepath
2020-11-18 23:22:27 +00:00
gingerBill
2bd0fd932a Begin rudimentary work on implementing odin test tooling with *_test.odin files 2020-11-17 18:50:30 +00:00
gingerBill
ca4b0527e8 Minimize memory usage for AST nodes by using Slice<T> rather than Array<T> when the parameter doesn't need to grow 2020-11-16 15:18:25 +00:00
gingerBill
adf6c85fd3 Minimize Ast flags usage 2020-11-16 01:42:30 +00:00
gingerBill
3c1c10a178 Begin clarifying allocation patterns by changing from heap_allocator to specific arenas 2020-11-15 18:08:52 +00:00
gingerBill
4629754f7c Inline asm expression (-llvm-api)
See https://llvm.org/docs/LangRef.html#inline-assembler-expressions
Example:
```
x := asm(i32) -> i32 {
    "bswap $0",
    "=r,r",
}(123);
```
Allowed directives `#side_effect`, `#align_stack`, `#att`, `#intel` e.g. `asm() #side_effect #intel {...}`
2020-10-24 16:32:37 +01:00
gingerBill
b1bdd95f19 Begin work on making packages import assembly sort files (.S) 2020-10-16 15:32:09 +01:00
gingerBill
289908e0b8 Add +build ignore tag 2020-10-15 16:25:57 +01:00
gingerBill
c1149dbdee Update math and math/linalg; add "pure_none" calling convention 2020-09-10 15:00:19 +01:00
gingerBill
df3690c32a Revert accidental removal of #const for procedure variable parameters #718 2020-08-26 22:46:54 +01:00
gingerBill
c18fc2da9f Remove some dead code 2020-07-14 16:36:33 +01:00
gingerBill
1a0614b0d7 Improve performance of tokenization and parsing 2020-05-27 18:23:37 +01:00
gingerBill
aa029fe8d9 Add "pure" procedure types 2020-05-23 13:38:06 +01:00
gingerBill
7bd1039a49 Selector Call Expressions: x->y(123) == x.y(x, 123) 2020-05-22 14:54:30 +01:00
gingerBill
d09ac8943a Minor fixes to improve hash map/set performance 2020-05-21 16:27:40 +01:00
gingerBill
ff92eb9112 Relative pointers 2020-05-15 17:37:00 +01:00
gingerBill
af1d4d6e72 Implement Allow .? operator to unwrap any union #549 2020-05-14 00:00:10 +01:00
gingerBill
e27f5796d6 Add experimental atom op tables for llvm-backend 2020-05-02 18:45:57 +01:00
gingerBill
97f7a558fa #optional_ok tag for procedures 2020-04-19 21:45:04 +01:00
gingerBill
f09b6a4c90 Simplify compiler's Map and create a StringMap specifically for strings 2020-04-13 13:02:30 +01:00
gingerBill
d0b913dad1 Add extra internal memory analysis 2020-04-06 12:17:54 +01:00
gingerBill
db7a3ffd2a Merge branch 'master' into llvm-integration 2020-03-05 21:12:16 +00:00
gingerBill
e92fdb4a99 x if cond else y and x when cond else y expressions 2020-03-05 20:34:30 +00:00
gingerBill
8ec5987ae1 Merge branch 'master' into llvm-integration 2020-02-29 09:55:25 +00:00
gingerBill
3d74c2f6c0 Add proc(#const x: Type) to enforce a constant parameter (but not polymorphic) to a procedure 2020-02-26 22:53:40 +00:00
gingerBill
2180f4a475 Basic work on obj generation 2020-02-23 10:04:25 +00:00