Uploaded image for project: 'SonarSwift'
  1. SonarSwift
  2. SONARSWIFT-468

Fix parsing error on a new line in the platform condition of the # directive

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3
    • Component/s: Parser
    • Labels:
      None

      Description

      Here is the code snippet from the Swift standard library that showcases the issue:

      #if arch(i386) || arch(arm) || arch(powerpc64) || arch(powerpc64le) || arch(
        s390x)
      @inlinable
      internal var _objectPointerIsObjCBit: UInt {
          @inline(__always) get { return 0x0000_0002 }
      }
      #else
      @inlinable
      internal var _objectPointerIsObjCBit: UInt {
        @inline(__always) get { return 0x4000_0000_0000_0000 }
      }
      #endif
      

      And a somewhat more recent version online: https://github.com/apple/swift/blob/main/stdlib/public/core/Builtin.swift#L392

        Attachments

          Activity

            People

            Assignee:
            arseniy.zaostrovnykh Arseniy Zaostrovnykh
            Reporter:
            arseniy.zaostrovnykh Arseniy Zaostrovnykh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: