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

Change formatting of PostScriptOp #44

Merged
merged 7 commits into from
Oct 30, 2024
Merged

Conversation

LaurenzV
Copy link
Contributor

I hope that change is okay. It's very hard to deal with borrowed slices if your code building logic is based on recursion, which I believe shouldn't be uncommon (at least it's necessary in my case).

@LaurenzV
Copy link
Contributor Author

and one more small change: having each operator on a new line looks very unreadable for long code, so I would suggest separating them by space instead.

@laurmaedje
Copy link
Member

laurmaedje commented Oct 27, 2024

For what it's worth, you could probably keep the recursion and the borrowed data by using an arena data structure and it would be much more efficient. E.g. bumpalo (untyped, but it's okay since no Drop is needed here) or typed-arena (also works for Clone types, but fixed to one type). You would create an arena at the top level and pass it down (via immutable reference) and have just one allocation instead of many.

@LaurenzV
Copy link
Contributor Author

Will look into it, thanks!

@LaurenzV
Copy link
Contributor Author

Seems to work great. 😄 So it's only the formatting thing I would like to change.

@LaurenzV LaurenzV changed the title Make PostScriptOp owned Change formatting of PostScriptOp Oct 28, 2024
@laurmaedje laurmaedje merged commit 7287eb1 into typst:main Oct 30, 2024
2 checks passed
@laurmaedje
Copy link
Member

Thanks!

@LaurenzV LaurenzV deleted the postscript branch October 30, 2024 12:26
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.

2 participants