Permalink
Browse files

Closes #146 (dropped colon in numeric for loop header in favor of sem…

…icolon).
  • Loading branch information...
JarrettBillingsley committed Nov 9, 2014
1 parent 9d5ffb8 commit 7ab204020d3fe31d1c5af3252fff0de4d3ce983c
View
@@ -299,7 +299,7 @@ DoWhileStatement:
ForStatement:
for Identifier? '(' ForInitializer? ; Expression? ; ForIncrement? ')' Statement
for Identifier? '(' Identifier (: | ;) Expression '..' List(Expression) ')' Statement
for Identifier? '(' Identifier ; Expression '..' List(Expression) ')' Statement
ForInitializer:
ForInitializer , ForInitializer
View
@@ -299,9 +299,9 @@ function makeScreenQuad(xdiv: int, ydiv: int)
local verts = Vector("f32", 4 * (xdiv + 1) * (ydiv + 1))
local i = 0
for(yi: 0 .. ydiv + 1)
for(yi; 0 .. ydiv + 1)
{
for(xi: 0 .. xdiv + 1)
for(xi; 0 .. xdiv + 1)
{
local x = ((2.0 * xi) / xdiv) - 1
local y = 1 - ((2.0 * yi) / ydiv)
@@ -320,9 +320,9 @@ function makeScreenQuad(xdiv: int, ydiv: int)
local stride = xdiv + 1
i = 0
for(yi: 0 .. ydiv)
for(yi; 0 .. ydiv)
{
for(xi: 0 .. xdiv)
for(xi; 0 .. xdiv)
{
local a = (yi * stride) + xi
local b = a + 1
View
@@ -55,7 +55,7 @@ function renderDrawLists(verts: memblock, vertSize: int, commands: array, numCom
gl.glUniformMatrix4fv(UNIF_proj, 1, false, mvp.getMemblock())
}
for(i: 0 .. numCommands)
for(i; 0 .. numCommands)
{
local cmd = commands[i]
local clipL, clipR, clipT, clipB = cmd.clipL, cmd.clipR, cmd.clipT, cmd.clipB
View
@@ -61,7 +61,7 @@ class Interface
function implements(T: class, vararg)
{
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local p = vararg[i]
View
@@ -12,7 +12,7 @@ local h = 864
sdl.setVideoMode(w, h, 32, sdl.hwSurface)
for(i: 0 .. joy.count())
for(i; 0 .. joy.count())
{
joy.open(i)
writefln("{}: {} axes, {} buttons, {} hats, {} trackballs", joy.info(i))
@@ -33,20 +33,20 @@ while(!quit)
// if(e.startsWith("joy"))
// writefln("{}: {} {} {} {}", e, a, b, c, d)
//
//
// if(e == "active")
// {
// write(a ? "Gained " : "Lost ")
//
//
// if(b & event.mouseFocus)
// write("mouse ")
//
//
// if(b & event.inputFocus)
// write("input ")
//
//
// if(b & event.active)
// write("active")
//
//
// writeln()
// console.stdout.flush()
// }
View
@@ -9,18 +9,18 @@ function main()
// set 0 and 1 to false
bits[0] &= ~3
for(i: 2 .. math.sqrt(N) as int)
for(i; 2 .. math.sqrt(N) as int)
{
if(bits[i >> 6] & (1 << (i & 63)))
{
for(j: i * i .. N, i)
for(j; i * i .. N, i)
bits[j >> 6] &= ~(1 << (j & 63))
}
}
local count = 0
for(i: 0 .. #bits)
for(i; 0 .. #bits)
{
local x = bits[i] - ((bits[i] & 0xAAAAAAAAAAAAAAAA) >>> 1)
x = (x & 0x3333333333333333) + ((x >>> 2) & 0x3333333333333333)
View
@@ -70,7 +70,7 @@ local class Tester
local y = 5
local z = 10
for(i: 0 .. oneMillion / 8)
for(i; 0 .. oneMillion / 8)
{
x = y + z; x = y + z; x = y + z; x = y + z
x = y + z; x = y + z; x = y + z; x = y + z
@@ -86,7 +86,7 @@ local class Tester
local y = 5.0
local z = 10.0
for(i: 0 .. oneMillion / 8)
for(i; 0 .. oneMillion / 8)
{
x = y + z; x = y + z; x = y + z; x = y + z
x = y + z; x = y + z; x = y + z; x = y + z
@@ -101,7 +101,7 @@ local class Tester
local x = 0
local y = 5
for(i: 0 .. oneMillion / 8)
for(i; 0 .. oneMillion / 8)
{
x += y; x += y; x += y; x += y
x += y; x += y; x += y; x += y
@@ -116,7 +116,7 @@ local class Tester
local x = 0.0
local y = 5.0
for(i: 0 .. oneMillion / 8)
for(i; 0 .. oneMillion / 8)
{
x += y; x += y; x += y; x += y
x += y; x += y; x += y; x += y
@@ -131,7 +131,7 @@ local class Tester
local v = 1
local y
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
y = v; y = v; y = v; y = v
y = v; y = v; y = v; y = v
@@ -145,7 +145,7 @@ local class Tester
:beginTimer()
local v = 1
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
v = 1; v = 2; v = 3; v = 4
v = 1; v = 2; v = 3; v = 4
@@ -160,7 +160,7 @@ local class Tester
:x = 1
local y
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
y = :x; y = :x; y = :x; y = :x
y = :x; y = :x; y = :x; y = :x
@@ -173,7 +173,7 @@ local class Tester
{
:beginTimer()
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
:x = 1; :x = 2; :x = 3; :x = 4
:x = 1; :x = 2; :x = 3; :x = 4;
@@ -186,7 +186,7 @@ local class Tester
{
:beginTimer()
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
foo(); foo(); foo(); foo()
foo(); foo(); foo(); foo()
@@ -199,7 +199,7 @@ local class Tester
{
:beginTimer()
for(i : 0 .. oneMillion / 8)
for(i ; 0 .. oneMillion / 8)
{
Tester(); Tester(); Tester(); Tester()
Tester(); Tester(); Tester(); Tester()
View
@@ -185,7 +185,7 @@ function main()
{
local empty = { type = "Empty" }
for(i: 0 .. N)
for(i; 0 .. N)
send(producer, empty)
while(true)
View
@@ -228,7 +228,7 @@ local function setupArrays(initialArraySize: int = 32)
:_nextUnused = array.new(initialArraySize)
for(i: 0 .. initialArraySize)
for(i; 0 .. initialArraySize)
:_nextUnused[i] = i + 1
:_nextUnused[-1] = -1
@@ -245,7 +245,7 @@ local function expandArrays()
#:_nextUnused = :_numSlots
#:_entityMasks = :_numSlots
for(i: oldSize .. :_numSlots - 1)
for(i; oldSize .. :_numSlots - 1)
:_nextUnused[i] = i + 1
:_nextUnused[-1] = -1
@@ -329,7 +329,7 @@ class EntitySystem
{
local mask = 0
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local compMask = :_componentMasks[vararg[i]]
@@ -342,7 +342,7 @@ class EntitySystem
local obj = _newEntity(with this)
:_entityMasks[obj] = mask
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
:_componentArrays[vararg[i]][obj] = vararg[i](obj)
foreach(_, joinMask; :_joinMasks)
@@ -375,7 +375,7 @@ class EntitySystem
local addMask = 0
local componentArrays = :_componentArrays
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local comp = vararg[i]
local compMask = :_componentMasks[comp]
@@ -392,7 +392,7 @@ class EntitySystem
local mask = :_entityMasks[obj] | addMask
:_entityMasks[obj] = mask
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
componentArrays[vararg[i]][obj] = vararg[i](obj)
foreach(_, joinMask; :_joinMasks)
@@ -410,7 +410,7 @@ class EntitySystem
local removeMask = 0
local componentArrays = :_componentArrays
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local comp = vararg[i]
local compMask = :_componentMasks[comp]
@@ -428,7 +428,7 @@ class EntitySystem
local newMask = oldMask & ~removeMask
:_entityMasks[obj] = newMask
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
componentArrays[vararg[i]][obj] = null
foreach(_, joinMask; :_joinMasks)
@@ -1130,7 +1130,7 @@ namespace croc
if(l.type() == Token::Semicolon)
l.next();
else if(l.type() == Token::Ident && (l.peek().type == Token::Colon || l.peek().type == Token::Semicolon))
else if(l.type() == Token::Ident && l.peek().type == Token::Semicolon)
{
auto index = parseIdentifier();
@@ -2602,11 +2602,7 @@ namespace croc
{
l.next();
auto name = parseIdentifier();
if(l.type() != Token::Colon && l.type() != Token::Semicolon)
l.expected(": or ;");
l.next();
l.expect(Token::Semicolon);
auto exp = parseExpression();
l.expect(Token::DotDot);
@@ -43,7 +43,7 @@ function _doc_(
{
local d = doctable
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local idx = vararg[i]
@@ -461,13 +461,13 @@ class BasicConsoleOutputter : DocOutputter
{
if(:_inVerbatim)
{
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
:_output.write(vararg[i])
return
}
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local s = vararg[i]
@@ -712,7 +712,7 @@ class SectionOrder
// Make sure there are no duplicates
local temp = order.dup().sort()
for(i: 0 .. #temp - 1)
for(i; 0 .. #temp - 1)
{
if(temp[i] is temp[i + 1])
throw ValueError("Section '{}' is repeated in the given order".format(temp[i]))
@@ -383,7 +383,7 @@ class TracWikiOutputter : DocOutputter
*/
override function outputText(vararg)
{
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
write(vararg[i])
}
@@ -77,7 +77,7 @@ local function _printTraceback(inout, e)
{
local runEntry = #e.traceback
for(i: 0 .. #e.traceback)
for(i; 0 .. #e.traceback)
{
if(e.traceback[i].file.startsWith("repl._run"))
{
@@ -625,7 +625,7 @@ local class Deserializer
local len = :_length()
local ret = :_addObject({})
for(i: 0 .. len)
for(i; 0 .. len)
{
local key, value = :_deserialize(), :_deserialize()
ret[key] = value
@@ -641,7 +641,7 @@ local class Deserializer
local ret = :_addObject([])
#ret = :_length()
for(i: 0 .. #ret)
for(i; 0 .. #ret)
ret[i] = :_deserialize()
return ret
@@ -1214,7 +1214,7 @@ class TextWriter
*/
function write(vararg)
{
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
:_stream.write(:_codec.encodeInto(toString(vararg[i]), :_writeBuf, 0))
}
@@ -188,7 +188,7 @@ local function outputArray(o, arr: array, shown: table)
{
outputRepr(o, arr[0], shown)
for(i: 1 .. #arr)
for(i; 1 .. #arr)
{
o.write(", ")
outputRepr(o, arr[i], shown)
@@ -441,7 +441,7 @@ function aliasCodec(name: string, vararg)
if(#vararg == 0)
throw ParamError("Must have at least one variadic argument")
for(i: 0 .. #vararg)
for(i; 0 .. #vararg)
{
local rename = vararg[i]
Oops, something went wrong.

0 comments on commit 7ab2040

Please sign in to comment.