-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@syntax and common blocks #1980
Comments
it looks like there is an "error" in lib/units_gv.pro , that is, something GDL did not digest, so probably that's why the 'gv' procedure is not defined, and all the long list of errors messages. |
Possibly, but when I type @lib/units_gv.pro into the gdl prompt, no errors appear. It is only when running it through my initial IDL program that I see the "Error opening file: xxxx". Same for when I write .r pro/gv.pro. There is no verbose mode or anything which can make it produce more error messages, right? I use a startup program which is as follows: dir_gv = getenv('DIR_GV'); If I use gdl on this program, I get: gdl gdl_gv.pro
% Compiled module: IDLRC_GV. Joey |
@joeymukherjee I see you use version 1.0.1 , dated 2021 |
I upgraded to 1.1 from the Debian unstable branch. I get the same issue: GDL - GNU Data Language, Version v1.1
% Compiled module: KEYWORD_EXISTS. |
the error comes from UNITS common not containing variables (having no declared variables) |
So this is interesting: if I run dos2unix on my lib/units_gv.pro, I get a different error which is more explanatory! Apparently, I need to define "SHELL" in my environment. Once I did that, I got further and it now stopping on DLM_REGISTER which makes sense. So one incompatibility with IDL and GDL is you can mix DOS/Unix line endings and IDL handles them differently than GDL! Not sure how easy or hard this is to fix? |
@joeymukherjee ah but this is yet another story! very interesting find, although it should not be possible because the gdl parser written in ANTLR is supposed to deal with the DOS line endings ( aka "\r\n" ). Perhaps a regression following the recent changes in GDL syntax. And yes GDL does not have yet support for DLM... |
@joeymukherjee I cannot reproduce a problem in '@something' if 'something' is DOS-like. |
I have large old codebase of IDL code that doesn't quite work in GDL, but maybe there is an easy way to fix. I will admit, I don't know IDL that well, but just enough to have it running.
Our code has things like this in there:
@lib/units_gv.pro
.r gv
which I think compiles the code and and runs the routine referenced inside. This routine has this:
common units, angstrom, nm, um, micron, cm, inch, foot, mile, mm, m, meter, km, $
gram, kg, au, pi, $......
and it is very long.
The error message I get from GDL is:
% Error opening file: lib/units_gv.pro$MAIN$
% Error opening file. File: gv
% Common block: UNITS must contain variables.
At: gv.pro
% Procedure not found: GV
% Execution halted at:
I have no idea what to "google" to look for this type of syntax, nor do I have any idea how to fix? Any ideas?
To be clear, this works perfectly in IDL v8.5+, but I am now trying to run under a container so GDL would be very helpful! I feel like it did work with IDL v7 since the code is extremely old.
Thanks,
Joey
The text was updated successfully, but these errors were encountered: