Commit Graph

478 Commits

Author SHA1 Message Date
gingerBill
fbd01660ee Experiment with new grammatical parsing rule for expression level (-strict-style) idea 2021-03-30 11:48:32 +01:00
gingerBill
a611cf545d Add basic error correction in parser to check for unattached else 2021-03-26 11:39:46 +00:00
gingerBill
a5329ae48c Add better package declaration specific error message (#878) 2021-03-24 14:34:30 +00: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
ccd078620b Improve error message in parser 2021-03-23 23:05:00 +00:00
gingerBill
08f7d3edbe Allow $ in polymorphic record parameter fields (but disallow mixing) 2021-03-23 22:59:10 +00:00
gingerBill
f5142aaec4 Change from test_* prefix to @(test) attribute for odin test 2021-03-14 18:43:21 +00:00
gingerBill
2aa588209e odin test to work with the new core:testing package 2021-03-14 18:01:31 +00:00
gingerBill
8cc4cba06c Add support for backslash \ to consume a newline 2021-03-14 12:53:57 +00:00
gingerBill
8f6439fa6b Simplify expect_semicolon_newline_error rule 2021-03-13 23:17:56 +00:00
gingerBill
81efd2dc64 Remove && false from test code 2021-03-13 21:39:33 +00:00
gingerBill
b5c0c68615 Add -strict-style flag: Enforces code style stricter whilst parsing, requiring such things as trailing commas 2021-03-13 21:20:46 +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
82275082ff Add #force_inline parsing directly to expression statements 2021-02-25 10:01:12 +00:00
gingerBill
4a69bfada1 Remove #force_inline for and only have #unroll for 2021-02-25 09:55:48 +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
533dde4648 Add deprecation message for inline and no_inline to use #force_inline and #force_no_inline instead 2021-02-23 16:22:28 +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
fe33a64b2e Remove #opaque usage in core library 2021-02-23 15:21:05 +00:00
gingerBill
a1693c0184 Deprecate inline for in favour of #unroll for 2021-02-23 14:45:15 +00:00
gingerBill
908a403d78 Add #force_inline, #force_no_inline and #unroll for the transition to deprecate and then remove the keywords inline and no_inline
`inline for` will be replaced with `#unroll for`
2021-02-23 14:37:05 +00:00
gingerBill
28ed310f31 Remove "pure" and "pure_none" calling conventions 2021-02-23 13:10:23 +00:00
gingerBill
a652c24ac3 Remove opaque keyboard 2021-02-23 13:02:18 +00:00
gingerBill
c653e400db Add extra error checking in parser.cpp 2021-01-15 16:15:03 +00:00
gingerBill
f64584b92a Improve -insert-semicolon rules 2020-12-09 23:40:45 +00:00
gingerBill
6f6a3f2ccf Fix typos for -insert-semicolon 2020-12-09 23:35:08 +00:00
gingerBill
f0683c9102 Merge branch 'master' into parser-experiments 2020-12-06 00:49:48 +00:00
gingerBill
c4cb7170ee Deprecate keyword opaque in favour of #opaque 2020-12-04 16:13:05 +00:00
gingerBill
b6bbe29c8f Remove const as a (reserved) keyword 2020-12-04 16:04:58 +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
34ca4e92eb Fix parser logic for first comment group line in a file 2020-11-17 15:45:55 +00:00
gingerBill
d90fc18bef Basic odin doc support 2020-11-17 15:05:16 +00:00
gingerBill
6f71d1f2a9 Add -show-unused (Shows unused package declarations of all imported packages)
Crude output at the moment but better than nothing
2020-11-17 12:10:25 +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
939878df50 Improve logic for x->y() shorthand 2020-11-15 23:54:18 +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
31f4590f4b Fix default parameters on record types 2020-11-09 13:04:36 +00:00
gingerBill
54fbdabc38 Add experimental -insert-semicolon functionality to tokenizer and parser 2020-11-01 15:10:06 +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
ec5934705c Enforce do bodies to be on the same line as the control statement's condition or token 2020-10-14 15:59:19 +01:00
gingerBill
654b24e514 Add -disallow-do 2020-09-23 17:17:32 +01:00
gingerBill
9d976b04bc Fix +build tag logic 2020-09-15 12:45:44 +01:00
gingerBill
1fd1203d8b Improve error message for multi-valued global declarations not be allowed 2020-09-12 16:04:02 +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
15c4077806 Fix WASM foreign import names 2020-06-04 00:30:44 +01:00