Permalink
Browse files

Closes #152 (removed haskell-style dollar-sign function call syntax)

  • Loading branch information...
JarrettBillingsley committed Nov 9, 2014
1 parent cd3ba4c commit b8e456321858d40dd16e033f41b086f6c747dbca
View
@@ -46,7 +46,7 @@ Symbol:
< | <= | <=> | << | <<= | > | >= | >> | >>= | >>> | >>>=
& | &= | && | '|' | |= | || | ^ | ^= | = | == | ? | ?=
. | '..' | '...' | ! | != | '(' | ')' | [ | ] | { | } | : | ,
; | # | \ | -> | $ | @
; | # | \ | -> | @
Identifier:
IdentifierStart IdentifierChar*
@@ -488,12 +488,11 @@ CallExpression:
DotExpression ArgumentsWith
ArgumentsWith:
Arguments
'(' Arguments? ')'
'(' with Expression (, List(Expression))? ')'
Arguments:
'(' List(Expression)? ')'
$ List(Expression)
List(Expression)
PrimaryExpression:
Identifier
View
@@ -33,12 +33,12 @@ function autoctorOverride(c: class, fields: array) =
// ===================================================================
@autoctor$
@autoctor(
[
autofield('x', "int")
autofield('y', "int", 2)
autofield('z', "int", 3)
]
])
class Class
{}
View
@@ -164,7 +164,7 @@ function main()
local producer, consumer
producer = Thread$ thread.new$ \
producer = Thread(thread.new(\
{
local i = 0
@@ -179,9 +179,9 @@ function main()
writefln("Producer produced {}.", item.value)
send(consumer, item)
}
}
}))
consumer = Thread$ thread.new$ \
consumer = Thread(thread.new(\
{
local empty = { type = "Empty" }
@@ -196,8 +196,8 @@ function main()
send(producer, empty)
writefln("Consumer consumed {}.", msg.value)
}
}
}))
scheduler(Set$ producer, consumer)
scheduler(Set(producer, consumer))
writeln("Finished.")
}
View
@@ -555,7 +555,7 @@ class Collidable : Component
type = CollisionType.Player
}
local game = EntitySystem$
local game = EntitySystem(
{
components =
[
@@ -593,5 +593,5 @@ local game = EntitySystem$
Star = [Position Sprite]
Bullet = [Position Velocity Bounds LifeTimer Sprite Collidable]
}
}
})
*/
@@ -1261,7 +1261,6 @@ namespace croc
case ';': NEXT_AND_TOK(Token::Semicolon); RETURN;
case '#': NEXT_AND_TOK(Token::Length); RETURN;
case '\\': NEXT_AND_TOK(Token::Backslash); RETURN;
case '$': NEXT_AND_TOK(Token::Dollar); RETURN;
case '\0':
case 0xFFFF:
@@ -103,7 +103,6 @@ namespace croc
X(Question, "?")\
X(Backslash, "\\")\
X(Arrow, "->")\
X(Dollar, "$")\
X(At, "@")
#define MISC_TOKEN_LIST(X)\
@@ -227,23 +227,7 @@ namespace croc
Expression* context = nullptr;
CompileLoc endLocation;
if(l.type() == Token::Dollar)
{
l.next();
List<Expression*> args(c);
args.add(parseExpression());
while(l.type() == Token::Comma)
{
l.next();
args.add(parseExpression());
}
argsArr = args.toArray();
endLocation = argsArr[argsArr.length - 1]->endLocation;
}
else if(l.type() == Token::LParen)
if(l.type() == Token::LParen)
{
l.next();
@@ -2446,27 +2430,6 @@ namespace croc
}
continue;
case Token::Dollar: {
l.next();
List<Expression*> args(c);
args.add(parseExpression());
while(l.type() == Token::Comma)
{
l.next();
args.add(parseExpression());
}
auto arr = args.toArray();
if(auto dot = AST_AS(DotExp, exp))
exp = new(c) MethodCallExp(dot->location, arr[arr.length - 1]->endLocation, dot->op, dot->name,
arr);
else
exp = new(c) CallExp(arr[arr.length - 1]->endLocation, exp, nullptr, arr);
continue;
}
case Token::LParen: {
if(exp->endLocation.line != l.loc().line)
return exp;
@@ -1,7 +1,7 @@
local weakref, deref = weakref, deref
local allWeakTables = {}
gc.postCallback$ function postGC()
gc.postCallback(function postGC()
{
foreach(k, _; allWeakTables, "modify")
{
@@ -12,7 +12,7 @@ gc.postCallback$ function postGC()
else
tab.normalize()
}
}
})
/**
Base class for all types of weak tables.

0 comments on commit b8e4563

Please sign in to comment.