klauer / blark

Beckhoff TwinCAT ST (IEC 61131-3) code parsing in Python using Lark (Earley)
https://klauer.github.io/blark/
GNU General Public License v2.0
42 stars 5 forks source link

Explicit support for base 10/decimal literals #58

Closed klauer closed 1 year ago

klauer commented 1 year ago

The grammar currently does not have a spot for explicit base 10/decimal literals - only implicit ones of course:

https://github.com/klauer/blark/blob/043f20ed36c25ac793886181b0a5c0232f218930/blark/iec.lark#L61-L65

I think the integer rule could probably turn into:

integer: [ "10#" ] INTEGER

And then we just throw away the base specifier.

Related: does TwinCAT actually support arbitrary bases for integers?

engineerjoe440 commented 1 year ago

I'm working on this here: https://github.com/engineerjoe440/blark/tree/bugfix/explicit-support-for-base-10-literals

Comparison here: https://github.com/engineerjoe440/blark/compare/bugfix/dereferenced-method-return...engineerjoe440:blark:bugfix/explicit-support-for-base-10-literals?expand=1

Thank you again for making it possible to keep chipping away at these little items. It's very much appreciated! 🎉