xoofx / xoofx/CppAst.NET

preserve order when auto-squashing typedefs

Open
#8 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
620
Forks
79
Avg merge
14h 27m
Merged PRs (30d)
1

Description

I'm using F# where the order of declaring functions, structs, etc somewhat matters. If I can, I'd like to preserve that order (coming from a C header). the auto-squashing type defs would be nice, but when I iterate through the parsed children ICppDeclaration s they are thrown in after all the squashed classes, causing the order to break.
Would this be an easy fix, or should I just turn off auto-squashing and parse the typedefs?

by the way, thanks for making this! it's saving me a lot of time.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the auto-squashing implementation and the traversal that exposes parsed ICppDeclaration children; reproduce the ordering issue with a C header containing typedefs and declarations. Done means auto-squashing remains enabled while iterating children preserves the header declaration order for the reported F# use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, csharp, fsharp
Domain
compilers
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.