diff --git a/src/utils/chars.rs b/src/utils/chars.rs index 3b7d711..f0aa466 100644 --- a/src/utils/chars.rs +++ b/src/utils/chars.rs @@ -2,7 +2,7 @@ use peekmore::PeekMoreIterator; use crate::{error::SassResult, Token}; -use super::read_until_closing_quote; +use super::{read_until_closing_paren, read_until_closing_quote}; /// Reads until the char is found, consuming the char, /// or until the end of the iterator is hit pub(crate) fn read_until_char>( @@ -17,6 +17,11 @@ pub(crate) fn read_until_char>( v.extend(read_until_closing_quote(toks, tok.kind)?); continue; } + '(' => { + v.push(tok); + v.extend(read_until_closing_paren(toks)?); + continue; + } t if t == c => break, _ => {} } diff --git a/tests/map.rs b/tests/map.rs index ce4e6ab..53924ba 100644 --- a/tests/map.rs +++ b/tests/map.rs @@ -163,3 +163,17 @@ test!( "a {\n color: inspect(((1, 2): 3));\n}\n", "a {\n color: ((1, 2): 3);\n}\n" ); +test!( + // todo: this just tests that it compiles, but does not test + // if it parses correctly + map_with_map_as_value, + "$foo: (\"21by9\": (x: 21, y: 9));", + "" +); +test!( + // todo: this just tests that it compiles, but does not test + // if it parses correctly + paren_with_paren_element_and_trailing_comma, + "$foo: ((\"<\", \"%3c\"), );", + "" +);