Menu

#2039 Language level needs to be bumped for the 5.02 release.

None
open
nobody
None
tests
5
2025-12-17
2025-12-13
No

The new language features in 5.2.0 also require the language level returned by parse version to be incremented. This probably should have been done for 5.1.0 too.

Discussion

  • Rony G. Flatscher

    A question: so each time a new BIF or a new class gets added to ooRexx an increase to the language level should be undertaken?
    What about adding new methods to existing classes or new arguments to existing BIFs?

     
  • Rick McGuire

    Rick McGuire - 2025-12-15

    Typically the language level has not been bumped for new methods on classes, but yes, new BIFs, new options to BIFs, new instructions, new keywords on instructions, new directives, new keywords on directives, and new builtin environment symbols all merit a bump in language level. Also, related to the other bug I opened, new features like that, when used, need to bump the interpreter level required to run a rexxc compiled image.

     
    • Rony G. Flatscher

      Thank you!
      Ad rexxc related bug entry [bugs:#2040]: wouldn't a bump to a new language level also take care of only running rexxc programs if the language level is at least at the level of the running interpreter?
      Cf. interpreter/classes/support/ProgramMetaData.cpp, validate() in line # 204.

       

      Related

      Bugs: #2040

      • Rick McGuire

        Rick McGuire - 2025-12-15

        No, the image is marked with the interpreter level required to run the program. A big part of the work for 5.0.0 was to allow programs compiled with the latest version to still run on older interpreters as long as the program uses no new features that requires a higher level.

         
        • Rony G. Flatscher

          It seems that these relate to the language level:

          interpreter/parser/LanguageLevel.hpp:63:    MinimumLanguageLevel = LanguageLevel0605,        // the lowest language level we can interpret
          interpreter/parser/LanguageParser.cpp:827:    return l >= MinimumLanguageLevel && l <= MaximumLanguageLevel;
          
          interpreter/parser/LanguageLevel.hpp:64:    MaximumLanguageLevel = LanguageLevel0605,        // the highest language level we can interpret
          interpreter/parser/LanguageParser.cpp:827:    return l >= MinimumLanguageLevel && l <= MaximumLanguageLevel;
          
          interpreter/classes/support/ProgramMetaData.cpp:214:        (bigEndian != 0) != Interpreter::isBigEndian() || !LanguageParser::canExecute((LanguageLevel)requiredLevel))
          interpreter/parser/LanguageParser.cpp:825:bool LanguageParser::canExecute(LanguageLevel l)
          interpreter/parser/LanguageParser.hpp:242:    static bool canExecute(LanguageLevel l);
          

          Bumping the language level to 606 (060600) would probably need to bump LanguageLevel.hpp MaximumLanguageLevel to 0606, keep the MinimumLanguageLevel to 0605, as the interpreter still would be able to execute level 0605?

           
  • Rick McGuire

    Rick McGuire - 2025-12-15

    The PackageClass is marked with the language level required to run the program when it is saved. This language level defaults to the level for the 5.0.0 release. If the parser finds that a newer feature is used, it needs to call the setLanguageLevel() method to update the required language level so that older versions of the interpreter does not try to run the program. If the program being processed does not use any new features, then the program can be compiled using the newer release, but still run on older releases.

    I spotted a small bug with the setLanguageLevel() method. It should only update the requiredLanguageLevel if the new value is larger than the existing value.

     
    • Rony G. Flatscher

      Thanks for the information!

      Also, there is a small bug in Version.cpp which sets the Interpreter::languageLevel to "6.05" (it does not honor api\oorexxapi.h's REXX_CURRENT_LANGUAGE_LEVEL)

       
  • Rony G. Flatscher

    Here is a patch which does the following:

    • it bumps the language level
    • it changes the setLanguageLevel method
    • it moves languageLevel in Interpreter.hpp to protected and adds a public method getLanguageLevelString()
    • it removes the hardcoded "6.05" from Version.cpp and instead uses Interpreter::getLanguageLevelString() in its getVersionString()
    • RexxInfo now uses Interpreter::getLanguageLevelString() to set the languageLevel value

    Requesting comments (planning to apply the patch (for having Jenkins test it on all systems) by the end of the week).

    ---rony

     
    • Rony G. Flatscher

      Committed with [r13051], such that Jenkins can compile on all platforms.

       

      Related

      Commit: [r13051]

  • Rony G. Flatscher

    • Pending work items: none --> tests
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB