mirror of
https://github.com/roc-lang/roc.git
synced 2025-11-02 22:01:20 +00:00
Add a lexing-based 'highlight' mode to the parser
basic syntax highlighting added more syntax highlighting coverage add example of a markdown table with styling move FIXED_TOKEN logic into highlight refactor highlight, add support for backpassing escape html from source code fix bug with <pre> tag ordering refactor out html from roc_parse remove test, put highlight functionality into separate file fix typo
This commit is contained in:
parent
7ccc23ca06
commit
1590b30b19
12 changed files with 1413 additions and 114 deletions
|
|
@ -568,6 +568,15 @@ mod test_snapshots {
|
|||
Err(err) => Err(format!("{:?}", err)),
|
||||
};
|
||||
|
||||
if expect == TestExpectation::Pass {
|
||||
let tokens = roc_parse::highlight::highlight(&source);
|
||||
for token in tokens {
|
||||
if token.value == roc_parse::highlight::Token::Error {
|
||||
panic!("Found an error highlight token in the input: {:?}", token);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let actual_result =
|
||||
if expect == TestExpectation::Pass || expect == TestExpectation::Malformed {
|
||||
result.expect("The source code for this test did not successfully parse!")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue