1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #1227 new

ABAP highlighter, added keywords

Jorg Thuijls
created an issue

Hi,

Cataloguing some missing things in the ABAP lexer as I was writing an article on string expressions. //edit: I'll try to fix and submit a pull request sometime. In the meantime, cataloguing some missing words:

  • FIELD-SYMBOL
  • REFERENCE INTO.
  • expressions: { my_variable }
  • String literals: |string| and `string`.
  • embedded expressions like |my age is { my_age * 10 }|
  • String chaining operator: '&&'
  • String expressions with formatting options: |{ my_variable CASE = UPPER }|.
  • Literal operator: &.
  • CALL TRANSFORMATION ... RESULT XML DATA(xml).
  • find options: FIND REGEX, RESPECTING CASE, IGNORING CASE, MATCH COUNT, MATCH OFFSET, MATCH LENGTH, SUBMATCHES,

Some of these look tricky.

Thanks for adding ABAP.

Comments (7)

  1. Jorg Thuijls reporter

    Not sure how to add my_string = | string { variable CASE = UPPER }|.. Needs to exclude the stuff between curly brackets but include everything else between pipes (or backticks). Suggestions welcome :-)

  2. Benjamin Schäfer

    I updated my pull request #689 to include all your suggestions. Would be nice if someone could take a look at it. The pipe operators I solved with this tiny regex:

    (r"([\|\}])([^\{\}\|]*?)([\|\{])", bygroups(Punctuation, String.Single, Punctuation)),
    

    So it's basically a String started by } or | and ended by { or |.

  3. Log in to comment