From 9817e0941e9c3305d9d02adb45e610652c675a1b Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Mon, 25 Mar 2024 18:18:00 +0100 Subject: [PATCH] Fix links. --- .../docs/references/development/changes.md | 90 +++++++++---------- src/content/docs/references/docs/arrays.md | 2 +- .../docs/references/docs/changesfromc.md | 6 +- src/content/docs/references/docs/comments.md | 2 +- .../docs/references/docs/conversion.md | 2 +- src/content/docs/references/docs/define.md | 2 +- src/content/docs/references/docs/examples.md | 12 +-- src/content/docs/references/docs/macros.md | 4 +- src/content/docs/references/docs/types.md | 10 +-- .../docs/references/getting-started/primer.md | 40 ++++----- 10 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/content/docs/references/development/changes.md b/src/content/docs/references/development/changes.md index 8d21723..8da17f7 100644 --- a/src/content/docs/references/development/changes.md +++ b/src/content/docs/references/development/changes.md @@ -85,8 +85,8 @@ sidebar: ##### Revision 2023-01-24 - Consistently use printfn rather than printfln -- Added [short function](../functions) syntax. -- Added [lambdas](../functions). +- Added [short function](/references/docs/functions) syntax. +- Added [lambdas](/references/docs/functions). ##### Revision 2023-01-07 - Direct download links added. @@ -115,7 +115,7 @@ sidebar: - libc::printf replaced with io::printf ##### Revision 2022-10-01 -- Expanded and updated [types](../types). +- Expanded and updated [types](/references/docs/types). ##### Revision 2022-07-20 - Added start + len syntax @@ -188,18 +188,18 @@ sidebar: ##### Revision 2021-05-08 - Added rationale for some changes from C. -- Updated undefined and [undefined behaviour](../undefinedbehaviour). +- Updated undefined and [undefined behaviour](/references/docs/undefinedbehaviour). - Removed many of the fine-grained module features. -- Removed "local" visibility in [modules](../modules). +- Removed "local" visibility in [modules](/references/docs/modules). - All modules are now distinct, parent modules do not have any special access to submodules. - Added `as module` imports. ##### Revision 2021-04-05 - "next" is now "nextcase". - Added link to the C3 discord. -- The [conversions](../conversion) page updated with new conversion rules. +- The [conversions](/references/docs/conversion) page updated with new conversion rules. - Updated compound literal syntax. -- Removed [undefined behaviour](../undefinedbehaviour) behaviour on integer overflow and added a list of unspecified behaviour. +- Removed [undefined behaviour](/references/docs/undefinedbehaviour) behaviour on integer overflow and added a list of unspecified behaviour. ##### Revision 2020-12-23 - Updated slice behaviour. @@ -219,18 +219,18 @@ sidebar: - Changed cast syntax to `cast( as )`. ##### Revision 2020-07-08 -- Additions to [error handling](../optionals). +- Additions to [error handling](/references/docs/optionals). - Introduction of labelled `nextcase`, `break` and `continue`. - Removal of `goto`. ##### Revision 2020-06-17 -- Alternate casts in [idea](../ideas). +- Alternate casts in [idea](/references/docs/ideas). - Method functions simply renamed to "method". -- Completely revised [error handling](../optionals). +- Completely revised [error handling](/references/docs/optionals). ##### Revision 2020-04-23 - Updated error handling, adding try-else-jump and changed how errors are passed. -- Included [reflection](../reflection) page +- Included [reflection](/references/docs/reflection) page ##### Revision 2020-03-30 - Added Odin and D to comparisons. @@ -242,7 +242,7 @@ sidebar: ##### Revision 2020-03-29 - Type inference for enums. -- Included [macro](../macros) page. +- Included [macro](/references/docs/macros) page. - Corrected precedence rules with `try` and `@`. - Type functions. - Managed variables back to ideas. @@ -254,22 +254,22 @@ sidebar: - Changed cast syntax from `@cast(Type, var)` to `cast(var, Type)` ##### Revision 2019-12-26 -- Added module versioning system [idea](../ideas). +- Added module versioning system [idea](/references/docs/ideas). - Fleshed out polymorphic functions. - Unsigned to signed promotion mentioned in "changes from C" ##### Revision 2019-12-25 - Changes how generic modules work. - Switched so that vararrays use `Type[*]` and slices use `Type[]`. -- Added submodule granularity, partial imports (only importing selected functions and types), removal of `local`, extended aliasing. See [modules](../modules). +- Added submodule granularity, partial imports (only importing selected functions and types), removal of `local`, extended aliasing. See [modules](/references/docs/modules). - Updated "changes from C" with removal of multiple declarations. ##### Revision 2019-12-11 -- Updated the [setup](../setup) page. +- Updated the [setup](/references/docs/setup) page. ##### Revision 2019-12-03 -- Added page on [conversions](../conversion). -- Added page on [undefined behaviour](../undefinedbehaviour). +- Added page on [conversions](/references/docs/conversion). +- Added page on [undefined behaviour](/references/docs/undefinedbehaviour). ##### Revision 2019-11-01 - Updated "changes from C" with the lack of array decays. @@ -277,11 +277,11 @@ sidebar: - Added name alias to ideas - Added align asserts to ideas - Added built in tests to ideas -- Added [arrays page](../arrays) -- Added function blocks to [statements page](../statements). -- Added [expressions page](../expressions). -- Added [variables page](../variables). -- Moved managed pointers from idea to the [variables page](../variables). +- Added [arrays page](/references/docs/arrays) +- Added function blocks to [statements page](/references/docs/statements). +- Added [expressions page](/references/docs/expressions). +- Added [variables page](/references/docs/variables). +- Moved managed pointers from idea to the [variables page](/references/docs/variables). ##### Revision 2019-09-30 @@ -313,43 +313,43 @@ sidebar: ##### Revision 2019-07-30 -- Added default and named arguments to the [functions page](../functions). -- Added varargs to the [functions page](../functions). +- Added default and named arguments to the [functions page](/references/docs/functions). +- Added varargs to the [functions page](/references/docs/functions). - Added idea about hierarchal memory. - Added idea of raw dynamic safe arrays & strings. - Volatile sections are no longer prefixed by '@' - Added idea regarding c3 interop -- Added [page about c interop](../cinterop). +- Added [page about c interop](/references/docs/cinterop). - Removed `c_ichar` and `c_uchar` types as they are redundant. -- Updates to keywords on the [grammar page]()../syntax). +- Updates to keywords on the [grammar page]()/references/docs/syntax). ##### Revision 2019-07-27 - Updated grammar with keywords. -- Added the [docs & comments](../comments) page. -- Updated the [pre- and post-conditions](../contracts). +- Added the [docs & comments](/references/docs/comments) page. +- Updated the [pre- and post-conditions](/references/docs/contracts). ##### Revision 2019-07-24 - Idea: typed varargs. -- Added "pure" [post condition](../contracts) +- Added "pure" [post condition](/references/docs/contracts) - Updated c3c commands. - Removed the `type` keyword for defining union/struct/enum/error. ##### Revision 2019-07-23 -- Added to [generic functions](../generics) examples for [] and []= -- Developed ideas about vectors in the [idea section](../ideas). +- Added to [generic functions](/references/docs/generics) examples for [] and []= +- Developed ideas about vectors in the [idea section](/references/docs/ideas). - Defined 2's complement for signed integers. - Idea: Managed pointers. -- Updated [naming rules](../naming) for types. -- Added more [naming rules](../naming) + examples of them. +- Updated [naming rules](/references/docs/naming) for types. +- Added more [naming rules](/references/docs/naming) + examples of them. - Removed "defer on function signatures" from ideas. - Removed "managed qualifier" from ideas. - Removed "defer sugar" from ideas. - Removed "built in dynamic arrays" from ideas. -- Added [standard_library](../standard_library) section. -- Added more about [pre- and post-conditions](../contracts). +- Added [standard_library](/references/docs/standard_library) section. +- Added more about [pre- and post-conditions](/references/docs/contracts). ##### Revision 2019-07-22 @@ -357,15 +357,15 @@ sidebar: ##### Revision 2019-07-21 -- "return" rather than function name is used in post conditions. See [Functions](../functions#pre-and-post-conditions) -- Added "@include" macro for textual includes. See [Modules](../modules#textual-includes). -- Files to without `module` for single file compilations is now ok as a special case. See [Modules](../modules) -- Added cone style array idea to the [idea section](../ideas). -- Added idea about defer on error to the [idea section](../ideas). -- Added idea for aliasing generic structs in the import to the [idea section](../ideas). -- Added idea for changing automatic signed <-> unsigned conversion to the [idea section](../ideas). -- Added [Changes from C](../changesfromc) and [Statements](../statements) sections. -- Removal of `volatile`. See [Changes from C](../changesfromc) and [Statements](../statements) -- Removal of `const` See [Changes from C](../changesfromc) +- "return" rather than function name is used in post conditions. See [Functions](/references/docs/functions#pre-and-post-conditions) +- Added "@include" macro for textual includes. See [Modules](/references/docs/modules#textual-includes). +- Files to without `module` for single file compilations is now ok as a special case. See [Modules](/references/docs/modules) +- Added cone style array idea to the [idea section](/references/docs/ideas). +- Added idea about defer on error to the [idea section](/references/docs/ideas). +- Added idea for aliasing generic structs in the import to the [idea section](/references/docs/ideas). +- Added idea for changing automatic signed <-> unsigned conversion to the [idea section](/references/docs/ideas). +- Added [Changes from C](/references/docs/changesfromc) and [Statements](/references/docs/statements) sections. +- Removal of `volatile`. See [Changes from C](/references/docs/changesfromc) and [Statements](/references/docs/statements) +- Removal of `const` See [Changes from C](/references/docs/changesfromc) diff --git a/src/content/docs/references/docs/arrays.md b/src/content/docs/references/docs/arrays.md index 495d33f..59e9586 100644 --- a/src/content/docs/references/docs/arrays.md +++ b/src/content/docs/references/docs/arrays.md @@ -181,4 +181,4 @@ by implementing "len" and "[]" methods and annotating them using the `@operator` io::printfn("%d", i); } -For more information, see [operator overloading](../operators) \ No newline at end of file +For more information, see [operator overloading](/references/docs/operators) \ No newline at end of file diff --git a/src/content/docs/references/docs/changesfromc.md b/src/content/docs/references/docs/changesfromc.md index cd2d2f6..ceed179 100644 --- a/src/content/docs/references/docs/changesfromc.md +++ b/src/content/docs/references/docs/changesfromc.md @@ -26,11 +26,11 @@ The `->` operator is removed, access uses dot for both direct and pointer access ##### Different operator precedence -Notably bit operations have higher precedence than +/-, making code like this: `a & b == c` evaluate like `(a & b) == c` instead of C's `a & (b == c)`. See the page about [precedence rules](../precedence). +Notably bit operations have higher precedence than +/-, making code like this: `a & b == c` evaluate like `(a & b) == c` instead of C's `a & (b == c)`. See the page about [precedence rules](/references/docs/precedence). ##### Removal of the const type qualifier -The const qualifier is only retained for actual constant variables. C3 uses a special type of [post condition](../contracts) for functions to indicate that they do not alter in parameters. +The const qualifier is only retained for actual constant variables. C3 uses a special type of [post condition](/references/docs/contracts) for functions to indicate that they do not alter in parameters. ``` /** @@ -85,7 +85,7 @@ where there is only a single way to widen the expression. To explain the latter: take the case of `long x = int_val_1 + int_val_2`. In C this would widen the result of the addition: `long x = (long)(int_val_1 + int_val_2)`, but there is another possible way to widen: `long x = (long)int_val_1 + (long)int_val_2`. so in this case, the widening -is disallowed. However, `long x = int_val_1` is unambiguous, so C3 permits it just like C (read more on the [conversion page](../conversion). +is disallowed. However, `long x = int_val_1` is unambiguous, so C3 permits it just like C (read more on the [conversion page](/references/docs/conversion). C3 also adds *safe signed-unsigned comparisons*: this means that comparing signed and unsigned values will always yield the correct result: diff --git a/src/content/docs/references/docs/comments.md b/src/content/docs/references/docs/comments.md index 05e6bae..5fbd76e 100644 --- a/src/content/docs/references/docs/comments.md +++ b/src/content/docs/references/docs/comments.md @@ -49,4 +49,4 @@ Finally, a custom annotation, "@mycustom" is added. The compiler is free to sile | @ensure | `@ensure , , ...` | | @pure | `@pure` | -See [contracts](../contracts) for information regarding `@require`, `@ensure`, `@const`, `@pure`, `@checked`. +See [contracts](/references/docs/contracts) for information regarding `@require`, `@ensure`, `@const`, `@pure`, `@checked`. diff --git a/src/content/docs/references/docs/conversion.md b/src/content/docs/references/docs/conversion.md index 1c6d91e..cdaa1ea 100644 --- a/src/content/docs/references/docs/conversion.md +++ b/src/content/docs/references/docs/conversion.md @@ -116,7 +116,7 @@ Substructs may be used in place of its parent structs in many cases. The rule is ## Pointer conversions -Pointer conversion between types usually need explicit casts. The exception is `void *` which any type may implicitly convert *to* or *from*. Conversion rules from and to arrays are detailed under [arrays](../arrays) +Pointer conversion between types usually need explicit casts. The exception is `void *` which any type may implicitly convert *to* or *from*. Conversion rules from and to arrays are detailed under [arrays](/references/docs/arrays) ## Vector conversions diff --git a/src/content/docs/references/docs/define.md b/src/content/docs/references/docs/define.md index 27cc984..7d59f50 100644 --- a/src/content/docs/references/docs/define.md +++ b/src/content/docs/references/docs/define.md @@ -99,7 +99,7 @@ and variables: def int_max_foo = generic_foo::max_foo(); def double_max_foo = generic_foo::max_foo(); -For more information, see the chapter on [generics](../generics). +For more information, see the chapter on [generics](/references/docs/generics). ## Function pointer default arguments and named parameters diff --git a/src/content/docs/references/docs/examples.md b/src/content/docs/references/docs/examples.md index 9be4634..8c4b779 100644 --- a/src/content/docs/references/docs/examples.md +++ b/src/content/docs/references/docs/examples.md @@ -366,7 +366,7 @@ fn void print_file2(String filename) -Read more about optionals and error handling [here](../optionals). +Read more about optionals and error handling [here](/references/docs/optionals). #### Contracts @@ -394,7 +394,7 @@ fn int getLastElement(int* array, int length) } ``` -Read more about contracts [here](../contracts). +Read more about contracts [here](/references/docs/contracts). #### Macros @@ -471,7 +471,7 @@ fn void test() } ``` -Read more about macros [here](../macros). +Read more about macros [here](/references/docs/macros). #### Methods @@ -553,7 +553,7 @@ const long FIB19 = @fib(19); // Same as const long FIB19 = 4181; ``` -Read more about compile time execution [here](../compiletime). +Read more about compile time execution [here](/references/docs/compiletime). #### Generic modules @@ -615,7 +615,7 @@ fn void test() } ``` -Read more about generic modules [here](../generics) +Read more about generic modules [here](/references/docs/generics) #### Dynamic calls @@ -664,4 +664,4 @@ fn void main() } ``` -Read more about dynamic calls [here](../anyinterfaces). \ No newline at end of file +Read more about dynamic calls [here](/references/docs/anyinterfaces). \ No newline at end of file diff --git a/src/content/docs/references/docs/macros.md b/src/content/docs/references/docs/macros.md index a6d5040..c9af5fc 100644 --- a/src/content/docs/references/docs/macros.md +++ b/src/content/docs/references/docs/macros.md @@ -4,7 +4,7 @@ description: Macros sidebar: order: 119 --- -The macro capabilities of C3 reaches across several constructs: macros (prefixed with `@` at invocation), [generic functions](../generics/#generic-functions), [generic modules](../generics/#generic-modules), compile time variables (prefixed with `$`), macro compile time execution (using `$if`, `$for`, `$foreach`, `$switch`) and attributes. +The macro capabilities of C3 reaches across several constructs: macros (prefixed with `@` at invocation), [generic functions](/references/docs/generics/#generic-functions), [generic modules](/references/docs/generics/#generic-modules), compile time variables (prefixed with `$`), macro compile time execution (using `$if`, `$for`, `$foreach`, `$switch`) and attributes. ## A quick comparison of C and C3 macros @@ -247,7 +247,7 @@ Similar to regular *methods* a macro may also be associated with a particular ty Foo f; f.generate(); -See the chapter on [functions](../functions) for more details. +See the chapter on [functions](/references/docs/functions) for more details. ## Capturing a trailing block diff --git a/src/content/docs/references/docs/types.md b/src/content/docs/references/docs/types.md index 01dc37b..cb9e478 100644 --- a/src/content/docs/references/docs/types.md +++ b/src/content/docs/references/docs/types.md @@ -29,7 +29,7 @@ This would for example affect generated C headers. Unlike C, C3 does not use type qualifiers. `const` exists, but is a storage class modifier, not a type qualifier. Instead of `volatile`, volatile loads and stores are used. -In order to signal restrictions on parameter usage, parameter [preconditions](../preconditions/) are used. +In order to signal restrictions on parameter usage, parameter [preconditions](/references/docs/preconditions/) are used. `typedef` has a slightly different syntax and renamed `def`. C3 also requires all function pointers to be used with an alias, so: @@ -229,7 +229,7 @@ the raw `void*` pointer. ### Array types Arrays are indicated by `[size]` after the type, e.g. `int[4]`. Slices use the `type[]`. For initialization the wildcard `type[*]` can be used to infer the size -from the initializer. See the chapter on [arrays](../arrays). +from the initializer. See the chapter on [arrays](/references/docs/arrays). ### Vector types @@ -332,7 +332,7 @@ Using `inline` in the `distinct` declaration allows a distinct type to implicitl // Inline type definition MyList bcd = MyList(); -Read more about generic types on [the page about generics](../generics). +Read more about generic types on [the page about generics](/references/docs/generics). ## Enum @@ -442,7 +442,7 @@ Only variables and return variables may be optionals. Function and macro paramet int! x = 0; // Ok! -Read more about the optional types on the page about [optionals and error handling](../optionals). +Read more about the optional types on the page about [optionals and error handling](/references/docs/optionals). ## Struct types @@ -470,7 +470,7 @@ A struct's members may be accessed using dot notation, even for pointers to stru (One might wonder whether it's possible to take a `Person**` and use dot access. – It's not allowed, only one level of dereference is done.) -To change alignment and packing, optional [attributes](../attributes) such as `@packed` may be used. +To change alignment and packing, optional [attributes](/references/docs/attributes) such as `@packed` may be used. ## Struct subtyping diff --git a/src/content/docs/references/getting-started/primer.md b/src/content/docs/references/getting-started/primer.md index 75a8d08..cdca664 100644 --- a/src/content/docs/references/getting-started/primer.md +++ b/src/content/docs/references/getting-started/primer.md @@ -86,12 +86,12 @@ Arrays are trivially copyable: int[3] x = ...; int[3] y = x; -See more [here](../arrays). +See more [here](/references/docs/arrays). #### Undefined behaviour C3 has less undefined behaviour, in particular integers are defined as using 2s -complement and signed overflow is wrapping. See more [here](../undefinedbehaviour). +complement and signed overflow is wrapping. See more [here](/references/docs/undefinedbehaviour). #### Functions @@ -103,7 +103,7 @@ Functions are declared like C, but you need to put `fn` in front: // C3 fn int foo(Foo* b, int x, void* z) { ... } -See more about functions, like named and default arguments [here](../functions). +See more about functions, like named and default arguments [here](/references/docs/functions). #### Calling C functions @@ -215,7 +215,7 @@ For convenience, assigning to a struct will infer the type even if it's not an i ... println(my_excellent_string); -Read more about `def` [here](../define). +Read more about `def` [here](/references/docs/define). #### Basic types @@ -243,7 +243,7 @@ Several C types that would be variable sized are fixed size, and others changed iptr i; // Same as intptr_t depends on target uptr j; // Same as uintptr_t depends on target -Read more about types [here](../types). +Read more about types [here](/references/docs/types). #### Instead of #include: Modules and import @@ -275,7 +275,7 @@ The `/* */` comments are nesting ``` Note that doc comments, starting with `/**` has special rules for parsing it, and is -not considered a regular comment. See [contracts](../contracts) for more information. +not considered a regular comment. See [contracts](/references/docs/contracts) for more information. #### Type qualifiers @@ -433,27 +433,27 @@ struct Flags : char } ``` -For more information see [the section on bitstructs](../types/#bitstructs). +For more information see [the section on bitstructs](/references/docs/types/#bitstructs). #### Other changes The following things are enhancements to C, that does not have a direct counterpart in C. -- [Expression blocks](../statements) +- [Expression blocks](/references/docs/statements) - Defer -- [Methods](../functions) -- [Optionals](../optionals) -- [Semantic macros](../macros) -- [Generic modules](../generics) -- [Contracts](../contracts) -- [Compile time evaluation](../compiletime) -- [Reflection](../reflection) -- [Operator overloading](../operators) +- [Methods](/references/docs/functions) +- [Optionals](voptionals) +- [Semantic macros](/references/docs/macros) +- [Generic modules](/references/docs/generics) +- [Contracts](/references/docs/contracts) +- [Compile time evaluation](vcompiletime) +- [Reflection](/references/docs/reflection) +- [Operator overloading](/references/docs/operators) - Macro methods -- [Static initialize and finalize functions](../functions#static-initializer-and-finalizers) -- [Dynamic interfaces](../anyinterfaces) +- [Static initialize and finalize functions](/references/docs/functions#static-initializer-and-finalizers) +- [Dynamic interfaces](/references/docs/anyinterfaces) -**For the full list of all new features** see the [feature list](../allfeatures). +**For the full list of all new features** see the [feature list](/references/docs/allfeatures). -Finally, the [FAQ](../faq) answers many questions you might have as you start out. \ No newline at end of file +Finally, the [FAQ](/references/docs/faq) answers many questions you might have as you start out. \ No newline at end of file