This repository has been archived by the owner on Apr 5, 2024. It is now read-only.
forked from ocen-lang/ocen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use `./meta/gen_docs.sh doc.json` to generate docs for all the libraries
- Loading branch information
1 parent
3281b9d
commit d1d9acb
Showing
7 changed files
with
222 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
|
||
if [[ $# -eq 0 ]] ; then | ||
echo 'Usage: ./meta/gen_docs.sh <output json path>' | ||
exit 1 | ||
fi | ||
|
||
cat > compiler/doc.oc << EOF | ||
//* Dummy file to include all library documentation | ||
//* | ||
//* Nothing to see here | ||
import std::buffer | ||
import std::bufferio | ||
import std::compact_map | ||
import std::complex | ||
import std::deque | ||
import std::fft | ||
import std::glut | ||
import std::hash | ||
import std::heap | ||
import std::image | ||
import std::json | ||
import std::libc | ||
import std::linkedlist | ||
import std::map | ||
import std::math | ||
import std::sdl | ||
import std::socket | ||
import std::sort | ||
import std::span | ||
import std::thread | ||
import std::value | ||
import std::vec | ||
import std::vector | ||
// Compiler imports | ||
import .ast::{ nodes, scopes, program } | ||
import .passes | ||
import .parser | ||
import .utils | ||
import .docgen | ||
EOF | ||
|
||
./bootstrap/ocen compiler/doc.oc --docs $1 | ||
|
||
rm compiler/doc.oc |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// exit: 0 | ||
|
||
import std::sort::sort | ||
|
||
def main() { | ||
let foo: [str; 4] | ||
foo[0] = "foo" | ||
foo[2] = "baz" | ||
foo[3] = "quux" | ||
foo[1] = "bar" | ||
|
||
sort<str>(foo, 4) | ||
|
||
assert foo[0].eq("bar") | ||
assert foo[1].eq("baz") | ||
assert foo[2].eq("foo") | ||
assert foo[3].eq("quux") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/// compile | ||
|
||
struct Foo {} | ||
|
||
def Foo::bar<T>(x: T): T => x | ||
|
||
|
||
def main() { | ||
Foo::bar<i32>(5) | ||
Foo::bar<str>("hello") | ||
|