Re: [swift-dev] undefining macros after including Tokens.def

2016-12-29 Thread Micah Hainline via swift-dev
I'm looking to spruce some of this up, now that I've taken the time to understand what people are using it for. I've broken it down locally to have all the macro functions that expanded KEYWORD directly go through an intermediary for consistency, and added a SWIFT_KEYWORD that expands to KEYWORD. N

Re: [swift-dev] undefining macros after including Tokens.def

2016-12-29 Thread Micah Hainline via swift-dev
Okay, I'm getting it a little better. __FILE__ used to be in Swift, now we're using #file. That macro was probably NOT supposed to be expanding, but rather matching the actual symbol __FILE__ Still not sure how it changed to be expanding though. On Thu, Dec 29, 2016 at 10:58 AM, Micah Hainline w

Re: [swift-dev] undefining macros after including Tokens.def

2016-12-29 Thread Jacob Bandes-Storch via swift-dev
Probably because expansion happens when an argument appears in the macro body, for instance: #define FOO(x) tok_##x // FOO(__FILE__) expands to tok___FILE__ #define BAR(x) FOO(x) // BAR(__FILE__) is invalid; tries to expand tok_"/path/to/the/file" On Thu, Dec 29, 2016 at 9:29 AM, Micah Hainline

Re: [swift-dev] undefining macros after including Tokens.def

2016-12-29 Thread Micah Hainline via swift-dev
I JUST came back to say I figured out that exact same thing, but I don't like it! :o I don't have a way around it yet, other than NOT making any kind of indirection, but that bugs me. Token pasting macros always kick my butt. :( On Thu, Dec 29, 2016 at 1:00 PM, Jacob Bandes-Storch wrote: > Proba

[swift-dev] String Processing in Swift

2016-12-29 Thread Muhammad Tahir Vali via swift-dev
Hello, Im interested in learning how to do string processing in Swift. Bare with me as I am a college student. Ive done basic regex with java and Its still confusing to me. Ive had good amount of practice with swift and programming. Whats the ideal approach to mastering string processing and mast