Skip to content

Commit 8e04dce

Browse files
committed
Fixed one function pipe bug
added documentation also
1 parent 18c82dc commit 8e04dce

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,13 @@ To run a module simply type ```** moduleName```. It is important to note, the mo
5151
### Pipe Operators
5252
The pipe operator is ```**<<```. To input the output of one module into another is straight forward. To input ```mod1``` into ```mod2``` simply write: ```mod1 **<< mod2```. So far this is not supported with all languages.
5353
## Compiling InterOp
54-
For now, simply run the batfile: ```interOp.bat``` from cmd. The interpreter only reads from one file ```mainscript.txt```.
54+
For now from commandline/powershell run the ```interOp.bat``` file with an ```.interOp``` file as its arg. This will look like this:
55+
```
56+
interOp.bat ".\scripts\python.interOp"
57+
```
58+
This powershell command will run the python file assuming you have python installed. You can find examples for all supported languages, inside the ```/scripts``` folder. If you want an example of what it looks like to run muiltiple language in one file see ```mainScript.interOp``` but as a warning you need all supported languages installed to properlly run. <br>
59+
There are a few valid command line args for ```interOp.bat```. Passing it no arg means it will allow you to select a file via a GUI. This would look like ```interOp.bat``` in the console.
60+
Inputing the number ```1``` as an arg will default the script to reading ```mainScript.interOp```.
61+
5562
#### From R:
5663
You can also run the ```interpreter.R``` file to process the code. If you want to run it in a live R enviorment, simply load ```interpreter.R``` and then run ```master()``` to re-run code.

interpreter.R

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# TO read console input for ths program
88
rm(list=ls()) #This clears all system vars to avoid errors
99
args <- commandArgs(trailingOnly = TRUE)
10-
loadScrit <- function(){
10+
loadScript <- function(){
1111
fileName <- ""
1212
if(is.na(args[1])){
1313
fileName <- choose.files()
@@ -21,11 +21,15 @@ loadScrit <- function(){
2121
if (!require("foreach")) install.packages("foreach", repos='http://cran.us.r-project.org') # The new parallel version requires library parallels
2222
library(foreach)
2323

24-
script <- suppressWarnings(readLines("mainScript.interOp")) #This triggers a warning but not an concern
25-
script <- suppressWarnings(readLines("scripts/r.interOp")) #This triggerss a warning but not an concern
24+
2625

2726
# From loading from a file have to conver to table matrix
28-
#script <- suppressWarnings(readLines(loadScrit()))
27+
script <- suppressWarnings(readLines(loadScript()))
28+
29+
## UNCOMMENT THESE FOR DEV
30+
31+
#script <- suppressWarnings(readLines("mainScript.interOp")) #This triggers a warning but not an concern
32+
#script <- suppressWarnings(readLines("scripts/r.interOp")) #This triggerss a warning but not an concern
2933
script <- as.matrix(script)
3034

3135
# Remove all comments #######THIS COULD ALL BE NOT WORKING BC YOU HAVENT REDEFINED IT AS A MATRIX?
@@ -93,7 +97,8 @@ if(length(allbounds) != 3) {
9397
titleRows <- as.integer(allbounds[,1])
9498

9599
} else if(length(allbounds) == 3 ) {
96-
titleRows <- as.integer(allbounds[,1])
100+
allbounds <- rbind(allbounds)
101+
titleRows <- as.integer(allbounds[1])
97102
} else {
98103
print("faital script error")
99104
}

0 commit comments

Comments
 (0)