MarkusAmshove / natls

Language Server implementation for the Natural 4GL programming language
MIT License
12 stars 3 forks source link

Mainframe/add not sign equal #495

Open awilkins opened 1 month ago

awilkins commented 1 month ago

This is a valid negative comparator on mainframe and is replaced by ^= on LUW

Should have all behaviours that caret-equals has on LUW

(not sure if ¬ on it's own is a legal character ... but not sure of that for ^ either)

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
70.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

MarkusAmshove commented 1 month ago

Thank you for the contribution :-) If you're unfamiliar with SonarQube (SonarCloud) feel free to ping me and I'll tell you why it is complaining.

awilkins commented 1 month ago

Naah, I'm familiar ... I'm still not even sure that ¬ on it's own is a valid sequence (except probably in variable names because Natural is insane).

MarkusAmshove commented 1 month ago

Looking at the documentation, especially at Logical Operators in Complex Logical Expressions , ¬ is not allowed instead of NOT (for e.g. NOT FALSE).

I also can't find it for variable or object names.

The docs have been wrong quiet a few times in the past though :-) I'd probably take ¬ on its own out and add it later if needed.

You could also add your case above the default case and let it fall through to the default case when not also encountering the =. That way you get a diagnostic. You can then run gradlew fatJar in the repository and run the linter CLI in your natural project and filter for the specific diagnostic id: java -jar /path/to/natls-repo/libs/natlint/build/libs/natlint.jar -d "NPL001" -xlint That will only print diagnostics with that id (-xlint is to skip linting and only do lexing/parsing, to save some time).

awilkins commented 4 days ago

Thanks for the help, and sorry for the long wait for me to pay some attention. Hopefully I'll have some more patches soon.