Skip to content

Instantly share code, notes, and snippets.

@YOCKOW
Created April 4, 2019 06:10
Show Gist options
  • Select an option

  • Save YOCKOW/7870ef5859400c9f6adf6b6815214f94 to your computer and use it in GitHub Desktop.

Select an option

Save YOCKOW/7870ef5859400c9f6adf6b6815214f94 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require 'open-uri'
MANGLING_RST_URI = "https://raw.githubusercontent.com/YOCKOW/swift/following-apple/docs/ABI/Mangling.rst"
open(MANGLING_RST_URI) {|file|
file.each_line {|line|
next if line !~ /^\p{Zs}*([^\p{Zs}]+\p{Zs}::=.+)$/
modified_line = $1
modified_line.sub!(%r{\p{Zs}*//.*$}, '')
puts(modified_line)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment