Commit 92346500 authored by Matej Genci's avatar Matej Genci

Code hygiene

parent fdc4bb11
......@@ -5,7 +5,7 @@ body {
}
.App {
margin: 50px 20px 0px 20px;
margin: 20px 20px 0px 20px;
}
.App-code-editors {
......
......@@ -5,9 +5,7 @@ import Tree from 'react-d3-tree';
// Custom components
import ButtonStrip from './view/ButonStrip'
import CodeEditor from './view/CodeEditor'
import UserIO from './view/UserIO'
import Terminal from 'terminal-in-react';
import {makeStyles} from "@material-ui/core/styles";
import Card from "./components/Card/Card.js";
import CardBody from "./components/Card/CardBody.js";
......@@ -15,31 +13,7 @@ import {sendWaccCode, astMetaToGraphData} from './Comm'
import GridItem from "./components/Grid/GridItem";
import GridContainer from "./components/Grid/GridContainer";
const cardImagesStyles = {
cardImgTop: {
width: "100%",
borderTopLeftRadius: "calc(.25rem - 1px)",
borderTopRightRadius: "calc(.25rem - 1px)"
},
cardImgBottom: {
width: "100%",
borderBottomRightRadius: "calc(.25rem - 1px)",
borderBottomLeftRadius: "calc(.25rem - 1px)"
},
cardImgOverlay: {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
padding: "1.25rem"
},
cardImg: {
width: "100%",
borderRadius: "calc(.25rem - 1px)"
}
};
const useStyles = makeStyles(cardImagesStyles);
import './App.css'
class App extends React.Component {
constructor(props) {
......@@ -79,10 +53,6 @@ class App extends React.Component {
}
readInputCallBack = (codeToEval) => {
console.log(test);
// if (!window.EMULATOR_IS_INPUT) {
// window.EMULATOR_CONSOLE_READ = window.prompt()
// }
eval(codeToEval);
window.EMULATOR_CONSOLE_READ = () => { return window.prompt()};
};
......
import React from 'react'
import axios from 'axios'
const SERVER_ADDR = "http://134.209.31.55:8080/";
const SERVER_ENDPOINT = "";
const testGraphData = [{
name: "WACC Program", children: [{
name: "BinOP", attributes: {operation: "Add"},
children: [{name: "Const", attributes: {value: "1"}}, {name: "VarIdent", attributes: {ident: "x"}}]
}]
}];
export function astMetaToGraphData(astMeta) {
let firstNode = astMeta.nodes["0"];
let graphData = createGraphNode(firstNode, astMeta);
......@@ -48,7 +37,7 @@ function createGraphNode(node, astMeta){
children.push(createGraphNode(child, astMeta))
}
}
console.log(node)
return {
name: name,
attributes: {value: value},
......
import React from 'react'
class UserIO extends React.Component {
constructor(props) {
super(props)
this.state = {
programOutput: "",
programInput: ""
}
}
onInputChange = (evt) => {
this.setState({programInput: evt.target.value})
}
onSubmitClick = (evt) => {
this.setState((state, props) => ({
programOutput: state.programInput
}))
}
render() {
return (
<div className="user-io">
<textarea className="user-io-output" value={this.state.programOutput} />
<div className="user-io-input">
<input value={this.state.programInput} onChange={this.onInputChange}></input>
<button type="submit">submit</button>
</div>
</div>
)
}
}
export default UserIO;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment