glslify / glsl-tokenizer

r/w stream of glsl tokens
MIT License
51 stars 6 forks source link

5e-3 #8

Closed dy closed 8 years ago

dy commented 8 years ago
float test = 5.5e-3;

is badly parsed as:

[ { type: 'keyword', data: 'float', position: 0, line: 1, column: 5 }
  { type: 'whitespace', data: ' ', position: 5, line: 1, column: 6 },
  { type: 'ident', data: 'test', position: 6, line: 1, column: 10 },
  { type: 'whitespace',
    data: ' ',
    position: 10,
    line: 1,
    column: 11 },
  { type: 'operator', data: '=', position: 11, line: 1, column: 12 },
  { type: 'whitespace',
    data: ' ',
    position: 12,
    line: 1,
    column: 13 },
  { type: 'float', data: '5e', position: 13, line: 1, column: 15 },
  { type: 'operator', data: '-', position: 15, line: 1, column: 16 },
  { type: 'integer', data: '3', position: 16, line: 1, column: 17 },
  { type: 'eof', data: '(eof)', position: 16, line: 1, column: 17 } ]

instead of a single literal token