Use Ruby to parse a Tcl DSL
问题 I would like to be able to parse some Tcl code where arguments are not surrounded by strings. Consider this tcl code: proc foo {name} { puts "Foo --> $name" } foo bar For those unfamiliar with Tcl, foo is the method name and bar is the argument (quotes are optional in Tcl). The previous code will output: Foo --> bar Is it possible to parse exactly the same input using ruby ( bar remains unquoted)? The equivalent ruby code is: def foo(name) puts "Foo --> #{name}" end tcl = <<-TCL.gsub(/^\s+/,