Here's a little bit of code paraphrased from a program I'm trying to write in 
Nim: 
    
    
    1 let foo:float64 = 200.
    2 let bar = "x"
    
    
    Run

This does not compile: 
    
    
    dca@franz:/tmp$ nim compile testit.nim
    Hint: used config file '/etc/nim.cfg' [Conf]
    Hint: system [Processing]
    Hint: testit [Processing]
    testit.nim(2, 1) Error: invalid indentation
    
    
    Run

This works: 
    
    
    1 let foo:float64 = 200
    2 let bar = "x"
    
    
    Run

as does this: 
    
    
    1 let foo:float64 = 200.0
    2 let bar = "x"
    
    
    Run

I think this disagrees with the BNF given in the Nim Manual, specifically this: 
    
    
    FLOAT_LIT = digit (['_'] digit)* (('.' (['_'] digit)* [exponent]) |exponent)
    
    
    Run

The parenthesized construct after '.', namely, (['_'] digit)*, says that 
**zero** or more digits are required in this position (after the decimal point).

This would appear to be an error in the compiler or the BNF. If I've missed 
something, please explain. Thanks.

Reply via email to