Skip to content

Add semantic accessors to macros #4

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

Merged
merged 2 commits into from
Mar 31, 2025
Merged

Conversation

inaki-amatria
Copy link
Member

The title is self-explanatory.

@inaki-amatria inaki-amatria requested a review from a team March 28, 2025 15:28
@inaki-amatria inaki-amatria self-assigned this Mar 28, 2025
@inaki-amatria inaki-amatria requested review from daniel-otero and alvrogd and removed request for a team March 28, 2025 15:28
@inaki-amatria inaki-amatria force-pushed the feature/AddSemanticAccesors branch from d1e2251 to ed304a1 Compare March 28, 2025 17:41
Copy link

@daniel-otero daniel-otero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Care to document a little bit why the changes are required?

I don't have anything against them, but they seems rather arbitrary.

This way we can query the node and implement children-specific logic to
`content` and `alternative`. The nodes below `content` and `alternative`
may be Fortran nodes and not preprocessor directives!! So, for instance,
we want to use `&` as line separator instead of `\`.
We don't want the newline token to show in the AST as it would make our
passes sensible to that specific token. For instance if the source was

```fortran
\#ifdef HAVE_THING
  ! foo
\#endif
```

we wouldn't want to visit the newline character and make our column
limit algorithm split the `#ifdef` as

```fortran
\#ifdef HAVE_THING \

  ! foo
\#endif
```

In other words, this commit is hidding the newline character in the AST.
@inaki-amatria inaki-amatria force-pushed the feature/AddSemanticAccesors branch from d244a7f to aec9397 Compare March 31, 2025 08:24
@inaki-amatria
Copy link
Member Author

Care to document a little bit why the changes are required?

I don't have anything against them, but they seems rather arbitrary.

Done!

@inaki-amatria inaki-amatria merged commit aec9397 into codee Mar 31, 2025
1 check passed
@inaki-amatria inaki-amatria deleted the feature/AddSemanticAccesors branch March 31, 2025 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants