Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support kwargs in method calls #440

Merged
merged 27 commits into from
Sep 22, 2020
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1964d91
remove support for instance literals in constructors
leina05 Sep 18, 2020
7d19460
update all instance creation syntax to use () not {}
leina05 Sep 18, 2020
dd33611
add kwargs to external calls
leina05 Sep 17, 2020
1925664
support kwargs in ruby methods
leina05 Sep 18, 2020
e00f95d
python test for kwarg methods
leina05 Sep 18, 2020
244c81b
rubocop
leina05 Sep 18, 2020
2f069b2
Slightly simplify Ruby kwargs handling
plotnick Sep 21, 2020
03eda17
update call macro for kwargs; use Call for constructors in tests inst…
leina05 Sep 21, 2020
222b570
Thread kwargs through integration tests
plotnick Sep 21, 2020
c1c56a3
add kwarg tests to rust integration_test
leina05 Sep 21, 2020
55f9106
Fix calls with kwargs on Ruby < 2.7
plotnick Sep 21, 2020
92daa7c
Comment Ruby version stuff
plotnick Sep 21, 2020
527ffa9
add no kwarg check to Java for calls
leina05 Sep 21, 2020
3783ec0
ruby test for kwargs with method calls
leina05 Sep 21, 2020
31d1f9b
broken JS tests, WIP
leina05 Sep 21, 2020
63f54b9
Kill SimpleCall lalrpop production
plotnick Sep 21, 2020
900dedc
Fix JS kwargs tests
plotnick Sep 21, 2020
f95a411
Tweak Python kwargs handling
plotnick Sep 21, 2020
688eb76
add kwargs to POLAR_LOG
plotnick Sep 21, 2020
03269d5
format
plotnick Sep 21, 2020
c141f31
Merge branch 'main' into leina/ship_mixed_args
plotnick Sep 21, 2020
7412489
whitespace
plotnick Sep 21, 2020
60a0d5c
whitespace
plotnick Sep 21, 2020
a790afb
Async keyword only needed if await used in function body
gj Sep 21, 2020
00d183a
Assert against error type instead of string matching
gj Sep 21, 2020
5d1b47d
Changelog
gj Sep 21, 2020
9ea90c9
Merge branch 'main' into leina/ship_mixed_args
samscott89 Sep 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions docs/changelogs/vNEXT.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,53 @@ NEXT
Breaking changes
================

.. TODO remove warning and replace with "None" if no breaking
changes.

.. warning:: This release contains breaking changes. Be sure
to follow migration steps before upgrading.

Breaking change 1
-----------------
Updated ``new`` operator syntax
-------------------------------

Previously, the ``new`` operator could take one of two forms:

.. code-block:: polar

new Foo()

new Foo{}

- summary of breaking change
The former accepted positional arguments, and the latter accepted keyword
arguments. In this release, the two forms have combined their powers, and
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

positional and keyword arguments can both be passed via the parenthetical
syntax:

Link to migration guide
.. code-block:: polar

new Foo(1, 2, foo: 3, bar: 4)

Keyword arguments *must* follow positional arguments, and they are not
supported in languages that themselves do not support keyword arguments, such
as Java and JavaScript (Node.js).

The curly brace syntax (``new Foo{}``) is no longer valid Polar and will fail
to parse.

Migrate to the new constructor syntax by replacing curly braces with
parentheses.

New features
============

Feature 1
---------
Keyword arguments now supported in method calls
-----------------------------------------------

In languages that support keyword arguments, they may now be passed to method
calls using the following syntax:

- summary
- of
- user facing changes
.. code-block:: polar

Link to relevant documentation section
foo.bar(1, 2, foo: 3, bar: 4)

.. todo:: Link to relevant documentation section

Other bugs & improvements
=========================
Expand Down