ysiraichi / enfield

An OpenQASM source-to-source Compiler.
GNU General Public License v2.0
20 stars 8 forks source link

[Scanner]: fix real number regex. #35

Closed ysiraichi closed 6 years ago

ysiraichi commented 6 years ago

Fixing regex for identifying real numbers. Before, we always were expecting a '.'. Notice that if 'real's have higher priority than 'integer's, we will have problems. So, switching the two in the file did the trick.

Old regex approach: [0-9].[0-9]+ exp? [0-9]+.[0-9] exp? New approach: [0-9]+ exp? [0-9]+.[0-9] exp? .[0-9] exp?