uwol / proleap-cobol-parser

ProLeap ANTLR4-based parser for COBOL
MIT License
137 stars 74 forks source link

"replace" issue #1

Closed acaramia closed 8 years ago

acaramia commented 8 years ago

Hi, I have an issue with the replacemethod of Cobol85PreprocessorImplclass. The problem could happen when there are two identifiers in currentReplaceableReplacementswhose name is a substring of each other. Example:

REPLACE
==TEST1== by =='VAL1'==
==TEST1-SECOND-PART== by =='VAL2'==

Depending on the order of substitution, you could have this kind of results 'VAL1'-SECOND-PART instead of 'VAL2' when processing TEST1-SECOND-PART I'll try to order the substitution (sort on lenght of tokens and process the longest first) Thanks

uwol commented 8 years ago

Hi @acaramia, yes, please feel free to make a pull request. Currently, I am making refinements to the grammar. So, if you are missing features or find bugs, let me know.

Thanks, Ulrich

uwol commented 8 years ago

merged pull request