Closed horasal closed 8 years ago
One more thing, the test provided by bounty repo says:
Compiling with the following flags should yield the following sums:
None 2+16+64 = 82 (Currently: -910)
-DA 4+32+64 = 100 (Currently: 44)
-DB 32+64 = 96 (Currently: -878)
-DC 2+32+64 = 98 (Currently: -942)
-DA -DB 1+32+64 = 97 (Currently: 51)
-DA -DB -DC 1+32 = 33 (Currently: 35)
However, the ounput of -DA
should be 108
because:
A && !B = 4
!B && A = 8
A || B || C = 32
A || !B || !C = 64
4 + 8 + 32 + 64 = 108
@fredrikbryntesson sent you a mail
@zhaihj is right, it should be 108 and not 100. My bad.
Great job @zhaihj ping @fredrikbryntesson
Merging via #49 (or really, via nagaqueen later today)
Description
This pull request makes the negative version parses correctl. in original rock, the following
will be parsed as
This pull request fixes it to
Implementation Details
No change in the ooc-side (expect re-generatation of the parser). In
nagaqueen
, the old source looks like:where VersionSpec is the block contains things like
( VersionSpec )
,VersionSpec && VersionSpec
andVersionSpec || VersionSpec
. However, forversion(!a && !b)
, because the matching is greedy, once we enter the ruleVersionNegation
, the VersionSpec is matched to the end. Let's consider what!
should affect, it is easy to know that the!
block should only contain:!
()
after!
So the rules should be: