UoY-RoboStar / robochart-textual

This repository contains the plugins for the RoboChart textual editor
Eclipse Public License 2.0
0 stars 1 forks source link

Validator does not distinguish between variables and constants when enforcing STM8 #44

Closed pefribeiro closed 2 years ago

pefribeiro commented 2 years ago

As I was constructing a test case, I found it possible for an operation to required a variable that is provided as a constant by another operation. I believe this is not correct.

Looking at my implementation of STM8, I used the existing method getRVars:

https://github.com/UoY-RoboStar/robochart-textual/blob/f5dba9378f3daa628cdf3d75f336030410500514/circus.robocalc.robochart.textual/src/circus/robocalc/robochart/textual/validation/RoboChartValidator.xtend#L1244-L1273

but this doesn't distinguish between actual variables and constants as it ignores the modifier type. An easy fix for this is to check hat the modifier is the same within the check for STM8, but I do wonder if there are other unrelated issues.