-
Notifications
You must be signed in to change notification settings - Fork 7
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
wollok-ts API revamp #129
wollok-ts API revamp #129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { RuntimeObject } from 'wollok-ts' | ||
import { Interpreter } from 'wollok-ts/dist/interpreter/interpreter' | ||
import { Interpreter, RuntimeObject } from 'wollok-ts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😍
// TODO WOLLOK-TS: migrate it? Maybe it could be part of Environment | ||
// Environment.newImportFor(baseNode, importNode) | ||
function newImport(importNode: Import, environment: Environment) { | ||
const node = replNode(environment) | ||
const imported = node.scope.resolve<Package | Entity>(importNode.entity.name)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 💯
const LIST_MODULE = 'List' | ||
const STRING_MODULE = 'wollok.lang.String' | ||
const WOLLOK_BASE_MODULES = 'wollok.' | ||
|
||
const SELF = 'self' | ||
|
||
function getImportedDefinitions(interpreter: Interpreter, rootFQN?: Package): Entity[] { | ||
const environment = interpreter.evaluation.environment | ||
const importedPackage = rootFQN ?? replNode(environment) | ||
return [ | ||
...importedPackage.members, | ||
...importedPackage.imports.flatMap(resolveImport), | ||
] | ||
} | ||
|
||
function resolveImport(imp: Import): Entity[] { | ||
const importedEntity = imp.entity.target! | ||
return imp.isGeneric | ||
? [...(importedEntity as Package).members] | ||
: [importedEntity] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏟️
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
==========================================
- Coverage 85.63% 84.91% -0.72%
==========================================
Files 9 9
Lines 696 663 -33
Branches 161 155 -6
==========================================
- Hits 596 563 -33
Misses 100 100 ☔ View full report in Codecov by Sentry. |
El CI no pasa porque necesitamos mergear primero wollok-ts y actualizar el package.json
Qué incluye
wollok-ts
sin tener que usar las carpetasdist
Qué hay que mergear antes