~andyc/oils

ff8bdcdffb15191c2dc086a19192d7775b98dcd9 — Andy C 2 months ago ce8a0ea
[doctools/src-tree] Work around micro-syntax here doc bug

$(( 1 << i )) is confused for a here doc.

I guess this is another reason to handle ${} in coarse lexing.
2 files changed, 7 insertions(+), 1 deletions(-)

M demo/sparse-array.sh
M doctools/src-tree.sh
M demo/sparse-array.sh => demo/sparse-array.sh +1 -1
@@ 170,7 170,7 @@ EOF
}

hash-bug() {
  local osh=_bin/cxx-opt/osh
  local osh=${1:-_bin/cxx-opt/osh}
  ninja $osh

  # Hm the container doesn't grow here

M doctools/src-tree.sh => doctools/src-tree.sh +6 -0
@@ 71,6 71,12 @@ classify() {
        # TODO: make a style for *.test.sh?
        echo "$path" >& $txt
        ;;

      # TODO: Fix BUG in micro-syntax: $(( 1 << i )) is confused for here doc!
      demo/sparse-array.sh)
        echo "$path" >& $txt
        ;;

      *.cc|*.c|*.h)
        echo "$path" >& $cpp
        ;;