BRL-CAD / brlcad

BRL-CAD is a powerful cross-platform open source combinatorial solid modeling system
https://brlcad.org
Other
686 stars 140 forks source link

Case insensitive keywords #146

Closed AliHaider93 closed 1 month ago

AliHaider93 commented 2 months ago

The keywords in .k file are case insensitive.

drossberg commented 2 months ago

Would be "Node" be a valid keyword too? In this case, using toupper() would be better.

drossberg commented 2 months ago

Or something similar, see e.g. the Notes in https://en.cppreference.com/w/cpp/string/byte/toupper.

AliHaider93 commented 2 months ago

Would be "Node" be a valid keyword too? In this case, using toupper() would be better.

your guess is right :), Node Also works, also NOde works, I will use toupper().

AliHaider93 commented 2 months ago

I tried using special characters for the part name like image image and LS-PrePost doesnt care about them, so I think to upper is sfficent with a condition to change the parts names into a sequence of numbers if toupper() incounters special charachters.

AliHaider93 commented 2 months ago

it's unnessessary to check for weird Part name, mged doesn't care about it image

drossberg commented 1 month ago

toupper() is applied to the first token of lines starting with a '*' only, right? Therefore, other stuff, like the part names, aren't touched.

drossberg commented 1 month ago

Very nice patch. In fact, it could be a one-liner too.