Giter VIP home page Giter VIP logo

rpgle-repl's People

Contributors

martintosney avatar tom-writes-code avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rpgle-repl's Issues

Nested data structures

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;          

The output is as follows:
image

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

Project does not build with Bob v2.4.6

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.

Print out SQL host variables after evaluation

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!

*NEXT arrays don't work

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.

Savefile appears to be created for a target OS > 7.3

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.

Not able to compile

I installed to my organization's IBM i by

  1. cloning this repository to an IFS directory
  2. Modifying iproj.json to point to an existing library
  3. In an SSH session, change to the cloned directory and running makei build

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.

image

Convert from service programs to multi-module program

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.

Including reference sources with fixed format RPG does not compile

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

Cannot use a binding directory, or any other ctl-opt statements

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.

image

Add product library to library list

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.

Programm crashes when F11 is pressed

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.

Error

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)

Navigate to spool file output quicker

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.

Long variable names prevent compilation

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.

Script release creation

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):

  1. Create a shell script in the project to run the Bob makei command with our desired arguments (e.g. TGTRLS=V7R3M0).

  2. Optionally, a second script that uses the Github API to create the release and upload the save file.

Opening saved snippets is exceptionally slow

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:
image

The stated line is the "SELECT(...LISTAGG..." statement in fetchStoredSnippets()... which is almost certainly badly inefficient.

Add "don't interpret" mode

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:

  • Auto-switch to this mode if compilation didn't work
  • Do it line by line? Then you can avoid the bad lines only on those that don't work

Saved snippets save under group profile name

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

More omissions for packaged save file

I've noticed when reviewing the save file that we include more objects than strictly necessary.

We should add more omissions for:

  • EVFEVENT, which contains compiler output
  • All the module objects

Run test suites via command, non-interactively

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).

Long Indicator Variables do not work

The following snippet fails to compile

 dcl-s DatabasePassword varchar(1000);                       
 dcl-s PasswordMatchTestResult ind;                          
                                                             
 userPassword = 'Password';                                  
 databasePassword = 'Password';                              
 passwordMatchTestResult = (UserPassword = DatabasePassword);```

Update build rules for Bob v2.3.5

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.

savefile missing on 2.2.0 release page

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!

Nested Data-Structures and Eval-Corr

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;               

Weird behavior after install from IFS

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:
image

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)

Too many spool files!

When compiling a program, delete all spool files named REPL_SRC and REPL_MOD belonging to this user before doing a new compilation.

Add RTNPARM to toUpperCase Proc

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;`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.