aboutsummaryrefslogtreecommitdiff
path: root/scripts/filters
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/filters')
-rwxr-xr-xscripts/filters/remove_double_slash_comments2
-rwxr-xr-xscripts/filters/remove_slash_star_comments2
-rwxr-xr-xscripts/filters/remove_tabs2
-rwxr-xr-xscripts/filters/remove_whitespace2
-rwxr-xr-xscripts/filters/to_single_line2
-rwxr-xr-xscripts/filters/trim_whitespace2
6 files changed, 12 insertions, 0 deletions
diff --git a/scripts/filters/remove_double_slash_comments b/scripts/filters/remove_double_slash_comments
new file mode 100755
index 0000000..97e5e91
--- /dev/null
+++ b/scripts/filters/remove_double_slash_comments
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed 's/\/\/.*$//g'
diff --git a/scripts/filters/remove_slash_star_comments b/scripts/filters/remove_slash_star_comments
new file mode 100755
index 0000000..6203b6a
--- /dev/null
+++ b/scripts/filters/remove_slash_star_comments
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed -r ':a; s%(.*)/\*.*\*/%\1%; ta; /\/\*/ !b; N; ba'
diff --git a/scripts/filters/remove_tabs b/scripts/filters/remove_tabs
new file mode 100755
index 0000000..ffa9bf9
--- /dev/null
+++ b/scripts/filters/remove_tabs
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed 's/\t//g'
diff --git a/scripts/filters/remove_whitespace b/scripts/filters/remove_whitespace
new file mode 100755
index 0000000..d453fea
--- /dev/null
+++ b/scripts/filters/remove_whitespace
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed 's/ */ /g'
diff --git a/scripts/filters/to_single_line b/scripts/filters/to_single_line
new file mode 100755
index 0000000..3b20f24
--- /dev/null
+++ b/scripts/filters/to_single_line
@@ -0,0 +1,2 @@
+#!/bin/sh
+tr '\n' ' '
diff --git a/scripts/filters/trim_whitespace b/scripts/filters/trim_whitespace
new file mode 100755
index 0000000..8663abc
--- /dev/null
+++ b/scripts/filters/trim_whitespace
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed -E 's/^\s*(.*)\s+$/\1/g'