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

Update wollok-ts version #153

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"typescript": "^4.2.3",
"use-interval": "^1.2.1",
"uuid": "^3.4.0",
"wollok-ts": "^3.0.6",
"wollok-ts": "^3.1.1",
"xml-parser": "^1.2.1"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export default function SimpleMenu(props: MenuProps) {
}
return (
<div>
<AppBar className={$.navContainer} position="static" style={{ height: `${props.menuSize}vh`, minHeight: '25px' }}>
<AppBar className={$.navContainer} position="static" style={{ height: `${props.menuSize}vh`, minHeight: '25px' }}>
<Toolbar className={$.toolbar}>
<DrawerReadme description={props.gameDescription} >
<Tooltip title="Abrir README">
Expand Down
3 changes: 2 additions & 1 deletion src/components/debugger/Debugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'flexlayout-react/style/dark.css'
import $ from './Debugger.module.scss'
import classNames from 'classnames'
import LoadScreen from './LoadScreen'
import { Environment, Evaluation, List, Name, Test, WRENatives } from 'wollok-ts'
import { Environment, Evaluation, Name, Test, WRENatives } from 'wollok-ts'
import SourceDisplay from './SourceDisplay'
import ASTDisplay from './ASTDisplay'
import Toolbar from './Toolbar'
Expand All @@ -14,6 +14,7 @@ import FrameStackDisplay from './FrameStackDisplay'
import BreakpointList from './BreakpointList'
import ObjectDiagramDisplay from './ObjectDiagramDisplay'
import { DirectedInterpreter, ExecutionDirector } from 'wollok-ts/dist/interpreter/interpreter'
import { List } from 'wollok-ts/dist/extensions'


const WREFiles = async (): Promise<List<SourceFile>> => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/debugger/Inspect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Inspect = () => {
try {
const expression = parse.Expression.tryParse(expressionText)
expression.forEach((node, parent) => {
if(parent) node.cache.set('parent()', parent)
if(parent) node.parent = parent
Copy link
Author

Choose a reason for hiding this comment

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

@FerRomMu si querés mira este cambio a ver si te parece que esta bien

Object.assign(node, { scope: new LocalScope(parent?.scope ?? interpreter.evaluation.currentNode.scope) })
})

Expand Down
3 changes: 2 additions & 1 deletion src/components/debugger/LoadScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React, { memo, useState } from 'react'
import { buildEnvironment, is, List, Test, Environment } from 'wollok-ts'
import { buildEnvironment, is, Test, Environment } from 'wollok-ts'
import { FiPlayCircle as RunIcon } from 'react-icons/fi'
import $ from './LoadScreen.module.scss'
import FilesSelector, { File } from '../filesSelector/FilesSelector'
import { SourceFile } from './Debugger'
import { List } from 'wollok-ts/dist/extensions'

export type LoadScreenProps = {
onTestSelected(files: List<SourceFile>, environment: Environment, test: Test): void
Expand Down
2 changes: 1 addition & 1 deletion src/components/debugger/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function nodeLabel(node: Node): string {
Method: node => `${node.name}/${node.parameters.length}`,
Field: node => `${node.name}`,
Variable: node => `${node.name}`,
Body: node => nodeLabel(node.parent()),
Body: node => nodeLabel(node.parent),
Copy link
Author

Choose a reason for hiding this comment

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

@FerRomMu este también

Node: () => '',
})}${node.isSynthetic() ? ' %synth%' : ''}`
}
Expand Down
8 changes: 4 additions & 4 deletions src/components/game/LoadError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { MultiProgramException, NoProgramException } from './gameProject'
import { BaseErrorScreen } from '../ErrorScreen'
import $ from './Game.module.scss'
import { ProgramSelector } from '../ProgramSelector'
import { List } from 'wollok-ts'
import { Problem } from 'wollok-ts/dist/validator'
import { Button } from '@material-ui/core'
import PublishIcon from '@material-ui/icons/Publish'
import Parsimmon from 'parsimmon'
import { List } from 'wollok-ts/dist/extensions'
import { Problem } from 'wollok-ts'

export interface ValidationErrorProps {
problems: List<Problem>
Expand Down Expand Up @@ -97,9 +97,9 @@ function humanizedLocation(num: number | undefined){
}

function sourceMapStart(problem: Problem) {
return problem.source?.start
return problem.node.sourceMap?.start
}

function sourceMapEnd(problem: Problem) {
return problem.source?.end
return problem.node.sourceMap?.end
}
2 changes: 1 addition & 1 deletion src/components/game/SketchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ export function removeIfStartsWith(path: string, prefix: string): string {
}

return path
}
}
1 change: 0 additions & 1 deletion src/components/game/gameProject.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { File } from '../filesSelector/FilesSelector'
import { Environment, Node, Package } from 'wollok-ts'
import parse, { Attributes } from 'xml-parser'
import { name } from 'wollok-ts/dist/parser'

// TODO: Move to more general place
const WOLLOK_FILE_EXTENSION = 'wlk'
Expand Down
3 changes: 2 additions & 1 deletion src/components/worksheet/Repl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React, { KeyboardEvent, memo, useState } from 'react'
import Slider from 'react-input-slider'
import SimpleCodeEditor from 'react-simple-code-editor'
import Splitter from 'react-splitter-layout'
import { WRENatives, Environment, Evaluation, link, List, parse, Sentence, RuntimeObject, Singleton, Method, Body, Return, Reference, Package } from 'wollok-ts'
import { WRENatives, Environment, Evaluation, link, parse, Sentence, RuntimeObject, Singleton, Method, Body, Return, Reference, Package } from 'wollok-ts'
import { List } from 'wollok-ts/dist/extensions'
import $ from './Repl.module.scss'


Expand Down
8 changes: 4 additions & 4 deletions src/context/GameContext.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { createContext, ReactNode, useState } from 'react'
import { buildEnvironment, Environment, Evaluation, List, validate, WRENatives } from 'wollok-ts'
import { buildEnvironment, Environment, Evaluation, Problem, validate, WRENatives } from 'wollok-ts'
import { buildGameProject, GameProject, getProgramIn } from '../components/game/gameProject'
import { Problem } from 'wollok-ts/dist/validator'
import { clearGitRepo } from '../components/filesSelector/GitSelector'
import interpret from 'wollok-ts/dist/interpreter/interpreter'
import { File } from '../components/filesSelector/FilesSelector'
import { RouteComponentProps } from '@reach/router'
import { List } from 'wollok-ts/dist/extensions'

const { warn, info } = console

Expand Down Expand Up @@ -64,8 +64,8 @@ export const GameProvider = ({ children }: GameProviderProps) => {

const validateGame = (environment: Environment) => {
const validationProblems = validate(environment)
const warnings = validationProblems.filter(problem => problem.level === 'Warning')
const errors = validationProblems.filter(problem => problem.level === 'Error')
const warnings = validationProblems.filter(problem => problem.level === 'warning')
const errors = validationProblems.filter(problem => problem.level === 'error')

if (warnings.length) {
warn(`FOUND ${warnings.length} WARNINGS IN LOADED GAME!`, warnings)
Expand Down