Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "mvdan-sh", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A shell parser and formatter (POSIX/Bash/mksh)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,8 +21,13 @@ # mvdan-sh | ||
// what kind of command did we parse? | ||
var stmt = f.StmtList.Stmts[0] | ||
console.log(syntax.NodeType(stmt.Cmd)) // CallExpr | ||
// print out the syntax tree | ||
syntax.DebugPrint(f) | ||
console.log() | ||
// change 'foo' to 'bar' | ||
stmt.Cmd.Args[1].Parts[0].Value = "bar" | ||
// replace all single quoted string values | ||
syntax.Walk(f, function(node) { | ||
if (syntax.NodeType(node) == "SglQuoted") { | ||
node.Value = "bar" | ||
} | ||
return true | ||
}) | ||
@@ -29,0 +34,0 @@ // print the code back out |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1704014
31333
36