Skip to content

Commit

Permalink
improving main standard snippet for r.eaf
Browse files Browse the repository at this point in the history
  • Loading branch information
Detlef Groth committed Dec 18, 2024
1 parent cf0477f commit 3297c45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jasspa/macros/r.eaf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ elif "elseif (\p) {\r\r}\P" " elif"
else "else {\r\p}\r\P" " else"
while "while (\p) {\r\r}\P" " while"
func "\p <- function (...) {\r\r}\P" " func"
main "main <- function (argv) {\r\r}\rif (sys.nframe() == 0L && !interactive()) {\r main(commandArgs(trailingOnly=TRUE))\r}" " main"
main "main <- function (argv) {\r \p\r\B}\rif (sys.nframe() == 0L && !interactive()) {\r binname=gsub(\"--file=\",\"\",grep(\"--file\",commandArgs(),value=TRUE)[1])\rmain(c(binname,commandArgs(trailingOnly=TRUE)))\r\B}\r\P" " main"
openw "fout = file(\"\pfilename\",'w')\rcat(\"hello line\\n\",file=fout)\rclose(fout)\r\P" " openw"
openr "fin = file(\"\pfilename\", \"r\")\rwhile(length((line = readLines(fin,n=1)))>0) {\r print(line)\r}\rclose(fin)" " openr"
"" ""
Expand Down

0 comments on commit 3297c45

Please sign in to comment.