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

Dlang support #431

Closed
wants to merge 11 commits into from
Closed

Dlang support #431

wants to merge 11 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 8, 2023

Initial support for the D programming language. So far I have a few examples working and building and am working on fixing up the rest. I haven't done anything with the documentation yet, but can fix that up after all the examples are changed over. I am far from an expert in D, so the examples may not be very idiomatic.

So far I can build re2d with cmake and make and can run the examples like:

> re2c-build/re2d -w 01_fill.re -o 01_fill.d
> rdmd -g -w -unittest -betterC 01_fill.d

documentation and most of the examples.  Examples are run with rdmd as
`rdmd -g -w -unittest -betterC example.d`.  Adds some files to the
.gitignore that are created when doing an intree build with make.
@ghost
Copy link
Author

ghost commented Jan 9, 2023

Currently failing CI with

make: *** No rule to make target 'doc/manual/syntax/api2_d.rst_', needed by 'src/msg/help.cc'.  Stop.

I will fix that next.

@skvadrik
Copy link
Owner

skvadrik commented Jan 9, 2023

Thanks a lot for working on this, @abenedic ! Great work!

Can you split the work into smaller commits? This will make it easier for review and describe each change in commit message. E.g. one commit per each example, one (or a few) for source code, one (or a few) for documentation. Ideally each commit should build and pass the tests. You can either do this in the current PR (then I will wait until all commits in the PR look good, and then merge) or you can push into a separate branch that will be later merged into master, creating multiple PRs (not necessarily one for PR, but not all in one --- then I can merge commits as you make progress in that branch). Whatever is more convenient for you.

@ghost
Copy link
Author

ghost commented Jan 9, 2023

Can you split the work into smaller commits?

Absolutely! After I finish getting everything working properly I will go back and fix up things to look nicer.

Currently CI is failing with

/home/runner/work/re2c/re2c/build/split_man.py : unknown lang: b'd'

I should have some time later today to fix that and move over more examples.

@ghost
Copy link
Author

ghost commented Jan 9, 2023

Currently CI is failing with

/home/runner/work/re2c/re2c/.build/linux-gcc-ubsan-ootree-full/doc/manpage.rst.d:187: (SEVERE/4) Problems with "include" directive path:
InputError: [Errno 2] No such file or directory: '../../examples/d/includes/definitions.d'.

I will look over the documentation generation more thoroughly later.

@ghost
Copy link
Author

ghost commented Jan 10, 2023

I noticed that one of the tests failed due to the extension being '??' which is set by run_tests.py.in if the first line of the file isn't one of the language dependent options, "// re2d" like for D. Still in the process of converting over the examples.

@skvadrik
Copy link
Owner

Still in the process of converting over the examples.

You don't need to convert them all in one go --- maybe it will be easier to split patches and start review process before converting all examples (if there's something that needs to be reworked, you'll have less work to do). Also, please note that C has more examples than Go and Rust, and you can convert only those present in Go and Rust (others are optional).

@ghost
Copy link
Author

ghost commented Jan 12, 2023

I am going to keep this branch open, and pull bits from this into other pull requests. I just updated it to use the new master.

@ghost ghost closed this Mar 7, 2023
skvadrik added a commit that referenced this pull request Dec 21, 2023
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Dec 23, 2023
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Dec 25, 2023
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Jan 20, 2024
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Jan 31, 2024
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Jan 31, 2024
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Mar 1, 2024
Use examples provided in #431
(suitably modified).
skvadrik added a commit that referenced this pull request Jul 16, 2024
Use examples provided in #431
(suitably modified).
This pull request was closed.
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