\let\tikz@orig@rect\tikz@rect
\def\tikz@rect{\pgfutil@ifnextchar e\tikz@orig@rect\qrr@tikz@r}
\def\qrr@tikz@r -{%
  \pgfutil@ifnextchar l\qrr@tikz@lr@lineto{%
    \pgfutil@ifnextchar r\qrr@tikz@rl@lineto{%
      \pgfutil@ifnextchar u\qrr@tikz@ud@lineto{%
        \pgfutil@ifnextchar d\qrr@tikz@du@lineto\tikz@expand
      }%
    }%
  }%
}
\let\tikz@orig@vh@lineto@next\tikz@vh@lineto@next
\def\tikz@vh@lineto@next{%
  \pgfutil@ifnextchar|{\expandafter\qrr@tikz@vhv@lineto\pgfutil@gobble}%
    {\pgfutil@ifnextchar\tikz@activebar{\expandafter\qrr@tikz@vhv@lineto\pgfutil@gobble}%
      {\tikz@orig@vh@lineto@next}}}
\let\tikz@orig@hv@lineto\tikz@hv@lineto
\def\tikz@hv@lineto{%
  \pgfutil@ifnextchar-{\expandafter\qrr@tikz@hvh@lineto\pgfutil@gobble}%
    {\tikz@orig@hv@lineto}}
\tikzset{%
  |-|/.style={%
   /utils/exec=\pgfmathsetmacro\qrr@tikz@hvvh@ratio{#1},%
   to path={|-| (\tikztotarget) \tikztonodes}},%
  -|-/.style={%
   /utils/exec=\pgfmathsetmacro\qrr@tikz@hvvh@ratio{#1},%
   to path={-|- (\tikztotarget) \tikztonodes}},%
  ud/.style={%
    udlr/ud distance/.expanded={#1},%
    to path={r-ud (\tikztotarget) \tikztonodes}},%
  du/.style={%
    udlr/du distance/.expanded={#1},%
    to path={r-du (\tikztotarget) \tikztonodes}},%
  lr/.style={%
    udlr/lr distance/.expanded={#1},%
    to path={r-lr (\tikztotarget) \tikztonodes}},%
  rl/.style={%
    udlr/rl distance/.expanded={#1},%
    to path={r-rl (\tikztotarget) \tikztonodes}},%
  ud/.default=\pgfkeysvalueof{/tikz/udlr/ud distance},%
  du/.default=\pgfkeysvalueof{/tikz/udlr/du distance},%
  rl/.default=\pgfkeysvalueof{/tikz/udlr/rl distance},%
  lr/.default=\pgfkeysvalueof{/tikz/udlr/lr distance},%
  |-|/.default=\qrr@tikz@hvvh@ratio,%
  -|-/.default=\qrr@tikz@hvvh@ratio
}

%BEGIN_FOLD hvvh operator
\def\qrr@tikz@vhv@lineto{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@vhv@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@vhv@lineto@next[]}}
\def\qrr@tikz@hvh@lineto{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@hvh@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@hvh@lineto@next[]}}
%END_FOLD

%BEGIN_FOLD udlr operators
%% ud style
\def\qrr@tikz@rl@lineto rl{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@rl@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@rl@lineto@next[]}}
\def\qrr@tikz@lr@lineto lr{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@lr@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@lr@lineto@next[]}}
\def\qrr@tikz@du@lineto du{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@du@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@du@lineto@next[]}}
\def\qrr@tikz@ud@lineto ud{\pgfutil@ifnextchar[{\qrr@tikz@collect@hvvh@options\qrr@tikz@ud@lineto@next}{\qrr@tikz@collect@hvvh@options\qrr@tikz@ud@lineto@next[]}}
%END_FOLD

\input tikzlibrarypaths.ortho.tex
\endinput
