From f71413176f32ef642824456544ecbda5933a0944 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 23 Dec 2013 19:40:38 -0800 Subject: Add non-indenting indenter for C++ Fix a bunch of bugs that none of me noticed before. --- tools/indenter-cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 tools/indenter-cpp (limited to 'tools/indenter-cpp') diff --git a/tools/indenter-cpp b/tools/indenter-cpp new file mode 100755 index 0000000..bcdf2e0 --- /dev/null +++ b/tools/indenter-cpp @@ -0,0 +1,9 @@ +#!/bin/bash -e +# this is the implementation of indenter -cpp +set -o pipefail +expand | +sed -e 's:^ *//:&&:' -e 's:^ *#://#:' | +indenter -ipp | +sed -e 's:^ *// *#:#:' -e 's:^\( *//\) *//:\1:' | +pp-indent | +bs-align -- cgit v1.2.3-60-g2f50