Commit Graph

841 Commits

Author SHA1 Message Date
gingerBill
1f2234a4b2 Merge branch 'master' into bill/inline-asm 2026-08-17 11:44:14 +01:00
kalsprite
35061af11b fix eol diagnostic 2026-08-16 17:31:59 -07:00
gingerBill
cb903df235 #side_effects -> #volatile; Remove dead code 2026-08-13 10:03:00 +01:00
gingerBill
3453643c11 Improve unquote_string_triple to give better error messages on invalid literals 2026-08-13 00:34:28 +01:00
gingerBill
c085a46185 Move #side_effects and #align_stack to the specification list 2026-08-12 23:40:57 +01:00
gingerBill
ae2c7ead48 Support triple backtick strings 2026-08-12 16:08:58 +01:00
gingerBill
5197806f88 Implement triple quote strings to allow for easier templating purposes 2026-08-12 15:42:36 +01:00
gingerBill
db41921a16 Mock out p0: u64 = %rax, p0b: u8 = p0 2026-08-12 10:20:11 +01:00
gingerBill
a87f5dd5e9 Clean up parsing for AstAsmMemoryOperand 2026-08-12 09:38:55 +01:00
gingerBill
612b25a425 Handle disp parameter correctly 2026-08-12 09:34:16 +01:00
gingerBill
658fa54ee4 Support [base]:u8 type interpretations for memory operands; And determine the correct suffix to use 2026-08-12 09:30:55 +01:00
gingerBill
c80fedc070 Support [base + index<<scale] and [base + index>>scale]; Support syntax for [base]:u8 (not implemented yet) 2026-08-12 09:03:31 +01:00
gingerBill
768fedcff4 Minor fixes to labels; restrict to amd64 usage 2026-08-10 13:21:14 +01:00
gingerBill
cee5bd79e0 Fix pinning logic for asm registers 2026-08-10 12:06:28 +01:00
gingerBill
036e38442b Begin work on lb_emit_asm_template_call 2026-08-09 21:55:36 +01:00
gingerBill
5ac28cdecd Begin work on semantically type checking asm templates 2026-08-09 18:24:56 +01:00
gingerBill
5e49e6c1a5 Parse asm template 2026-08-09 15:17:57 +01:00
gingerBill
d059dafb09 Merge pull request #7210 from BigBoyBarney/vet-packages
Fix `-vet-packages` not working in certain cases
2026-08-05 14:33:12 +02:00
Sylphrena
5629c13aa0 Fix -vet-packages not working in certain cases 2026-08-05 14:06:13 +02:00
kalsprite
29c9c132b0 minor typos 2026-08-04 18:49:33 -07:00
Chaosus
33247c8ca9 Bring back "extra" error line 2026-07-26 19:49:57 +03:00
Chaosus
853134048e Fix error hint for vet tag 2026-07-25 17:35:32 +03:00
callframe
cb7d7a5b7d Allow using absolute path's in foreign import's (#6999)
Document that `-collection` can be used for foreign imports.
Fix absolute path detection on Windows.
2026-07-10 20:45:59 +02:00
Senthilnathan
a880c1abfa Fix parser failing on comments inside if/when ternary 2026-07-07 14:30:59 +05:30
Senthilnathan
d7fc7c653c Fix parser failing on comments inside ternary expressions 2026-07-07 14:18:42 +05:30
gingerBill
40e54a97ed Merge branch 'master' into bill/bedrock 2026-06-24 11:07:02 +01:00
gingerBill
ade003e128 Allow for -> (#simd[N]T) style return types 2026-06-24 10:51:28 +01:00
gingerBill
244430bd4a Allow for struct #raw_union #packed 2026-06-22 12:55:15 +01:00
gingerBill
1c9fa5d0b7 Merge pull request #6731 from odin-lang/bill/expand-values-operator
Support `**` as `expand_values` operator: `**x` == `expand_values(x)`
2026-06-05 11:42:08 +01:00
gingerBill
7a5a73efae Generalize is_foreign_name_valid but add TODO to see how it should work. 2026-06-02 13:21:57 +01:00
gingerBill
b914dc1f32 Change compound literal grammar to match the formal grammar 2026-06-02 11:10:58 +01:00
gingerBill
fb8a9d0839 Support ** as expand_values operator: **x == expand_values(x) 2026-05-25 10:28:15 +01:00
Krzesimir Nowak
b924da10a0 Be more thorough in detecting generic procedure types 2026-05-20 22:11:25 +02:00
Krzesimir Nowak
34b198019f Better error reporting for unary decrement/increment operators
There was a missing routing for those operators in parse_stmt
function.
2026-05-05 15:16:49 +02:00
gingerBill
ea00291519 Begin work on -bedrock mode
Currently disables 128-bit integers, `map` type, and RTTI
2026-05-02 15:06:01 +01:00
gingerBill
4dceffd049 When parsing an incorrect for loop, remove assert
// caused by this:
```
for a
b, c := d()
```
2026-03-30 11:50:59 +01:00
gingerBill
d5a78a9cf1 Remove canonical hash shortcut 2026-03-17 09:43:16 +00:00
gingerBill
a8c6ea7c8a Implement a new StringInterner 2026-03-17 09:18:39 +00:00
gingerBill
1744f57d01 Use permanent_alloc_item directly rather than through the gb_alloc_item generic interface 2026-03-16 16:03:27 +00:00
gingerBill
f1dbe9c242 [dynamic; N]T proof of concept: fixed capacity dynamic array (akin to small_array.Small_Array(N, T)) 2026-03-11 16:46:33 +00:00
Jeroen van Rijn
6434bf4b65 Limit maximum exponent in parsing of float/integer literals 2026-03-07 12:38:04 +01:00
Krzesimir Nowak
1f00da471c Make sure to assign proper comment as package docs
So far, the first comment found was marked as package docs, which
meant that for the following code, the TODO comment would be assigned
to the package declaration instead of the comment directly preceding
the package declaration.

    // TODO: drop after finished with refactoring
    #+ feature using-stmt
    // Package foo implements this and that.
    package foo
2026-03-02 21:26:04 +01:00
Krzesimir Nowak
b8f2daa5b2 Kill deprecated file tags
We had the recommended form of file tags for long enough. Also there
were some issues with the deprecated file tags - they were ignored if
the appeared after recommended file tags, and could possibly show up
in package docs.
2026-03-02 21:26:04 +01:00
Krzesimir Nowak
4ab536a85a Drop pointless code
Modifies a local variable after it was stored in an out parameter, so
this modification has no effect.
2026-03-02 21:24:59 +01:00
Krzesimir Nowak
8bdf82ac8d Fix separating of diverging procedure types from block statements
To avoid creating a procedure literal from a procedure type and a
following block statement, one can insert a semicolon or an empty line
between the two:

    // procedure literals
    p1 :: proc() {…}
    p2 :: proc()
    {…}
    // procedure type followed by a block statement
    p3 :: proc()

    {…}

The empty line as a separator did not work if the procedure type had a
diverging result:

    // all of these are procedure literals
    p4 :: proc() -> ! {…}
    p5 :: proc() -> !
    {…}
    p6 :: proc() -> !

    {…}

The least annoying fix I came up with is to insert implicit semicolon
after the "not" token. I only needed to make sure that the inserted
implicit semicolon is being skipped when the "not" token is a part of
unary expression to avoid breaking an oddly-formatted code like:

    b := get_some_bool()
    if !
       b {…}

One small side-effect of this change is that in code like below:

    Proc_Type :: proc() -> !

    // Some comment
    Some_Other_Type :: enum byte {…}

The "// Some comment" is not associated with "Proc_Type" anymore. In
Odin's standard library this only happens in one place, in
`base/runtime/core.odin`:

    Assertion_Failure_Proc :: #type proc(prefix, message: string, loc: Source_Code_Location) -> !

    // Allocation Stuff
    Allocator_Mode :: enum byte {
    	Alloc,
    	…,
    }
2026-03-01 14:49:24 +01:00
gingerBill
a7ed7ccd0c Merge pull request #6259 from odin-lang/bill/range-init
`for init; x in y {}` style loops (proof of concept)
2026-02-17 11:11:56 +00:00
Krzesimir Nowak
a84179de1f Do not allow duplicate #partial directives on switch statement 2026-02-15 16:37:14 +01:00
gingerBill
8cb7965aa5 for init; x in y {} style loops 2026-02-11 15:33:14 +00:00
gingerBill
b1633b9ebb Require all values from a procedure iterator if the procedure is marked with @(require_results) 2026-02-11 14:05:06 +00:00
Krzesimir Nowak
6cc6f06d4d Stop silently ignoring unknown directives on an inline asm expression 2026-02-11 13:22:13 +01:00