Commit Graph

326 Commits

Author SHA1 Message Date
Kodi Arfer
1d2c73165d Make HyKeyword callable
Co-authored-by: Simon Gomizelj <simon@vodik.xyz>
2018-07-24 09:19:37 -07:00
Kodi Arfer
03aafad657 Make empty expressions illegal at the top level 2018-07-24 08:59:52 -07:00
Kodi Arfer
14979edcab Remove tests of the old comprehension forms 2018-06-13 17:31:08 -07:00
Kodi Arfer
e1972c535f Remove for/a, for*, and for/a* 2018-06-13 17:31:08 -07:00
Kodi Arfer
3256932b13 Add a version of for parallel to lfor etc. 2018-06-13 17:31:08 -07:00
Kodi Arfer
65e620ed55 Remove an obsolete bug workaround in a test 2018-06-11 21:05:29 -07:00
Kodi Arfer
16ec46a473 Update docstring handling for Python 3.7
See https://github.com/python/cpython/pull/7121 .
2018-06-05 17:35:48 -07:00
Kodi Arfer
3204a9e8a3 Streamline auto-promotion and position spoofing
Auto-promotion now occurs in only two cases: when we start the compiler and when we expand a macro. It's fully recursive so even a non-model nested in a model will be promoted.

This change fixes some regressions induced by the stricter type checks of the pattern-matching compiler.
2018-06-05 09:23:21 -07:00
Kodi Arfer
45e8783997 Use model patterns for fn 2018-05-20 14:07:44 -07:00
Kodi Arfer
9368e4bc4e Use model patterns for import and require
In the process, I've banned the syntax `(import [foo])` in favor of `(import foo)`.
2018-05-20 14:07:44 -07:00
Kodi Arfer
79c02514b9 Introduce the use of model patterns 2018-05-20 14:07:44 -07:00
Kodi Arfer
a2aeca2338 Remove tuple unpacking in lambda lists 2018-05-04 10:40:22 -07:00
Kodi Arfer
c7ac4c60c4 Fix a bug that caused try to drop expressions 2018-04-30 09:18:01 -07:00
Kodi Arfer
ec1c92bf4e Allow for with an empty body 2018-04-29 19:51:00 -07:00
Kodi Arfer
b7e5c5f17a Allow while with an empty body 2018-04-29 19:51:00 -07:00
Kodi Arfer
87aced2370 Don't let HyExpression etc. inherit from HyList
This means the compiler no longer allows e.g. `(fn (x) ...)` in place of `(fn [x] ...)`.
2018-04-29 19:17:47 -07:00
Simon Gomizelj
032247e380
Merge pull request #1588 from Kodiologist/no-amp-key
Remove &key
2018-04-27 00:21:11 -04:00
Kodi Arfer
a605936651 Remove &key
It's redundant with &optional.
2018-04-19 09:26:02 -07:00
Kodi Arfer
7bf2901364 Ban (except)
It's rarely useful, because it catches all exceptions, but it doesn't let you do anything other than return `None`. You can still get the same effect with `(except [])`.
2018-04-16 19:34:50 -07:00
Simon Gomizelj
1b7dfd2839 Make HyKeyword a first class objects
HyKeywords are no longer an instances of string with a particular
prefix, but a completely separate object.

This means keywords no longer trip isinstance str checks, adding a
little bit of type safety to the compiler.

It also means that HyKeywords evaluate to themselves.

Closes #1352
2018-04-07 22:29:20 -07:00
Kodi Arfer
268eba93fe Update a disassembly test for Python 3.7 2018-03-24 12:34:43 -07:00
Kodi Arfer
cfb042304c Test module docstrings 2018-03-24 12:34:43 -07:00
Kodi Arfer
ad59fd7ff6 In -> and ->>, don't modify the arguments 2018-03-23 13:57:19 -07:00
Kodi Arfer
ebc9bda7ee Remove an obsolete test 2018-03-13 14:55:55 -04:00
Kodi Arfer
0c816f2e83 Mangle keyword arguments 2018-03-13 14:55:55 -04:00
Kodi Arfer
d252bb0e94 Mangle names that coincide with Python keywords 2018-03-13 14:55:55 -04:00
Kodi Arfer
52edad28e2 Overhaul mangling rules 2018-03-13 14:55:53 -04:00
Kodi Arfer
9f0911161d Fix tests with =-and-parentheses errors 2018-03-13 14:38:36 -04:00
Simon Gomizelj
5c40f793a1 Support PEP 328
Add support for proper relative imports
2018-02-06 23:41:12 -05:00
Tuukka Turto
5c720c0110
Merge pull request #1473 from Kodiologist/new-year-2018
Update copyright years
2018-02-05 15:11:59 +02:00
Tuukka Turto
cf87de5cc2
Merge pull request #1483 from vodik/remove-def
Just remove `def`
2018-01-31 08:54:59 +02:00
Simon Gomizelj
0cd4df3898 Remove def and standardize on setv 2018-01-21 00:25:33 -05:00
Tuukka Turto
a9621817f9
Merge pull request #1433 from Kodiologist/while-multistatement
Handle statements in the condition of `while`
2018-01-11 07:45:27 +02:00
Kodi Arfer
6de7ddfee5 Update copyright years 2018-01-01 10:38:33 -05:00
Rob Day
eda78eb81c Allow multiple expressions in a try 2017-12-03 09:47:41 +00:00
Kodi Arfer
fd64575799 Handle statements in the condition of while 2017-11-02 07:31:58 -07:00
gilch
8f2e80d12e add newlines in disassemble tests for astor 0.6 2017-10-31 21:46:44 -06:00
Kodi Arfer
1e456c6ced Don't treat [else…] or ("else"…) as else clauses 2017-09-20 16:34:56 -07:00
Kodi Arfer
f8fbcf3f06 Spacing fix in test 2017-09-20 16:31:55 -07:00
Rob Day
907e72681f Let argument destructuring work with docstrings 2017-09-17 21:06:45 +01:00
Rob Day
5a6488e353 Treat _42 etc. as a variable name, not an integer 2017-09-16 16:12:29 -07:00
gilch
e43d6f5e2f Merge pull request #1419 from rkday/else_multiple_statements
Allow multiple statements in the else branch of for
2017-09-16 14:10:28 -06:00
Rob Day
be35b09e5d Allow multiple statements in the else branch of a for loop 2017-09-16 20:41:22 +01:00
Ryan Gonzalez
3f69ed8e8e Merge pull request #1399 from Kodiologist/compiler-refactor 2017-09-15 14:44:32 -05:00
Ryan Gonzalez
44e5ded522 Merge pull request #1379 from Kodiologist/lua-str-literal
Add #[DELIM[ … ]DELIM] syntax for string literals
2017-09-15 14:36:08 -05:00
Rob Day
567fa14f1d Allow else after a while loop 2017-09-14 20:55:29 +01:00
Kodi Arfer
277469dfe1 Add xfail test of #1390 (statements in assert) 2017-09-13 13:30:54 -07:00
Kodi Arfer
deb801edab Preserve .brackets in quoted HyStrings 2017-09-08 11:27:34 -07:00
Kodi Arfer
0fc96306bc Drop support for Python 3.3 2017-08-26 13:36:51 -07:00
Kodi Arfer
8b677bb20c Un-xfail a passing test of macroexpand
It seems that #1374 (1faee7ac39) fixed this bug.
2017-08-25 15:25:06 -07:00