Skip to content

Incorrect parsing of decibel units #62

@jcarrillo-oai

Description

@jcarrillo-oai

Seems like logarithmic units are not correctly handled in the parser

>>> reg.from_ucum("dB")
<Quantity(1, 'decibyte')>
>>> reg.from_ucum("dB[W]")
<Quantity(1, 'decibyte * watt')>
>>> reg.from_ucum("dB[mW]")
...
 raise UnexpectedCharacters(stream, i, text_line, text_column, {item.expect.name for item in to_scan},
lark.exceptions.UnexpectedCharacters: No terminal matches '[' in the current parser context, at line 1 col 3

dB[mW]
  ^

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions