chappertron / lammps-analyser

A linter for the LAMMPS scripting language
GNU General Public License v2.0
0 stars 0 forks source link

Highlight circular dependencies in variables #13

Open chappertron opened 1 month ago

chappertron commented 1 month ago

LAMMPS will crash if a variable is refined in terms of itself, because they are lazily evaluated.

variable x equal 5
variable x equal v_x+5

Should error.

The following does not, however,

variable x equal 5
variable x equal ${x}+5

An appropriate lint would tell the user this alternative.