Menu

#2369 X12 Lexer not colourising properly when there are no function groups in the Envelope

Bug
closed-fixed
nobody
5
2023-02-07
2022-12-16
Iain Clarke
No

Most of the time, X12 data will be:
ISA...................' envelope header
GS function group start
...
GE function group end
IEA envelope footer

In order to calculate what comes after each segment, the lexer goes from pos=105 until it hits the GS segment. There can be CR,LF,spaces,nothing, as you wish, as long as it is consistent.

This patch changes that to search for GS or IEA, as it is valid to have an empty envelope. Not very common or useful, as what's the point? But it is valid.
ie:
ISA...................'
IEA....f'

When my software generated an empty envelope it took me a while to work out the problem, as I was distracted by all the red in my data output window and I spent too long tracking down why it was invalid. Hence this fix!

1 Attachments

Discussion

  • Zufu Liu

    Zufu Liu - 2022-12-18
    • labels: --> lexilla, lexer
     
  • Neil Hodgson

    Neil Hodgson - 2022-12-18
    • labels: lexilla, lexer --> lexilla, lexer, x12
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2022-12-18

    Its much better to include an example file as it is difficult to decipher descriptions into text that can be fed into lexers and can become test cases.

    Here is an example that may match the description.

    ISA*00*          *00*          *01*0011223456     *01*999999999      *950120*0147*U*00300*000000007*0*P*~
    IEA*2*000000007
    

    Lexilla is a separate project now and issues should go there.
    https://github.com/ScintillaOrg/lexilla

    Committed with
    https://github.com/ScintillaOrg/lexilla/commit/beb6c8d969e97de196023ec7d23c56ac0da764fa

     
  • Neil Hodgson

    Neil Hodgson - 2023-02-07
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB