Commit Graph

117 Commits

Author SHA1 Message Date
leaf corcoran
f8925a46a6 classes can implicitly return #46 2012-10-30 09:44:02 -07:00
leaf corcoran
1be72f57b7 add implicit return to end of files #46 2012-10-30 09:38:47 -07:00
leaf corcoran
c4c3843537 don't crash when non-value is at end of loop expression 2012-10-30 09:11:06 -07:00
leaf corcoran
a6c920641e tests for new continue keyword 2012-10-28 02:05:12 -07:00
leaf corcoran
625a2402b0 redo varargs bubbling with send, fix some varargs issues 2012-10-28 01:50:22 -07:00
leaf corcoran
df7ca32a4c handing the transformation of decorator with implicit return in all cases 2012-10-27 15:51:34 -07:00
leaf corcoran
b404f2d7c8 fix implicit return with decorated statements 2012-10-27 12:39:44 -07:00
leaf corcoran
063b50a38f assignment declaration is pulled out of line decorators #44 2012-10-25 18:55:04 -07:00
leaf corcoran
e1f31d9e8d "declare" no longer shadows, introduce "declare_with_shadows" for local keyword 2012-10-25 18:22:51 -07:00
leaf corcoran
2134a3320a add unless block 2012-10-25 15:23:24 -07:00
leaf corcoran
14db695560 table comprehensions support single expression that returns a pair 2012-10-03 11:30:23 -07:00
leaf corcoran
867989b4f7 escape dot chains that are lua keywords 2012-10-01 15:12:01 -07:00
leaf corcoran
1e6b9c8cab allow assignment in elseif 2012-10-01 12:30:16 -07:00
leaf corcoran
1d6bf564af allow assignment in if condition 2012-10-01 09:19:19 -07:00
leaf corcoran
8cf92a3591 Allow real statements inside of class 2012-09-30 19:18:21 -07:00
leaf corcoran
bd258bd79a woops, don't crash on empty string 2012-09-30 17:58:46 -07:00
leaf corcoran
d272f6a04c call methods on strings without parentheses 2012-09-30 17:43:50 -07:00
leaf corcoran
a3c82d95f8 bring back local keyword for forward declaration 2012-09-30 09:36:01 -07:00
leaf corcoran
050c77c52e fix bug in string interpolation and add more tests 2012-09-30 08:57:11 -07:00
leaf corcoran
8b2fa75e4c add string interpolation to double quote string 2012-09-27 18:13:03 -07:00
leaf corcoran
98ebb97b16 declare the variables introduced by for loop into scope #44 2012-09-18 16:04:22 -07:00
leaf corcoran
43c1e0a4fb allow string literal as table key 2012-09-08 18:40:15 -07:00
leaf corcoran
bc13b1b8cc add inherited callback to classes 2012-09-08 18:08:54 -07:00
leaf corcoran
a750523d10 hoist name declarations from statements inside of a class to the top of the class body 2012-09-07 20:20:34 -07:00
leaf corcoran
290b73f92b differentiate between table key literals and variable references #42 2012-09-07 18:51:19 -07:00
leaf corcoran
b170172465 wrap update expressions in parentheses if passed an expression #43 2012-09-07 16:41:19 -07:00
leaf corcoran
d3170a018d support full syntax of generic for loop #41 2012-08-12 00:58:35 -07:00
leaf corcoran
c93e2d35f5 fixed regression, assign allowed in class decl again 2012-01-22 11:50:30 -08:00
leaf corcoran
16f4c956bf unless line decorator 2012-01-13 21:48:07 -08:00
leaf corcoran
bf416dbb1c remove empty return statement at end of fndef (#20) 2012-01-13 21:24:46 -08:00
leaf corcoran
1ef297349a updated test 2012-01-11 20:39:09 -08:00
leaf corcoran
d7f8ade88e standalone @ and @@ are aliases for self and self.__class 2012-01-10 22:14:14 -08:00
leaf corcoran
5933b733ba assigning class variables with @ property names 2012-01-08 23:10:25 -08:00
leaf corcoran
cd240444de updated test 2012-01-08 22:24:58 -08:00
leaf corcoran
3fc11c813e @@ syntax for class variables within instances 2012-01-08 22:02:43 -08:00
leaf corcoran
53f587021d support for indented unbound tables as last argument to function calls 2011-12-08 22:44:07 -08:00
leaf corcoran
d1059b8f98 class level inheritance, changed class representation slightly
Looking up a class property will now search the parent class properties
if parent exists

Classes have a few more built in properties:

  * __name holds the name of the class as it was defined as a string
  * __base holds the instance metatable as it was defined (not dynamic)
  * __parent holds the class's parent class if it exists (not dynamic)

The way class inheritance is handled was CHANGED (uses __base instead of
looking at __index of parents metatable). Make sure you recompile all
your code if using class inheritance because old classes won't work with
new ones.
2011-12-03 19:17:06 -08:00
leaf corcoran
0d232f98e7 super tests, fixed regression when compiling chain dot args 2011-12-03 10:44:41 -08:00
leaf corcoran
5c999fb680 colon_stub on super will pass self as receiver 2011-12-03 10:39:03 -08:00
leaf corcoran
fc72baf423 calling function of super with \ uses self instead of class as first arg 2011-12-02 20:37:47 -08:00
leaf corcoran
6a07d50277 fixed super dot access, made super available as a value 2011-12-02 20:07:42 -08:00
leaf corcoran
02a5dbcdd1 fix compile failure when comprehension exp has no value 2011-11-19 13:03:51 -08:00
leaf corcoran
3f6c1d517e switch tests, parse switch non-cascade expression 2011-11-18 19:07:17 -08:00
leaf corcoran
636c24258f added key,value table comprehensions 2011-11-17 20:34:16 -08:00
leaf corcoran
5d9851b8cd export keyword works before class declaration, fixed export test 2011-11-06 22:48:25 -08:00
leaf corcoran
374a7c5975 can export assignment statements 2011-11-06 22:29:39 -08:00
leaf corcoran
de3372d96e import done through transform, binding import also works now 2011-11-06 22:06:39 -08:00
leaf corcoran
5cdbb68503 rebuilt tests 2011-11-06 15:44:40 -08:00
leaf corcoran
88683065e0 use , for slice range delimiter (sorry) 2011-11-05 10:00:09 -07:00
leaf corcoran
6925deedc8 fixed parse error for comment at end of file 2011-11-04 18:58:01 -07:00