Skip to content

Commit

Permalink
add @doc example and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Dec 9, 2024
1 parent 0704a72 commit 77ecbda
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
18 changes: 18 additions & 0 deletions VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ ChucK VERSIONS log

1.5.4.4
=======
(added) basic @doc functionality for language-defined classes to add inline
CKDoc documentation for class definitions and function defintions.
----------------------------------------
class Foo
{
// add inline documenation (processed at compile-time)
@doc "this is a description for the class Foo"

fun void bar()
{
// add inline documenation (processed at compile-time)
@doc "a function in Foo, bar() likes calling his friends"
}
}
// can see the above @doc descriptions printed in the class info
// (will also appear in documentation generated by CKDoc)
Foo.help();
----------------------------------------
(fixed) crash due to functions / classes references a local variable defined
at file-scope; code emission is now internally re-ordered to compile
file-scope code segments -> function definitions -> class definitions
Expand Down
23 changes: 23 additions & 0 deletions examples/class/inline-doc.ck
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// show how to add descriptions with classes and functions
// using @doc; descriptions added in this manner are associatd
// with respective classes and functions and will appear in the
// .help() runtime info mechanism, as well as in documentation
// generated using CKDoc.
//
// requires: chuck-1.5.4.4 or higher

class Foo
{
// add inline documenation (processed at compile-time)
@doc "this is a description for the class Foo"

fun void bar()
{
// add inline documenation (processed at compile-time)
@doc "a function in Foo, bar() likes calling his friends"
}
}
// print runtime info about Foo:
// can see the above @doc descriptions in the class info
// (will also appear in documentation generated by CKDoc)
Foo.help();

0 comments on commit 77ecbda

Please sign in to comment.