-
Notifications
You must be signed in to change notification settings - Fork 87
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
D skeleton file breaks recent D compilers with example code from manual #88
Comments
@adelavais, could you please review this proposal? Thanks in advance! |
I will review it towards the end of the week. Thanks for letting me know! |
Btw, I would like to be able to state in the documentation what version of D we are supporting. I don't know how D "versions" are labeled. I don't know if there are "releases", as for Java, or standards, as for C++. |
I don't really have an answer for supported version, other than I believe DMD is the "reference implementation", and the latest release version of this compiler is what we should aim to support? (Also, it was a coincidence I discovered that the existing skeleton works with gdc 10.x. As previously stated the proposed change does not, I believe, break older compiler versions which would otherwise compile ok - possibly this could be an area to look at in more detail.) |
There are more issues to check: please see also #84. Cheers! |
Reported by ledaniel2. <#88> * data/skeletons/d.m4: Here.
@ledaniel2 Thanks for the report. You may check the fix in the following tarballs.
I would need your email to be able to list you in THANKS. Cheers! |
The following code uses a definition of
reportSyntaxError
taken from the bison manual $10.2.6. The result compiles withgdc
version 10.2.1 but not with more recent versions ofgdc
,ldc
anddmd.exe
. (Note the change tolalr1.d
described in issue #84 is needed, too. The version of bison tested was 3.8.2.12-013d.)Below is the output when compiling the resulting
bison_bug.d
withdmd.exe
v2.098.1:The proposed fix is to apply the following changes to source file
data/skeletons/d.m4
, or the installed/usr/share/bison/skeletons/d.m4
:Now the output is as expected:
A
delegate
is D's term for a lambda function which captures its immediately enclosing scope, and would appear to be the more "modern" way of implementing this pattern (see [Çehreli,2017] $72.4, p485). It should be valid D code for any compiler which can otherwise handle the D output of bison (implements static foreach etc.)[Çehreli,2017] Programming in D, First Edition, Ali Çehreli, 2009-17
The text was updated successfully, but these errors were encountered: