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
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.
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,
…,
}
- Add 'ios' pseudo-subtarget which triggets with either iPhone or iPhoneSimulator subtargets.
- Treat an explicit 'default' subtarget as exclusive only to the default subtarget, not an other platform-compatible subtargets.
- 'generic' continues to resolve to true for any platform-compatible subtarget as it names appears to imply such behavior.
This vet flag will make it so that allocators must be explicitly used
in places where context.allocator and context.temp_allocator are a
procedure parameter.
The goal of this flag is to prevent using the context.allocator in
cases where a different allocator was meant to be used.
Some code bases default context.allocator to nil/panic allocator
to catch this at runtime. This effectively makes it a compile
time error instead.