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

Position tokens not supported by cpp-nostl backend #297

Open
4 of 5 tasks
andreasabel opened this issue Oct 3, 2020 · 0 comments
Open
4 of 5 tasks

Position tokens not supported by cpp-nostl backend #297

andreasabel opened this issue Oct 3, 2020 · 0 comments
Labels
C++ enhancement position Concerning position information in parsed AST
Milestone

Comments

@andreasabel
Copy link
Member

andreasabel commented Oct 3, 2020

Position tokens lack support in the following backends, the test #235 fails now for these backends (since I added a position token declaration to the test case).

Remaining TODO (low-prio):

  • respect position in token declarations in CPP-NoSTL backend.
@andreasabel andreasabel added bug C++ Java Agda Issues of the Agda backend position Concerning position information in parsed AST labels Oct 3, 2020
@andreasabel andreasabel added this to the 3.0 milestone Oct 3, 2020
andreasabel added a commit that referenced this issue Oct 3, 2020
Used to work only for string tokens.
andreasabel added a commit that referenced this issue Oct 3, 2020
Currently do not work for all backends.  Problems with:

* agda
* cpp-nostl
* cpp with namespace
* java -jflex
andreasabel added a commit that referenced this issue Oct 5, 2020
The position parts are bound to a postulated type #Int with postulated
conversions to Nat.

Since position tokens are represented in Haskell rather ugly as

  newtype MyPosId = MyPosId ((Int, Int), String)

we also have to define a type of pairs that we bind to Haskell's tuple
type.

TODO: generate nicer interface to access contents of a position token,
like projections that return line, column, and string.
@andreasabel andreasabel removed the Agda Issues of the Agda backend label Oct 5, 2020
andreasabel added a commit that referenced this issue Oct 5, 2020
Was missing namespace prefixing.
@andreasabel andreasabel changed the title Position tokens not supported by all backends Position tokens not supported by cpp-nostl backend Oct 5, 2020
andreasabel added a commit that referenced this issue Oct 5, 2020
The regression, non-compileable Skeleton.C, was introduced during the
fix of #277 in 4fb4116.

CPP/STL respects position tokens, CPP/NoSTL ignores `position`.
The unification of the Skeleton-generators broke cpp-nostl.

Fixed by workarounds that treat position tokens just as tokens when
useSTL == False.
andreasabel added a commit that referenced this issue Oct 5, 2020
Regression was introduced in e8abd9f,
fix of #100, which unified the printer generators for cpp and
cpp-nostl.  Unfortunately, this did not respect the different
representation of position tokens in cpp (proper classes) and
cpp-nostl (just like tokens).

Fixed by workarounds that check useSTL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ enhancement position Concerning position information in parsed AST
Projects
None yet
Development

No branches or pull requests

1 participant