8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 20:43:03 +01:00
firebird-mirror/builds/install/arch-specific/win32/strip_comments.sed

82 lines
644 B
Sed

: loop
/^\/\// s,.*,,
/^$/{
x
p
n
b loop
}
/^"/{
: double
/^$/{
x
p
n
/^"/b break
b double
}
H
x
s,\n\(.[^\"]*\).*,\1,
x
s,.[^\"]*,,
/^"/b break
/^\\/{
H
x
s,\n\(.\).*,\1,
x
s/.//
}
b double
}
/^'/{
: single
/^$/{
x
p
n
/^'/b break
b single
}
H
x
s,\n\(.[^\']*\).*,\1,
x
s,.[^\']*,,
/^'/b break
/^\\/{
H
x
s,\n\(.\).*,\1,
x
s/.//
}
b single
}
/^\/\*/{
s/.//
: ccom
s,^.[^*]*,,
/^$/ n
/^\*\//{
s/..//
b loop
}
b ccom
}
: break
H
x
s,\n\(.[^"'/]*\).*,\1,
x
s/.[^"'/]*//
b loop