vermaseren / form

The FORM project for symbolic manipulation of very big expressions
GNU General Public License v3.0
1.14k stars 136 forks source link

Leading zeroes in rational numbers not handled consistently #104

Closed jodavies closed 8 years ago

jodavies commented 8 years ago

Something I noticed while writing a script to convert floats (in fortran and latex code) to FORM-readable expressions. I work around this by stripping the leading zeroes off, but I thought I would mention it here:

Leading zeroes in rational numbers produce an error when followed by more than a single digit.

Local test1 = 0001;
Local test2 = 00001;
Local test3 = 00010;
Local test4 = 00011;

Print +s;
.end

gives

    Local test1 = 0001;
    Local test2 = 00001;
    Local test3 = 00010;
test.frm Line 3 --> Internal error in code generator. Unknown object: 10
    Local test4 = 00011;
test.frm Line 4 --> Internal error in code generator. Unknown object: 11

It could be useful for the compiler to interpret float representations as rationals automatically, but that is a side issue.

tueda commented 8 years ago

Hi Josh,

Now leading zeros seem to be OK for the FORM tokenizer (fixed in c7ace14 and 9720d7f).

jodavies commented 8 years ago

This has fixed my test cases, and make check works fine with 9720d7f .

Thanks!