mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Add macro arguments &foo $foo #foo.
C ABI compatibility aarch64, win64, x86, x64 Added debug info
This commit is contained in:
committed by
Christoffer Lerno
parent
4222f2731e
commit
3c15e495dd
24
test/test_suite/macros/hash_ident.c3
Normal file
24
test/test_suite/macros/hash_ident.c3
Normal file
@@ -0,0 +1,24 @@
|
||||
macro int cofefe(#a)
|
||||
{
|
||||
int y = 0;
|
||||
return #a + #a;
|
||||
}
|
||||
|
||||
int abc = 1;
|
||||
|
||||
public func int xx()
|
||||
{
|
||||
abc++;
|
||||
return abc;
|
||||
}
|
||||
|
||||
public func void main()
|
||||
{
|
||||
define $x = 0;
|
||||
int x = 0;
|
||||
@cofefe(x += 1);
|
||||
@cofefe(xx());
|
||||
@cofefe($x += 1); // #error: Cannot modify '$x' inside of a runtime scope.
|
||||
@cofefe(y += 1); // #error: Identifier 'y' could not be found.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user