parsingdata / metal

A Java library for parsing binary data formats, using declarative descriptions.
Apache License 2.0
18 stars 9 forks source link

#381 Move Scope ValueExpressions as parameter of Ref. #411

Closed mvanaken closed 8 months ago

mvanaken commented 9 months ago

The Scope value expression makes no sense without a Ref. The Scope class is removed and the scopeLevel is moved to a parameter for Ref instead. Changed tests accordingly.

Since the scope level and the limit level are now both available within a Ref, we only have to traverse the ParseGraph once and keep track of both parameters when collecting values. This may have a slight performance gain. Also note, that previously the ParseValueCache was never used in combination with Scope class. Now, we can check the value of the scopeLevel to determine if we can use the cache or not.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (d7527dd) 100.00% compared to head (e45c527) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #411 +/- ## =========================================== Coverage 100.00% 100.00% + Complexity 1153 1150 -3 =========================================== Files 99 98 -1 Lines 1536 1537 +1 Branches 157 159 +2 =========================================== + Hits 1536 1537 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.