LightAndLight / ipso

A functional scripting language.
https://ipso.dev
17 stars 1 forks source link

Can't pass literal `$` as command argument #335

Closed LightAndLight closed 1 year ago

LightAndLight commented 1 year ago
# bad : IO ()                                                                                    
# bad =                                                                                          
#   comp                                                                                   
#     cmd.run `echo dollar sign: \$`          

good : IO ()                                                                           
good =                                                                                    
  comp                                                                                      
    let dollar = "\$"                                                                      
    cmd.run `echo dollar sign: $dollar`                                                

main : IO ()                                                                                 
main = good

bad gives a syntax error:

test.ipso:4:33: error: expected one of: '"', '$', '${', '`', command fragment, space
  |
4 |     cmd.run `echo dollar sign: \$`
  |                                 ^

good is how I'm working around this.