markabrahams / node-net-snmp

JavaScript implementation of the Simple Network Management Protocol (SNMP)
209 stars 97 forks source link

Mib lexer: Split name followed by group into separate symbols #227

Closed abutcher-gh closed 1 year ago

abutcher-gh commented 1 year ago

This supports the valid syntax where a type constraint specified in parens or braces joins the type specifier with no whitespace in between. E.g., previously

   DisplayString(SIZE (2..10))

was parsed as a single symbol. There was a special case for INTEGER, but this did not extend to Integer32 etc. This patch generalizes the INTEGER case to tokenize upon seeing a '(' or '{' that open an outer group.

markabrahams commented 1 year ago

Thanks for the PR @abutcher-gh ! I've merged and published this in version 3.9.4 of the npm.