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

for-in construct #42

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

for-in construct #42

wants to merge 3 commits into from

Conversation

hishamhm
Copy link
Member

@hishamhm hishamhm commented Nov 1, 2017

Just pushed to the server some code I had lying around when I started playing with adding for-in. So far it has just the parser update and beginnings of type checking.

Evidently this needs to wait until we have other features in place for the complete functionality of for-in to work (first class functions being the most obvious one) unless we want to support a hacky version first with hardcoded support for the standard library iterators only (which I see as being special-cased in the code-generator anyway, so it's not like that would be throwaway code).

@mascarenhas
Copy link
Member

Having the possibility for top-level functions being first-class functions, which is enough for Lua's stateless iterators, is not hard, as they are literally function pointers. But to really be convenient we also need to have parametric polymorphism, otherwise you need to have a different ipairs for each type of array element.

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@d35ca06). Click here to learn what that means.
The diff coverage is 50%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #42   +/-   ##
=========================================
  Coverage          ?   81.17%           
=========================================
  Files             ?       16           
  Lines             ?     2842           
  Branches          ?        0           
=========================================
  Hits              ?     2307           
  Misses            ?      535           
  Partials          ?        0
Impacted Files Coverage Δ
titan-compiler/parser.lua 93.45% <ø> (ø)
titan-compiler/ast.lua 93.05% <100%> (ø)
spec/parser_spec.lua 100% <100%> (ø)
titan-compiler/checker.lua 76.5% <9.09%> (ø)

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 d35ca06...46410a1. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants