.
----------------------------------------------------------------------
Ran 1 test in 0.021s

OK

--- foo

(w <Lit_Chars foo>)


--- 'hi'

(w (SQ hi))


--- $var

(w ($ var))


--- ${var}

(w (${ VSub_Name var))


---  "$var" 

(w (DQ ($ var)))


---  "${var}" 

(w (DQ (${ VSub_Name var)))


---  $((1+2)) 

(w
  (word_part.ArithSub
    left:<Left_DollarDParen "$((">
    anode:(arith_expr.Binary
      op:<Arith_Plus "+">
      left:(w <Lit_Digits 1>)
      right:(w <Lit_Digits 2>)
    )
    right:<Right_DollarDParen ")">
  )
)


---  $(echo hi) 

(w
  (CommandSub
    left_token:<Left_DollarParen "$(">
    child:(C (w <Lit_Chars echo>) (w <Lit_Chars hi>))
    right:<Eof_RParen ")">
  )
)


---  "$((1+2))" 

(w
  (DQ
    (word_part.ArithSub
      left:<Left_DollarDParen "$((">
      anode:(arith_expr.Binary
        op:<Arith_Plus "+">
        left:(w <Lit_Digits 1>)
        right:(w <Lit_Digits 2>)
      )
      right:<Right_DollarDParen ")">
    )
  )
)


---  "$(echo hi)" 

(w
  (DQ
    (CommandSub
      left_token:<Left_DollarParen "$(">
      child:(C (w <Lit_Chars echo>) (w <Lit_Chars hi>))
      right:<Eof_RParen ")">
    )
  )
)


---  $src/file 

(w ($ src) <Lit_Slash /> <Lit_Chars file>)


---  ${src}/file 

(w (${ VSub_Name src) <Lit_Slash /> <Lit_Chars file>)


---  "$src/file" 

(w (DQ ($ src) <Lit_Chars /file>))


---  "${src}/file" 

(w (DQ (${ VSub_Name src) <Lit_Chars /file>))


---  $((1+2))$(echo hi) 

(w
  (word_part.ArithSub
    left:<Left_DollarDParen "$((">
    anode:(arith_expr.Binary
      op:<Arith_Plus "+">
      left:(w <Lit_Digits 1>)
      right:(w <Lit_Digits 2>)
    )
    right:<Right_DollarDParen ")">
  )
  (CommandSub
    left_token:<Left_DollarParen "$(">
    child:(C (w <Lit_Chars echo>) (w <Lit_Chars hi>))
    right:<Eof_RParen ")">
  )
)


---  ~/src 

(w <Lit_Tilde "~"> <Lit_Slash /> <Lit_Chars src>)


---  ~bob/foo 

(w <Lit_Tilde "~"> <Lit_Chars bob> <Lit_Slash /> <Lit_Chars foo>)


--- notleading~

(w <Lit_Chars notleading> <Lit_Tilde "~">)


---  "~/src" 

(w (DQ <Lit_Chars "~/src">))


---  "~bob/foo" 

(w (DQ <Lit_Chars "~bob/foo">))