Swift book has wrong grammar for hex float literals

Originator:nicolas.alvarez
Number:rdar://17220202 Date Originated:08-Jun-2014 01:25 AM
Status:Closed Resolved:10-Jul-2014 12:22 PM
Product:Documentation Product Version:
Classification: Reproducible:
 
In "The Swift Language" book on iBooks, the grammar says:

‌ hexadecimal-literal → 0x hexadecimal-digit hexadecimal-literal-characters[opt]
‌ hexadecimal-digit → Digit 0 through 9, a through f, or A through F
‌ hexadecimal-literal-character → hexadecimal-digit  | _
‌ hexadecimal-literal-characters → hexadecimal-literal-character hexadecimal-literal-characters[opt]

‌ floating-point-literal → hexadecimal-literal hexadecimal-fraction[opt] hexadecimal-exponent
‌ hexadecimal-fraction → . hexadecimal-literal[opt]
‌ hexadecimal-exponent → floating-point-p sign[opt] hexadecimal-literal
‌ floating-point-p → p | P
‌ sign → +  -

This implies that the hexadecimal syntax is, for example, 0x1.0x2p0x3. However it's actually 0x1.2p3. Both hexadecimal-fraction and hexadecimal-exponent should refer to hexadecimal-literal-characters (which doesn't include the 0x) instead of hexadecimal-literal.

Comments

Apple Developer Relations

Engineering has provided the following information:

This has been fixed and should now be available online: https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/doc/uid/TP40014097-CH30-XID_795

Please let us know if that resolves the issue for you by updating your bug report.

By nicolas.alvarez at July 23, 2015, 4:17 a.m. (reply...)

There is something strange going on: my bug report remains Closed but this reply from Apple is no longer visible in bugreport.apple.com.

By nicolas.alvarez at July 27, 2015, 4:05 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!