#169 Declined
Repository
roskakori/pygments-mainframe pygments-mainframe
Branch
default
Repository
birkenfeld/pygments-main pygments-main
Branch
default

Added lexers for Rexx, Easytrieve, JCL and (Web)FOCUS.

Author
  1. Thomas Aglassinger avatarThomas Aglassinger
Reviewers
Description

This pull request adds lexers for 4 languages popular in mainframe related environments:

  1. Rexx is a scripting language available for a wide range of different platforms with its roots found on mainframe systems. It is popular for I/O- and data based tasks and can act as glue language to bind different applications together.

  2. Job Control Language (JCL) is a scripting language used on mainframe platforms to instruct the system on how to run a batch job or start a subsystem. It is somewhat comparable to MS DOS batch and Unix shell scripts.

  3. Easytrieve is a programming language for extracting, filtering and converting sequential data. Furthermore it can layout data for reports. It is mainly used on mainframe platforms and can access several of the mainframe's native file formats. It is somewhat comparable to awk.

  4. (Web)FOCUS is a language for business intelligence applications. It enables to describe, query and modify data from various sources including mainframe platforms. It also includes FIDEL, a language to describe input forms.

I included example files to exercise each lexer. The standard test suite runs successfully.

I also had to improve MasonLexer.analyze_text(), which now checks for <& ... &> instead of just <&. This keeps it from thinking that (Web)FOCUS FIDEL forms are Mason scripts.

Comments (6)

  1. Thomas Aglassinger author

    As suggested, I moved the Easytrieve delimiters to constants to make the regular expressions easier to read and maintain.

    I also added lexers for FOCUS access and master files (which serve a somewhat similar function as SQL's create table statements) and FOCUS style sheets (which are somewhat comparable to CSS).

  2. Tim Hatch

    This will probably take at least another roundtrip before merging, as it's fairly big and I just picked out the obvious things. Also, WebFocusLexer is probably big/confusing enough to get its own pull request, but we can continue with this one if you'd like.

  3. Thomas Aglassinger author

    Thanks for your thorough review. I addressed most of the issues and updated the pull request with the following exceptions:

    • Using #pop instead of root: makes sense, I'll look into it; see my comment for details.
    • Using '' to skip errors in FOCUS masters: this does not seem to meet my goals so I tend to keep the current logic. See my comment for details.

    Moving WebFOCUS to a separate pull request is fine with me. Do you prefer to keep the other 3 languages in this one or are 4 separate pull requests the easiest way for you to handle it?

    Just tell me your preference and I'll spit it up.

  4. Tim Hatch

    Let's move WebFocus to its own pull request, the rest can stay here together.

    From what I remember, you shouldn't need anything special to skip a single char as an error and start over at root; I tried this with Python and it works that way. See echo 'x = `x' | pygmentize -l python (can you try this?)

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.