mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Introduced a Lexer context, comment parsing now actually works properly. Token use in decl/ast/expr is moved to SourceRange instead. And the SourceRange used start/end, which is better than using start + len for many uses.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import curl;
|
||||
|
||||
int main(void)
|
||||
func int main(void)
|
||||
{
|
||||
try Curl curl = Curl.new();
|
||||
try Curl curl = curl::newCurl();
|
||||
|
||||
catch (error e)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,15 @@ module bar;
|
||||
|
||||
typedef int as Bob;
|
||||
|
||||
/* hello *//* there */
|
||||
/+ why /+ you /* lucky +/ +/
|
||||
// Whut
|
||||
// Here
|
||||
//
|
||||
//---
|
||||
/*
|
||||
Hello
|
||||
*/
|
||||
|
||||
struct Test
|
||||
{
|
||||
@@ -91,6 +100,7 @@ func int test3()
|
||||
return 5;
|
||||
}
|
||||
|
||||
typedef func void() as FEok;
|
||||
|
||||
typedef func void(int) as Foo;
|
||||
//typedef int as Foo;
|
||||
@@ -111,6 +121,16 @@ func void bob()
|
||||
}
|
||||
|
||||
|
||||
func int xxxx(int x)
|
||||
{
|
||||
{
|
||||
defer printf("Defer says hello!\n");
|
||||
LABEL:
|
||||
x--;
|
||||
}
|
||||
if (x > 0) goto LABEL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
func int main(int x)
|
||||
{
|
||||
@@ -189,6 +209,9 @@ JUMP:
|
||||
|
||||
func void test2(int* x, int y, int z)
|
||||
{
|
||||
*(&(&x)[0]);
|
||||
float cheat = cast(int, x);
|
||||
|
||||
x++;
|
||||
z = 0;
|
||||
z ? y : z;
|
||||
|
||||
Reference in New Issue
Block a user