mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Complete transition to fn. Introduce global/threadlocal
This commit is contained in:
committed by
Christoffer Lerno
parent
e2621617f1
commit
b52b42d4da
@@ -12,20 +12,20 @@ struct An2
|
||||
{
|
||||
}
|
||||
|
||||
extern func void printf(char *string);
|
||||
extern fn void printf(char *string);
|
||||
|
||||
macro void An2.helloWorld(An2 *an2)
|
||||
{
|
||||
printf("An2 hello\n");
|
||||
}
|
||||
|
||||
func void check()
|
||||
fn void check()
|
||||
{
|
||||
printf("Checking\n");
|
||||
}
|
||||
|
||||
|
||||
func void main()
|
||||
fn void main()
|
||||
{
|
||||
An1 an;
|
||||
an.x.y.@helloWorld();
|
||||
|
||||
@@ -12,44 +12,44 @@ struct An2
|
||||
{
|
||||
}
|
||||
|
||||
extern func void printf(char *string);
|
||||
extern fn void printf(char *string);
|
||||
|
||||
macro void An2.helloWorld(An2 *an2)
|
||||
{
|
||||
printf("An2 hello\n");
|
||||
}
|
||||
|
||||
func void check()
|
||||
fn void check()
|
||||
{
|
||||
printf("Checking\n");
|
||||
}
|
||||
|
||||
|
||||
func void test1()
|
||||
fn void test1()
|
||||
{
|
||||
An1 an;
|
||||
an.x.y.@helloWorld; // #error: macro name must be followed by '('
|
||||
}
|
||||
|
||||
func void test2()
|
||||
fn void test2()
|
||||
{
|
||||
An2 a;
|
||||
a.@helloWorld; // #error: A macro name must be followed by '('
|
||||
}
|
||||
|
||||
func void test3()
|
||||
fn void test3()
|
||||
{
|
||||
An2 a;
|
||||
a.@helloWorld.b; // #error: There is no member or method 'b' on 'void'
|
||||
}
|
||||
|
||||
func void test4()
|
||||
fn void test4()
|
||||
{
|
||||
An1 an;
|
||||
an.x.@y; // #error: '@' should only be placed in front of macro names
|
||||
}
|
||||
|
||||
func void test5()
|
||||
fn void test5()
|
||||
{
|
||||
An1 an;
|
||||
an.x.@y(); // #error: '@' should only be placed in front of macro names
|
||||
|
||||
@@ -23,7 +23,7 @@ module abc;
|
||||
import foo;
|
||||
import baz;
|
||||
|
||||
func void main()
|
||||
fn void main()
|
||||
{
|
||||
Bar bar;
|
||||
bar.test();
|
||||
|
||||
Reference in New Issue
Block a user