Implemented extensions to the Currency syntax, parsing and rendering.
This affects the syntax in the following backwards-incompatible ways (please
read the detail, it's a bit complicated):
- Single-character currency names are now supported in v3 C++. For example,
Assets:Trading:Stocks 10 V {206.90 USD}
for buying 10 shares of Visa, is now working as expected.
You will not be able to enjoy this for now because the C++ lexer isn't used
for the Python version of v3, only the GNU flex lexer. This change only takes
effect in the C++ version.
- Any of the A-Z characters are now supported, but they require new syntax.
Before this change, only the PSTCURM characters were supported.
Now all characters are supported, BUT YOU HAVE TO QUOTE THEM, like this:
2021-03-20 'S "My special transaction"
...
This is new syntax. This introduces a small change that removes ambiguity.
A flag is not either one of !&#?% or '<char>, where <char> is in A-Z.
(When parsed, the single-character flags are parsed as before, that is, the
leading quote will be stripped. 'S becomes "S" on the data structure.)
Unfortunately, you may have to change your input file in order to make this
work; THIS IS NOT A BACKWARD COMPATIBLE CHANGE. It was deemed more important
to support single-character stock symbols than flags, and this also opens up
all the characters to be used as flags, without this arbitrary list of
supported ones (PSTCURM).
- Currency symbols now support a leading slash, for futures contracts. The
following syntax now parse as valid currencies:
AAPL (stock)
V (single-character stock)
NT.TO (stock on another market)
TLT_040921C144 (equity option)
/6J (currency futures)
/NQH21 (commodity futures)
/NQH21_QNEG21C13100 (futures option)
- The definition of 'CURRENCY_RE' has been updated accordingly. If you have
scripts using that, be mindful of the change.
The changes above do not affect branch 'v2', only 'v3.'
Single-character currency names are only available in the C++ version of v3.