dbaumgarten / yodk

Development Kit for Starbase's ingame programming language YOLOL
MIT License
57 stars 16 forks source link

Incomplete Compilation #110

Closed Wolvereness closed 2 years ago

Wolvereness commented 2 years ago

Describe the bug Wrote a script that should be exactly 20 lines. Only 19 lines are outputted.

To Reproduce

macro Prop() line
    :PropUsage = (PropOld - :PL - :PR) / 4; PropOld = :PL + :PR $
end

Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()
Prop()

Expected behavior

:PropUsage=(a-:PL-:PR)/4 a=:PL+:PR
:PropUsage=(b-:PL-:PR)/4 b=:PL+:PR
:PropUsage=(c-:PL-:PR)/4 c=:PL+:PR
:PropUsage=(d-:PL-:PR)/4 d=:PL+:PR
:PropUsage=(e-:PL-:PR)/4 e=:PL+:PR
:PropUsage=(f-:PL-:PR)/4 f=:PL+:PR
:PropUsage=(g-:PL-:PR)/4 g=:PL+:PR
:PropUsage=(h-:PL-:PR)/4 h=:PL+:PR
:PropUsage=(i-:PL-:PR)/4 i=:PL+:PR
:PropUsage=(j-:PL-:PR)/4 j=:PL+:PR
:PropUsage=(k-:PL-:PR)/4 k=:PL+:PR
:PropUsage=(l-:PL-:PR)/4 l=:PL+:PR
:PropUsage=(m-:PL-:PR)/4 m=:PL+:PR
:PropUsage=(n-:PL-:PR)/4 n=:PL+:PR
:PropUsage=(o-:PL-:PR)/4 o=:PL+:PR
:PropUsage=(p-:PL-:PR)/4 p=:PL+:PR
:PropUsage=(q-:PL-:PR)/4 q=:PL+:PR
:PropUsage=(r-:PL-:PR)/4 r=:PL+:PR
:PropUsage=(s-:PL-:PR)/4 s=:PL+:PR
:PropUsage=(t-:PL-:PR)/4 t=:PL+:PR

Actual output

:PropUsage=(a-:PL-:PR)/4 a=:PL+:PR
:PropUsage=(b-:PL-:PR)/4 b=:PL+:PR
:PropUsage=(c-:PL-:PR)/4 c=:PL+:PR
:PropUsage=(d-:PL-:PR)/4 d=:PL+:PR
:PropUsage=(e-:PL-:PR)/4 e=:PL+:PR
:PropUsage=(f-:PL-:PR)/4 f=:PL+:PR
:PropUsage=(g-:PL-:PR)/4 g=:PL+:PR
:PropUsage=(h-:PL-:PR)/4 h=:PL+:PR
:PropUsage=(i-:PL-:PR)/4 i=:PL+:PR
:PropUsage=(j-:PL-:PR)/4 j=:PL+:PR
:PropUsage=(k-:PL-:PR)/4 k=:PL+:PR
:PropUsage=(l-:PL-:PR)/4 l=:PL+:PR
:PropUsage=(m-:PL-:PR)/4 m=:PL+:PR
:PropUsage=(n-:PL-:PR)/4 n=:PL+:PR
:PropUsage=(o-:PL-:PR)/4 o=:PL+:PR
:PropUsage=(p-:PL-:PR)/4 p=:PL+:PR
:PropUsage=(q-:PL-:PR)/4 q=:PL+:PR
:PropUsage=(r-:PL-:PR)/4 r=:PL+:PR
:PropUsage=(s-:PL-:PR)/4 s=:PL+:PR

Platform:

dbaumgarten commented 2 years ago

Ok, this one was interesting. If the compiler notices, that the generated yolol is 21 lines long, but the 21th line just consists of a goto1, it attempts to remove that line. Unfortunately (probably because of a typo) it also removed the 20th line...

dbaumgarten commented 2 years ago

Published as part of v0.1.10