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

Get list comprehensions working #174

Merged
merged 1 commit into from
Mar 17, 2019
Merged

Get list comprehensions working #174

merged 1 commit into from
Mar 17, 2019

Conversation

johnynek
Copy link
Owner

close #99

To solve this I had to fix a few lurking parser bugs, but the diff is small enough that I'm leaving it combined. There is no chance I don't want to have list/for comprehensions to match python.

They make several existing problems a bit more elegant and certainly looking more like python.

These are implemented basically as macros in the expansion from syntax (Declaration) into the lambda calculus based Expr. A more ambitious language might expose a means to make user defined macros which could do expansion into the Expr graph.

@codecov-io
Copy link

codecov-io commented Mar 17, 2019

Codecov Report

Merging #174 into master will increase coverage by 0.25%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #174      +/-   ##
==========================================
+ Coverage   79.82%   80.07%   +0.25%     
==========================================
  Files          48       48              
  Lines        3112     3132      +20     
  Branches      119      129      +10     
==========================================
+ Hits         2484     2508      +24     
+ Misses        628      624       -4
Impacted Files Coverage Δ
...ain/scala/org/bykn/bosatsu/DefRecursionCheck.scala 97.32% <ø> (-0.03%) ⬇️
core/src/main/scala/org/bykn/bosatsu/Pattern.scala 95.87% <ø> (ø) ⬆️
core/src/main/scala/org/bykn/bosatsu/Predef.scala 94.18% <100%> (+0.13%) ⬆️
.../src/main/scala/org/bykn/bosatsu/Declaration.scala 97.93% <100%> (+1.3%) ⬆️
core/src/main/scala/org/bykn/bosatsu/Parser.scala 91.32% <100%> (+0.74%) ⬆️
...ore/src/main/scala/org/bykn/bosatsu/ListLang.scala 100% <100%> (ø) ⬆️
...rc/main/scala/org/bykn/bosatsu/TotalityCheck.scala 95.71% <0%> (+0.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9cc4a0a...e26cd16. Read the comment docs.

@johnynek johnynek merged commit 9c569fa into master Mar 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement for comprehensions
2 participants