Merge branch 'master' into c-highlight

This commit is contained in:
Max Brunsfeld 2019-03-12 15:27:12 -07:00
commit b89348e7fe
6 changed files with 33 additions and 8 deletions

View file

@ -32,7 +32,7 @@ serde = "1.0"
serde_derive = "1.0"
regex-syntax = "0.6.4"
regex = "1"
rsass = "0.9"
rsass = "0.9.8"
[dependencies.tree-sitter]
version = ">= 0.3.7"

View file

@ -143,7 +143,9 @@ fn load_js_grammar_file(grammar_path: &Path) -> Result<String> {
Some(code) => return Err(Error(format!("Node process exited with status {}", code))),
}
Ok(String::from_utf8(output.stdout).expect("Got invalid UTF8 from node"))
let mut result = String::from_utf8(output.stdout).expect("Got invalid UTF8 from node");
result.push('\n');
Ok(result)
}
fn ensure_file<T: AsRef<[u8]>>(path: &PathBuf, f: impl Fn() -> T) -> Result<()> {

View file

@ -889,6 +889,28 @@ mod tests {
),
])
);
// Handle differently-formatted calls
let sheet2 = generate_property_sheet(
"foo.css",
"
a {
b: f();
c: f(
g(h),
i,
\"j\",
10
);
}
",
)
.unwrap();
assert_eq!(
query_simple(&sheet2, vec!["a"])["c"],
query_simple(&sheet, vec!["a"])["c"]
);
}
#[test]