1. senex
  2. cppheaderparser
  3. Issues
Issue #15 resolved

Failure parsing default floating point values

Thomas Paviot
created an issue

Floating point defaults value are not properly parsed. For instance, following header:

float compute_length(float height=1.7e-3);

generates the following output:

// functions
{'line_number': 1, 'static': False, 'rtnType': 'float', 'const': False, 'parameters': [{'line_number':
1, 'constant': 0, 'name': 'height', 'reference': 0, 'type': '', 'static': 0, 'pointer': 0}], 'namespace': 
'', 'virtual': False, 'destructor': False, 'returns': 'float', 'template': False, 'friend': False, 
'returns_class': False, 'extern': False, 'returns_pointer': 0, 'class': None, 'name': 
'compute_length', 'pure_virtual': False, 'explicit': False, 'returns_fundamental': True, 
'constructor': False, 'debug': 'float compute_length ( height = 1 7e - 3 ) ;', 'inline': False}

Actually the height parameter should be parsed as "1.7e-3", not "1 7e -3". This is annoying since this requires a post processing of the result returned by CppHeaderPaser.

Comments (3)

  1. Log in to comment