summaryrefslogtreecommitdiff
path: root/src/parse/resolve.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-08 12:13:32 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-08 13:06:11 +0100
commit38c5c362419c5eee7a4fdc0b43d3a9dfb339a6d2 (patch)
tree51faa3f6bbc56f75636823adeea135ed76e1b33b /src/parse/resolve.rs
parent75fffc1f9b6ef8bf258b2b1845a4ba74a0f5f2c1 (diff)
Final touches
Diffstat (limited to 'src/parse/resolve.rs')
-rw-r--r--src/parse/resolve.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/parse/resolve.rs b/src/parse/resolve.rs
index 6719f41d..e15ae339 100644
--- a/src/parse/resolve.rs
+++ b/src/parse/resolve.rs
@@ -1,5 +1,5 @@
use super::{is_ident, is_newline, Scanner};
-use crate::syntax::RawData;
+use crate::syntax::ast::RawNode;
use crate::util::EcoString;
/// Resolve all escape sequences in a string.
@@ -46,21 +46,19 @@ pub fn resolve_hex(sequence: &str) -> Option<char> {
}
/// Resolve the language tag and trims the raw text.
-pub fn resolve_raw(column: usize, backticks: u8, text: &str) -> RawData {
+pub fn resolve_raw(column: usize, backticks: usize, text: &str) -> RawNode {
if backticks > 1 {
let (tag, inner) = split_at_lang_tag(text);
let (text, block) = trim_and_split_raw(column, inner);
- RawData {
+ RawNode {
lang: is_ident(tag).then(|| tag.into()),
text: text.into(),
- backticks,
block,
}
} else {
- RawData {
+ RawNode {
lang: None,
text: split_lines(text).join("\n").into(),
- backticks,
block: false,
}
}
@@ -181,7 +179,7 @@ mod tests {
#[track_caller]
fn test(
column: usize,
- backticks: u8,
+ backticks: usize,
raw: &str,
lang: Option<&str>,
text: &str,