Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
rk4718
wacc_26_web_client
Commits
92346500
Commit
92346500
authored
Mar 13, 2020
by
Matej Genci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code hygiene
parent
fdc4bb11
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
3 additions
and
81 deletions
+3
-81
src/App.css
src/App.css
+1
-1
src/App.js
src/App.js
+1
-31
src/Comm.js
src/Comm.js
+1
-12
src/view/UserIO.js
src/view/UserIO.js
+0
-37
No files found.
src/App.css
View file @
92346500
...
...
@@ -5,7 +5,7 @@ body {
}
.App
{
margin
:
5
0px
20px
0px
20px
;
margin
:
2
0px
20px
0px
20px
;
}
.App-code-editors
{
...
...
src/App.js
View file @
92346500
...
...
@@ -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
()};
};
...
...
src/Comm.js
View file @
92346500
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
},
...
...
src/view/UserIO.js
deleted
100644 → 0
View file @
fdc4bb11
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment