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
264f6513
Commit
264f6513
authored
Mar 13, 2020
by
Matej Genci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make printing without newline possible
parent
4dd3c938
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
6 deletions
+24
-6
public/index.html
public/index.html
+14
-0
src/App.js
src/App.js
+7
-5
src/Comm.js
src/Comm.js
+1
-1
src/index.js
src/index.js
+2
-0
No files found.
public/index.html
View file @
264f6513
...
@@ -11,6 +11,20 @@
...
@@ -11,6 +11,20 @@
/>
/>
<script>
<script>
var
EMULATOR_CONSOLE_READ
=
()
=>
{
return
window
.
prompt
()};
var
EMULATOR_CONSOLE_READ
=
()
=>
{
return
window
.
prompt
()};
// Fixes for printing with new lines.
let
waccPrintingBuffer
=
""
function
waccPrint
(
str
)
{
printing_buffer
+=
str
}
function
waccPrintLn
(
str
)
{
waccPrint
(
str
+
"
\n
"
)
}
function
waccPrintFinished
()
{
console
.
log
(
waccPrintingBuffer
)
}
</script>
</script>
<link
rel=
"apple-touch-icon"
href=
"%PUBLIC_URL%/logo192.png"
/>
<link
rel=
"apple-touch-icon"
href=
"%PUBLIC_URL%/logo192.png"
/>
<!--
<!--
...
...
src/App.js
View file @
264f6513
...
@@ -60,7 +60,10 @@ class App extends React.Component {
...
@@ -60,7 +60,10 @@ class App extends React.Component {
clearConsole
=
()
=>
{
clearConsole
=
()
=>
{
this
.
setState
({
consoleReset
:
this
.
state
.
consoleReset
+
1
})
this
.
setState
({
consoleReset
:
this
.
state
.
consoleReset
+
1
})
}
}
processWaccCode
=
async
(
code
)
=>
{
processWaccCode
=
async
(
code
)
=>
{
eval
(
"
waccPrintingBuffer = ''
"
)
let
rsp
=
await
sendWaccCode
(
code
);
let
rsp
=
await
sendWaccCode
(
code
);
let
graph
=
this
.
state
.
graphData
;
let
graph
=
this
.
state
.
graphData
;
if
(
typeof
rsp
.
isError
!==
"
undefined
"
)
{
if
(
typeof
rsp
.
isError
!==
"
undefined
"
)
{
...
@@ -73,8 +76,6 @@ class App extends React.Component {
...
@@ -73,8 +76,6 @@ class App extends React.Component {
graphData
:
graph
graphData
:
graph
})
})
}
}
}
}
render
()
{
render
()
{
...
@@ -90,10 +91,11 @@ class App extends React.Component {
...
@@ -90,10 +91,11 @@ class App extends React.Component {
this
.
processWaccCode
(
this
.
state
.
wacc
.
code
)
this
.
processWaccCode
(
this
.
state
.
wacc
.
code
)
this
.
clearConsole
()
this
.
clearConsole
()
}}
}}
onStepJsClick
=
{(
e
)
=>
{
onExecuteClick
=
{(
e
)
=>
{
this
.
setState
({
js
:
{
code
:
"
Hello World!
"
}})
eval
(
this
.
state
.
js
.
code
)
eval
(
"
waccPrintFinished()
"
)
}}
}}
onStep
OverAst
Click
=
{(
e
)
=>
{
onStep
Wacc
Click
=
{(
e
)
=>
{
this
.
readInputCallBack
(
e
)
this
.
readInputCallBack
(
e
)
}}
}}
/
>
/
>
...
...
src/Comm.js
View file @
264f6513
...
@@ -25,7 +25,7 @@ function generateArmMarkers(lineNums) {
...
@@ -25,7 +25,7 @@ function generateArmMarkers(lineNums) {
}
}
function
createGraphNode
(
node
,
astMeta
){
function
createGraphNode
(
node
,
astMeta
){
let
name
=
node
.
name
;
let
name
=
node
.
name
.
replace
(
"
AST
"
,
""
)
;
let
value
=
node
.
value
;
let
value
=
node
.
value
;
let
childrenIDs
=
node
.
children
;
let
childrenIDs
=
node
.
children
;
let
children
=
[];
let
children
=
[];
...
...
src/index.js
View file @
264f6513
...
@@ -3,7 +3,9 @@ import ReactDOM from 'react-dom';
...
@@ -3,7 +3,9 @@ import ReactDOM from 'react-dom';
import
'
./index.css
'
;
import
'
./index.css
'
;
import
App
from
'
./App
'
;
import
App
from
'
./App
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
import
*
as
serviceWorker
from
'
./serviceWorker
'
;
export
var
test
=
""
export
var
test
=
""
ReactDOM
.
render
(
<
App
/>
,
document
.
getElementById
(
'
root
'
));
ReactDOM
.
render
(
<
App
/>
,
document
.
getElementById
(
'
root
'
));
// If you want your app to work offline and load faster, you can change
// If you want your app to work offline and load faster, you can change
...
...
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