Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible issue with the mapRange function of the AbstractAntlrListener class #1235

Closed
NiklasHeneka opened this issue Aug 10, 2023 · 1 comment
Labels
bug Issue/PR that involves a bug language PR / Issue deals (partly) with new and/or existing languages for JPlag minor Minor issue/feature/contribution/change

Comments

@NiklasHeneka
Copy link
Contributor

There is a possible issue with the mapRange function of the AbstractAntlrListener class or maybe I just misunderstand something
@TwoOfTwelve.

After updating the LLVM IR language module to the new structure I saw that the printing of the token was different.

In the old structure you could use following method and for printing tokens with descriptions that are too long it would generate the "|" at the end and not directly after it.

transformToken(<TokenType>, ctx.getStart(), ctx.getStop());

An example:

17        %5 = alloca %struct.Struct, align 4
               |ALLOC                       |

18        store i32 0, ptr %1, align 4
          |STORE                     |

19        store i32 4, ptr %2, align 4
          |STORE                     |

20        %6 = load i32, ptr %2, align 4
               |LOAD                   |

21        %7 = add nsw i32 5, %6
               |ADD            |

22        store i32 %7, ptr %3, align 4
          |STORE                      |

23        %8 = load i32, ptr %2, align 4
               |LOAD                   |

24        %9 = sub nsw i32 5, %8
               |SUB            |

With the new language module structure neither mapRange nor mapEnter generate the second "|" for many token types.
It just looks like this:

18        %5 = alloca %struct.Struct, align 4
               |ALLOC

19        store i32 0, ptr %1, align 4
          |STORE

20        store i32 4, ptr %2, align 4
          |STORE

21        %6 = load i32, ptr %2, align 4
               |LOAD

22        %7 = add nsw i32 5, %6
               |ADD

23        store i32 %7, ptr %3, align 4
          |STORE

24        %8 = load i32, ptr %2, align 4
               |LOAD

25        %9 = sub nsw i32 5, %8
               |SUB

Although for other tokens it does place a second "|" at the end.
I am not sure if this is a bug or I am just misunderstanding something.

@tsaglam tsaglam added bug Issue/PR that involves a bug minor Minor issue/feature/contribution/change language PR / Issue deals (partly) with new and/or existing languages for JPlag labels Aug 11, 2023
@tsaglam
Copy link
Member

tsaglam commented Aug 11, 2023

Closed, as this was addressed by #1236.

@tsaglam tsaglam closed this as completed Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue/PR that involves a bug language PR / Issue deals (partly) with new and/or existing languages for JPlag minor Minor issue/feature/contribution/change
Projects
None yet
Development

No branches or pull requests

2 participants