Status: offline
Registered: 09/22/2008
Posts: 5
|
Hi, I am attempting to write a simple IRAF script to do some image manipulation, but I can't get past the 'parser gagged' error message. I have tried trivial scripts like the one below, but I still get the same error message... In fact, I have tried other inputs (a list file), and no inputs at all (hard-coding the filenames), to no avail. Is it an issue with my login.cl, or my IRAF installation? I tried to redo mkiraf and that didn't work either.[code:1:b4b9f5bc01]procedure junk (img)string imgbegin imarith (img, "/", 2, "half.fits") end[/code:1:b4b9f5bc01]I do a[code:1:b4b9f5bc01] task junk = scripts$junk.cl [/code:1:b4b9f5bc01]to declare the procedure, and then type[code:1:b4b9f5bc01] junk file.fits [/code:1:b4b9f5bc01]to run it.The error message is[code:1:b4b9f5bc01] INTERNAL ERROR: parser gagged
called as: `junk (img=file.fits)' [/code:1:b4b9f5bc01]
Thanks for any help, I am really stumped, because I have written many other scripts with no problem, and am pretty sure the syntax is correct. Of course, it doesn't help that I don't know what "parser gagged" even means!-Jesse Miner
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Let me guess: You use emacs?The script is syntactically fine, however emacs users sometimes get into a mode where the file is missing and EOF or a newline at the end of the last line. I can run your script correctly but can also reproduce the error if I remove the '\n' after the "end" statement. "Parser gagged " in this case means the interpreter saw the EOF before the newline terminating the last statement.-Mike
|
Status: offline
Registered: 09/22/2008
Posts: 5
|
Yes! I use emacs, and there was no \n after the "end". Thanks for the fix, I was really confused as to why I was getting that error message.-Jesse Miner
|