diff --git a/Sources/rxcc/rxcc.swift b/Sources/rxcc/rxcc.swift index 0c2e0d5..ace3949 100644 --- a/Sources/rxcc/rxcc.swift +++ b/Sources/rxcc/rxcc.swift @@ -655,7 +655,8 @@ struct rxcc { } func lex(string: String) -> [Substring] { - var line = string.replacing("\n", with: " ") + var line = string.replacing(/\/\/.*\n/, with: "") + line = line.replacing("\n", with: " ") line = line.replacing("\t", with: " ") line = line.replacing("{", with: " { ") line = line.replacing("}", with: " } ") diff --git a/test.c b/test.c index 68430eb..a888c35 100644 --- a/test.c +++ b/test.c @@ -1,4 +1,5 @@ int main() { + // Comment int tomas = 8; tomas /= 2; tomas *= 3; @@ -8,7 +9,7 @@ int main() { tomas += 31; tomas &= 21; tomas |= 3; - tomas |= 303; + tomas |= 303; //hi tomas ^= 23; tomas ^= 27; tomas &= 302;