mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Start using UnaryOp/PostUnaryOp ++/-- now works post/pre and also on pointers. Fix ++/-- on any number. Added examples. c3c now compiles files by default. Extended symbol resolution. Addition of 'extern'. Multi-level paths.
This commit is contained in:
11
resources/testproject/bar.c3
Normal file
11
resources/testproject/bar.c3
Normal file
@@ -0,0 +1,11 @@
|
||||
module bar;
|
||||
|
||||
import baz::foo;
|
||||
import testbaz;
|
||||
|
||||
public func void test()
|
||||
{
|
||||
Foo x;
|
||||
foo::test();
|
||||
Zab z;
|
||||
}
|
||||
20
resources/testproject/foo.c3
Normal file
20
resources/testproject/foo.c3
Normal file
@@ -0,0 +1,20 @@
|
||||
module baz::foo;
|
||||
|
||||
import bar;
|
||||
|
||||
public struct Foo
|
||||
{
|
||||
int a;
|
||||
}
|
||||
|
||||
extern func void printf(char *hello);
|
||||
|
||||
local func void ofke()
|
||||
{}
|
||||
|
||||
func void exple() {}
|
||||
|
||||
public func void test()
|
||||
{
|
||||
printf("Hello from baz::foo::test()!\n");
|
||||
}
|
||||
11
resources/testproject/hello_world.c3
Normal file
11
resources/testproject/hello_world.c3
Normal file
@@ -0,0 +1,11 @@
|
||||
module hello_world;
|
||||
import bar;
|
||||
|
||||
extern func void printf(char *hello);
|
||||
|
||||
func int main(int x)
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
bar::test();
|
||||
return 1;
|
||||
}
|
||||
10
resources/testproject/project.toml
Normal file
10
resources/testproject/project.toml
Normal file
@@ -0,0 +1,10 @@
|
||||
[[executable]]
|
||||
name = "hello_world"
|
||||
version = "0.1.0"
|
||||
authors = ["John Doe <john.doe@example.com>"]
|
||||
langrev = "1"
|
||||
warnings = ["no-unused"]
|
||||
# sources compiled
|
||||
sources = ["./**"]
|
||||
# libraries to use
|
||||
libs = []
|
||||
6
resources/testproject/zab.c3
Normal file
6
resources/testproject/zab.c3
Normal file
@@ -0,0 +1,6 @@
|
||||
module testbaz::zab;
|
||||
|
||||
public struct Zab
|
||||
{
|
||||
double a;
|
||||
}
|
||||
Reference in New Issue
Block a user