tom-writes-code / rpgle-repl Goto Github PK
View Code? Open in Web Editor NEWA green-screen REPL style workspace to assist with RPGLE development
License: MIT License
A green-screen REPL style workspace to assist with RPGLE development
License: MIT License
repl cannot interpret nested data structures. For example, take the following code:
dcl-ds individual qualified;
dcl-ds name;
forename char(10);
surname char(10);
end-ds;
age packed(3);
end-ds;
individual.name.forename = 'Tom';
individual.name = individual.name;
individual.age = 32;
individual = individual;
Actual output should be:
individual.name.forename = 'Tom'; // individual.name.forename = 'Tom'
individual.name = individual.name; // individual.name.forename = 'Tom'
// individual.name.surname = ''
individual.age = 32; // individual.age = 32
individual = individual; // individual.name.forename = 'Tom'
// individual.name.surname = ''
// individual.age = 32
Somewhere since 2.3.9, Bob has changed and the project will no longer build successfully. In particular, the recipes to build the RPGLEREF members, and to package the save file no longer work. I also noticed some errors related to the CCSID.
When evaluation SQL statements, we print the SQL state and code.
We should also show the values of any variables which have been subject to change.
I think it will suffice to grab everything after either SET or INSERT INTO - there'll be some fairly interesting parsing out of these!
dcl-s myArray Char(10) dim(*AUTO : 1000);
myArray(*NEXT) = 'Hello';
myArray(*NEXT) = 'World';
I get the following error for each of the two executed lines:
*RNF0203 30 2 Refer to the compiler listing where this message was first issued.
147 myArray(*NEXT) = 'World';
148 repl_MAIN_39468356_single(
149 4:
150 'myArray(*NEXT)':
151 myArray(*NEXT));
======> aaaaa
*RNF0203 30 a 000000 INDEX *NEXT IS NOT ALLOWED HERE.
When using the BASH install script and when trying to manually download the savefile and restoring to a v7.3 system, the objects in file can't be restored or viewed.
from running the install.sh script...
** Download complete.
**
** Checking if target application library RPGREPL exists... present.
** Deleting library RPGREPL... done.
** Creating application library RPGREPL... done.
** Restoring save file... CPF3743: File cannot be restored, displayed, or listed.
Could you have, like, a React frontend for this?
I installed to my organization's IBM i by
When I try to compile something with the tool, the spool file listing has an issue opening an include member. Image of the spool listing is attached.
I do have the target library where the objects were installed in the library list.
Now that we're free from the confines of our previous change management system, multi-module programs are not as painful to develop.
I think the architecture could be improved by changing the binding so that most of the existing service programs are ditched, and we instead bind the module in directly to the program. REPL_HLPR would be the exception, since that's used in the generated program.
We have a number of reference sources which contain fixed format. Currently, if we attempt to /include
these in REPL then it fails to compile. It would be nice to be able to use these in REPL.
I've also been informed that reference sources in free format with comments after declarations also fails to compile.
E.g. dcl-c someConstant 'blah'; // Some constant
in a reference source won't compile if we /include
it
I tried having a ctl-opt statement on the first line of code to specify a binding directory to use for an exported sub procedure in a service program.
That doesn't seem to be viable when I look at the attached screenshot of the spool listing. It would be very nice to have this ability in order to have snippets that demonstrate usage of existing service programs.
Adding the REPL app library to your library list manually is a bit of a chore. My thinking was that, during deployment, we could change the REPL
command to set the product library (PRDLIB
) to the installation library. This then gets automatically added to the library list while REPL is active, and removed afterwards.
This mostly works. It allows the REPL command to find the command processing program, despite that being set find it in the library list. However, compiles fail because it can't find QRPGLEREF. I think this is because the IBM compilers override the product library, so REPL isn't in the library list during compilation.
I think we should change REPL to retrieve the program object's library (this can be found in the PSDS) and explicitly add this to the library list. Similarly, remove it on exit, unless it was already present before the program started.
The last piece of this is we can create a proxy command for the REPL command, and place this in a more commonly-accessible library like QSYS or QGPL.
Hi Tom and or Martin,
first I have to explain that I am 54 year old RPG Programmer and I am using github for the first time in my life. So please forgive me when I am not familiar with the habbits at this place.
The current version of rpgle-repl crashes when I press F11 for compile.
I found out that two members are not suplied within the installation.
The members are QRPGLEREF,REPL_HLPR and QRPGLEREF,REPL_PSEUT.
After I loaded them down manually and put them into QPRGLEREF it worked.
Best regards
Stefan Libuda (EtherionSL)
If you have a lot of spooled files, it’s slow to navigate to the compiler output. Perhaps we could take the timestamp from before the compile commands are issued, and then plug this into the filters on WRKSPLF?
We could probably also specify the job name since the compiles happen interactively.
REPL does not create **FREE objects, and so the source can run off the page, preventing compilation. The following example fails to compile:
dcl-ds legal_individual_details qualified;
full_name_for_correspondence_purposes char(50);
end-ds;
legal_individual_details.
full_name_for_correspondence_purposes = 'Mr Tom';
The generated source clearly shows generated procedure dcl-proc replResult_MAIN_LEGAL_INDIVIDUAL_DETAILS_FULL_NAME_FOR_CORRESP
running way beyond 80 characters.
REPLVARS has a unique variable ID per variable - we should be able to use this instead of the name, and then we never need to worry about long variable names again.
Spun off from issue #12
The release creation/upload is quite manual at the moment. In #12 I created I accidentally forgot to specify the target release option.
I propose one, maybe two, enhancement(s):
Create a shell script in the project to run the Bob makei
command with our desired arguments (e.g. TGTRLS=V7R3M0
).
Optionally, a second script that uses the Github API to create the release and upload the save file.
When taking the option to load snippets, REPLLOAD is very slow to open. It is also slow to change user, or toggle between saved/unsaved snippets.
The call stack shows that it is spending a long time sat here:
The stated line is the "SELECT(...LISTAGG..." statement in fetchStoredSnippets()... which is almost certainly badly inefficient.
I get this msg when compiling. REPLREFBLD doesn't seem to be included in the savf. What did I miss? I installed using the save file RPGLEREPL.FILE
Have a new mode on repl that allows for running code without attempting to interpret it and show results.
This will allow for running code without compiler errors (which are the most common cause for problems).
Optional best bits:
I saved a snippet, went to load it and it wasn't there. Figured out I could wipe out the profile to see all and discovered my saved snippets under my group profile.
I would like to see them saved under my actual profile (the one shown when I go to the load screen).
Version: 76312E302E302D626574 61
As per title.
I've noticed when reviewing the save file that we include more objects than strictly necessary.
We should add more omissions for:
It occurs to me that it would be powerful to have REPL tests available to run in a test suite, as part of a ci/cd pipeline.
I would like to be able to call REPL via bash command, and it return 0 if all tests pass, and not zero if there is a failure. It would be nice to have stdout be the screen output, controlled via parameter (like REPL -v REPLTESTS
would print everything to stdout, while REPL REPLTESTS
would not).
The following snippet fails to compile
dcl-s DatabasePassword varchar(1000);
dcl-s PasswordMatchTestResult ind;
userPassword = 'Password';
databasePassword = 'Password';
passwordMatchTestResult = (UserPassword = DatabasePassword);```
The main Bob makefile has changed... again. So we need to update our custom recipes to ensure they log the same way as the normal build targets.
Hi,
I can't install the latest version (2.2.0) using the install.sh script or manual installation because the savefile seems to be missing on the release page. Would it be possible to add this file?
Thanks!
The following snippet fails to compile:
dcl-ds a qualified template;
dcl-ds b ;
dcl-ds c ;
d char(1);
end-ds;
end-ds;
end-ds;
dcl-s r char(1);
dcl-ds r1 likeds(a);
dcl-ds r2 likeds(a);
r1.b.c.d = 'X';
eval-corr r2 = r1;
r = r2.b.c.d;
Hello
I'm an extremely noobish IBMi dev (just started on that tech stack two months ago) and this project would be extremely useful for me if I could use it.
However, when I write even very simple lines of codes and hit F11, it displays the message Module not created. F7 to check spool files, F17 to view generated source
:
If I remove line number 4 where I assign to the variable it runs fine but shows no output.
Checking the spool file for REPL_MOD I can see this:
Membre source modifié le 21/04/22 15:42:55
5770ST1 V7R3M0 160422 Créer un objet RPG ILE SQL REPL_SRC 21/04/22 15:42:55 Page
MESSAGES DE DIAGNOSTIC
98 COALESCE(MAX(result_number),0)+1, 000000
5770ST1 V7R3M0 160422 Créer un objet RPG ILE SQL REPL_SRC 21/04/22 15:42:55 Page
MESSAGES DE DIAGNOSTIC
ID-MSG GRAV ENREG TEXTE
SQL0104 30 98 Position 49 Elément syntaxique ,0 n'est pas correct.
Eléments possibles : ) ,.
Récapitulatif des messages
Total Info Avertissement Erreur Grave Terminal
1 0 0 0 1 0
Erreurs de gravité 30 trouvées dans le source
104 enregistrements source traités
* * * * * F I N D E L I S T E * * * * *
(pardon my company's French) So it looks like some kind of syntax error on the SQL request occurs.
Now, I'm just throwing stuff into the wind here, but because I have no experience with this platform and I know that encoding of characters on IMBi is massively complex, I'm wondering if this might be due to my install method.
Thing is, my company's as400 is firewalled so I couldn't use the default method for install, I had to download the savefile, then I copied it into the IFS through IBM Rational Developer for i
, and then I ran the following commands:
CPYFRMSTMF FROMSTMF('/home/me/RPGLEREPL.FILE')
TOMBR('/qsys.lib/qgpl.lib/RPGLEREPL.FILE') MBROPT(*REPLACE) CVTDTA(*NONE)
CRTLIB LIB(RPGREPL) TEXT('REPL tool for ILE RPG snippets')
RSTOBJ OBJ(*ALL) SAVLIB(REPLBOB) DEV(*SAVF) SAVF(QGPL/RPGLEREPL) ALWOBJDIF(*COMPATIBLE) RSTLIB(RPGREPL)
CHGCMD CMD(RPGREPL/REPL) PRDLIB(RPGREPL)
When compiling a program, delete all spool files named REPL_SRC and REPL_MOD belonging to this user before doing a new compilation.
Since toUpperCase is used so frequently adding RTNPARM to the DCL-PI statement would improve performance.
The EXEC SQL function is fine, but QlgConvertCase API would also help but isn't strictly what I'm suggesting here.
`dcl-proc toUpperCase export;
dcl-pi *n varchar(512) RTNPARM;
lowerString varchar(512) const;
end-pi;
dcl-s upperString varchar(512);
exec sql SET :upperString = UPPER(:lowerString);
return upperString;
end-proc;`
code result
dcl-s ts timestamp;
dcl-s ts03 timestamp(03);
dcl-s ts06 timestamp(06);
dcl-s ts12 timestamp(12);
ts = %timestamp; TS = '2022-04-25-21.44.10.117076'
ts03 = %timestamp; Statement cannot be evaluated
ts06 = %timestamp; Statement cannot be evaluated
ts12 = %timestamp(*unique); Statement cannot be evaluated
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.