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

fixed using function as argument in lox interpreter #5

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tkueeu
Copy link

@tkueeu tkueeu commented Aug 20, 2023

This should fix issue #4

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Hey @tkueeu, thanks for looking into the issue 👍

src/interpreter/runner.ts Outdated Show resolved Hide resolved
Comment on lines 277 to 278
return functionValue;
return functionValue;
Copy link
Member

Choose a reason for hiding this comment

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

Minor: Remove Whitespace

src/interpreter/runner.ts Outdated Show resolved Hide resolved
examples/closures.loxnb Outdated Show resolved Hide resolved
@@ -3,7 +3,7 @@ import { BinaryExpression, Expression, isBinaryExpression, isBooleanExpression,
import { createLoxServices } from "../language-server/lox-module";
import { v4 } from 'uuid';
import { URI } from "vscode-uri";
import { CancellationToken } from "vscode-languageclient";
import { CancellationToken } from 'vscode-jsonrpc';
Copy link
Author

Choose a reason for hiding this comment

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

Was necessary to import less from vscode, otherwise the full initialization breaks unit test


test('Closure 1', async() => {
const input = `
// So far fails with: No variable 'outside' defined
Copy link
Author

Choose a reason for hiding this comment

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

maybe failing tests should be commented out and marked with a TODO or FIXME comment?

`

const ast = await parse(input);
ast.parseResult;
Copy link
Author

Choose a reason for hiding this comment

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

not yet a complete test ...

@tkueeu tkueeu requested a review from msujew August 20, 2023 23:50
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.

2 participants