-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check for constant var RHS; fix class type value emit
- Loading branch information
Showing
11 changed files
with
161 additions
and
37 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
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
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
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,42 @@ | ||
// test adding descriptions with classes and functions using @doc | ||
// requires: chuck-1.5.4.4 or higher | ||
|
||
class Foo | ||
{ | ||
// add inline documenation (processed at compile-time) | ||
// (@doc can appear anywhere within the class definition) | ||
@doc "this is a description for the class Foo" | ||
|
||
fun void bar() | ||
{ | ||
beth(); | ||
kenny(); | ||
|
||
// add inline documenation (processed at compile-time) | ||
// (@doc can appear anywhere within the function definition) | ||
@doc "a function in Foo, bar() likes calling his friends" | ||
} | ||
|
||
fun static void beth() | ||
{ | ||
// add inline documenation (processed at compile-time) | ||
@doc "beth() is working on a novel about shared memory" | ||
} | ||
|
||
fun static void kenny() | ||
{ | ||
// add inline documenation (processed at compile-time) | ||
@doc "kenny() is fun, and expects nothing in return" | ||
} | ||
} | ||
|
||
// print runtime info about Foo... | ||
// (will also appear in documentation generated by CKDoc) | ||
<<< CKDoc.describe( Foo ) >>>; | ||
<<< CKDoc.describe( Foo.beth ) >>>; | ||
<<< CKDoc.describe( Foo.kenny ) >>>; | ||
|
||
// with an instance, can also get info about instanced functions | ||
Foo f; | ||
<<< CKDoc.describe( f ) >>>; | ||
<<< CKDoc.describe( f.bar ) >>>; |
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,5 @@ | ||
"this is a description for the class Foo" :(string) | ||
"beth() is working on a novel about shared memory" :(string) | ||
"kenny() is fun, and expects nothing in return" :(string) | ||
"this is a description for the class Foo" :(string) | ||
"a function in Foo, bar() likes calling his friends" :(string) |
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,20 @@ | ||
// strange (but valid) edge cases... | ||
|
||
// first, not so strange... | ||
// print info about Type | ||
<<< CKDoc.describe( Type ) >>>; | ||
// print info about SinOsc | ||
<<< CKDoc.describe( SinOsc ) >>>; | ||
|
||
// next, getting strange... | ||
// a local variable whose name shadows an existing type | ||
SinOsc NRev; | ||
// should print out info about SinOsc | ||
<<< CKDoc.describe( NRev ) >>>; | ||
|
||
// really strange (but possible) situation... | ||
// a local Type variable whose name shadows another type | ||
Type JCRev; | ||
// should print "" (and not Type's info) | ||
// since here `JCRev` is an empty Type... | ||
<<< CKDoc.describe( JCRev ) >>>; |
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,4 @@ | ||
"a representation of a ChucK type." :(string) | ||
"a sine wave oscillator." :(string) | ||
"a sine wave oscillator." :(string) | ||
"" :(string) |
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,5 @@ | ||
// added chuck-1.5.4.4 | ||
|
||
// error case: cannot modify; JCRev as a variable here should be marked as const... | ||
null @=> JCRev; | ||
|
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,3 @@ | ||
error-assign-to-class.ck:4:10: error: cannot modify constant variable 'JCRev' | ||
[4] null @=> JCRev; | ||
^ |