fix(css/parser): Fix parsing of numbers (#2444)

This commit is contained in:
Alexander Akait 2021-10-17 17:24:28 +03:00 committed by GitHub
parent de368f6bb7
commit 4f2dbd816c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
128 changed files with 2701 additions and 579 deletions

14
Cargo.lock generated
View File

@ -2501,7 +2501,7 @@ dependencies = [
[[package]]
name = "swc_css"
version = "0.18.0"
version = "0.19.0"
dependencies = [
"swc_css_ast",
"swc_css_codegen",
@ -2512,7 +2512,7 @@ dependencies = [
[[package]]
name = "swc_css_ast"
version = "0.16.0"
version = "0.17.0"
dependencies = [
"is-macro",
"serde",
@ -2523,7 +2523,7 @@ dependencies = [
[[package]]
name = "swc_css_codegen"
version = "0.16.0"
version = "0.17.0"
dependencies = [
"auto_impl",
"bitflags",
@ -2549,7 +2549,7 @@ dependencies = [
[[package]]
name = "swc_css_parser"
version = "0.18.0"
version = "0.19.0"
dependencies = [
"bitflags",
"lexical",
@ -2565,7 +2565,7 @@ dependencies = [
[[package]]
name = "swc_css_utils"
version = "0.13.0"
version = "0.14.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_common",
@ -2575,7 +2575,7 @@ dependencies = [
[[package]]
name = "swc_css_visit"
version = "0.15.0"
version = "0.16.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_common",
@ -3144,7 +3144,7 @@ dependencies = [
[[package]]
name = "swc_stylis"
version = "0.15.0"
version = "0.16.0"
dependencies = [
"swc_atoms 0.2.8",
"swc_common",

View File

@ -6,11 +6,11 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css"
repository = "https://github.com/swc-project/swc.git"
version = "0.18.0"
version = "0.19.0"
[dependencies]
swc_css_ast = {version = "0.16.0", path = "./ast"}
swc_css_codegen = {version = "0.16.0", path = "./codegen"}
swc_css_parser = {version = "0.18.0", path = "./parser"}
swc_css_utils = {version = "0.13.0", path = "./utils/"}
swc_css_visit = {version = "0.15.0", path = "./visit"}
swc_css_ast = {version = "0.17.0", path = "./ast"}
swc_css_codegen = {version = "0.17.0", path = "./codegen"}
swc_css_parser = {version = "0.19.0", path = "./parser"}
swc_css_utils = {version = "0.14.0", path = "./utils/"}
swc_css_visit = {version = "0.16.0", path = "./visit"}

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_ast"
repository = "https://github.com/swc-project/swc.git"
version = "0.16.0"
version = "0.17.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -20,4 +20,5 @@ pub struct Str {
pub struct Num {
pub span: Span,
pub value: f64,
pub raw: JsWord,
}

View File

@ -61,7 +61,10 @@ pub enum Token {
value: char,
},
Num(NumToken),
Num {
value: f64,
raw: JsWord,
},
// TODO Percentage
@ -102,8 +105,3 @@ pub enum Token {
/// `}`
RBrace,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NumToken {
pub value: f64,
}

View File

@ -6,17 +6,17 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_codegen"
repository = "https://github.com/swc-project/swc.git"
version = "0.16.0"
version = "0.17.0"
[dependencies]
auto_impl = "0.4.1"
bitflags = "1.3.2"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.13.0", path = "../../common"}
swc_css_ast = {version = "0.16.0", path = "../ast/"}
swc_css_ast = {version = "0.17.0", path = "../ast/"}
swc_css_codegen_macros = {version = "0.2.0", path = "macros/"}
[dev-dependencies]
swc_css_parser = {version = "0.18.0", path = "../parser"}
swc_css_visit = {version = "0.15.0", path = "../visit"}
swc_css_parser = {version = "0.19.0", path = "../parser"}
swc_css_visit = {version = "0.16.0", path = "../visit"}
testing = {version = "0.14.0", path = "../../testing"}

View File

@ -425,7 +425,7 @@ where
#[emitter]
fn emit_num(&mut self, n: &Num) -> Result {
self.wr.write_raw(Some(n.span), &n.value.to_string())?;
self.wr.write_raw(Some(n.span), &n.raw)?;
}
#[emitter]
@ -494,8 +494,8 @@ where
Token::RBracket => {
punct!(self, span, "]");
}
Token::Num(n) => {
self.wr.write_raw(Some(span), &n.value.to_string())?;
Token::Num { raw, .. } => {
self.wr.write_raw(Some(span), raw)?;
}
Token::Ident { raw, .. } => {
self.wr.write_raw(Some(n.span), &raw)?;
@ -690,7 +690,7 @@ where
UnitKind::Px => Cow::Owned("px".into()),
UnitKind::Custom(s) => Cow::Borrowed(s),
};
self.wr.write_ident(Some(n.span), &s, true)?;
self.wr.write_raw(Some(n.span), &s)?;
}
#[emitter]

View File

@ -6,7 +6,7 @@ edition = "2018"
license = "Apache-2.0/MIT"
name = "swc_css_parser"
repository = "https://github.com/swc-project/swc.git"
version = "0.18.0"
version = "0.19.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
@ -17,11 +17,11 @@ bitflags = "1.2.1"
lexical = "5.2.2"
swc_atoms = {version = "0.2.7", path = "../../atoms"}
swc_common = {version = "0.13.0", path = "../../common"}
swc_css_ast = {version = "0.16.0", path = "../ast"}
swc_css_ast = {version = "0.17.0", path = "../ast"}
unicode-xid = "0.2.2"
[dev-dependencies]
serde = "1.0.127"
serde_json = "1.0.66"
swc_css_visit = {version = "0.15.0", path = "../visit"}
swc_css_visit = {version = "0.16.0", path = "../visit"}
testing = {version = "0.14.0", path = "../../testing"}

View File

@ -6,8 +6,6 @@ use swc_atoms::{js_word, JsWord};
use swc_common::{input::Input, BytePos, Span};
use swc_css_ast::{Token, TokenAndSpan};
mod value;
pub(crate) type LexResult<T> = Result<T, ErrorKind>;
#[derive(Debug)]
@ -167,7 +165,7 @@ where
if self.would_start_number()? {
self.input.reset_to(pos);
return self.read_number();
return self.read_numeric();
}
return Ok(Token::Delim { value: c });
@ -184,7 +182,7 @@ where
if self.would_start_number()? {
self.input.reset_to(pos);
return self.read_number();
return self.read_numeric();
} else if self.input.cur() == Some('-') && self.input.peek() == Some('>') {
self.input.bump();
self.input.bump();
@ -210,7 +208,7 @@ where
if self.would_start_number()? {
self.input.reset_to(pos);
return self.read_number();
return self.read_numeric();
}
return Ok(Token::Delim { value: c });
@ -273,7 +271,7 @@ where
try_delim!(b'}', "}");
if let Some('0'..='9') = self.input.cur() {
return self.read_number();
return self.read_numeric();
}
if let Some(c) = self.input.cur() {
@ -335,6 +333,104 @@ where
}
}
fn read_digits(&mut self) -> JsWord {
let mut digits = String::new();
loop {
let code = self.input.cur().unwrap();
if code.is_digit(10) {
self.input.bump();
digits.push(code);
} else {
break;
}
}
digits.into()
}
fn read_number(&mut self) -> (f64, String) {
let mut repr = String::new();
if let Some(c) = self.input.cur() {
if c == '+' || c == '-' {
self.input.bump();
repr.push(c);
}
}
repr.push_str(&self.read_digits());
if let Some(c) = self.input.cur() {
if c == '.' {
if let Some(n) = self.input.peek() {
if n.is_digit(10) {
self.input.bump();
self.input.bump();
repr.push(c);
repr.push(n);
repr.push_str(&self.read_digits());
}
}
}
}
if let Some(c) = self.input.cur() {
if c == 'E' || c == 'e' {
if let Some(n) = self.input.peek() {
if n == '-' || n == '+' {
if let Some(nn) = self.input.peek_ahead() {
if nn.is_digit(10) {
self.input.bump();
self.input.bump();
repr.push(c);
repr.push(n);
repr.push_str(&self.read_digits());
}
}
} else if n.is_digit(10) {
self.input.bump();
self.input.bump();
repr.push(c);
repr.push(n);
repr.push_str(&self.read_digits());
}
}
}
}
let parsed = lexical::parse(&repr.as_bytes()).unwrap_or_else(|err| {
unreachable!("failed to parse `{}` using lexical: {:?}", repr, err)
});
(parsed, repr)
}
fn read_numeric(&mut self) -> LexResult<Token> {
let number = self.read_number();
// TODO: need improve
// if self.would_start_ident()? {
// let name = self.read_name()?;
//
// return Ok(Token::Dimension {
// value: number,
// unit: name.0,
// raw_unit: name.1
// });
// } else if self.input.cur().unwrap() == '%' {
// self.input.bump();
//
// return Ok(Token::Percent { value: number });
// }
Ok(Token::Num {
value: number.0,
raw: number.1.into(),
})
}
fn is_valid_escape(&mut self) -> LexResult<bool> {
if self.input.cur() != Some('\\') {
return Ok(false);

View File

@ -1,52 +0,0 @@
use super::{LexResult, Lexer};
use swc_common::input::Input;
use swc_css_ast::{NumToken, Token};
impl<I> Lexer<I>
where
I: Input,
{
pub(super) fn read_number(&mut self) -> LexResult<Token> {
let mut is_first = true;
let mut had_dot = false;
let start = self.input.cur_pos();
self.input.uncons_while(|c| match c {
'0'..='9' => {
is_first = false;
true
}
'-' | '+' => {
if is_first {
is_first = false;
true
} else {
false
}
}
'.' => {
is_first = false;
if had_dot {
false
} else {
had_dot = true;
true
}
}
_ => {
is_first = false;
false
}
});
let end = self.input.last_pos();
let num_str = self.input.slice(start, end);
let parsed = lexical::parse(&num_str.as_bytes()).unwrap_or_else(|err| {
unreachable!("failed to parse `{}` using lexical: {:?}", num_str, err)
});
Ok(Token::Num(NumToken { value: parsed }))
}
}

View File

@ -376,14 +376,14 @@ where
let span = self.input.cur_span()?;
match bump!(self) {
Token::Num(NumToken { value }) => {
Token::Num { value, raw, .. } => {
if is!(self, Ident) {
let unit_span = self.input.cur_span()?;
// Unit
let value = Num { span, value };
let value = Num { span, value, raw };
match bump!(self) {
Token::Ident { value: unit, .. } => {
Token::Ident { raw: unit, .. } => {
let kind = UnitKind::from(unit);
return Ok(Value::Unit(UnitValue {
span: span!(self, span.lo),
@ -401,7 +401,7 @@ where
}
if eat!(self, "%") {
let value = Num { span, value };
let value = Num { span, value, raw };
return Ok(Value::Percent(PercentValue {
span: span!(self, span.lo),
@ -409,7 +409,7 @@ where
}));
}
Ok(Value::Number(Num { span, value }))
Ok(Value::Number(Num { span, value, raw }))
}
_ => {
unreachable!()
@ -542,7 +542,7 @@ where
let value = bump!(self);
match value {
Token::Num(NumToken { value }) => Ok(Num { span, value }),
Token::Num { value, raw, .. } => Ok(Num { span, value, raw }),
_ => {
unreachable!()
}

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 13,
"end": 12,
"ctxt": 0
},
"name": {
@ -82,13 +82,46 @@
},
"values": [
{
"type": "Number",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 13,
"ctxt": 0
},
"value": 0.0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
{
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"token": {
"Num": {
"value": 0.0
}
}
},
{
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/number/dot/input.css:1:11
|
1 | a { width: 0.; }
| ^^^

View File

@ -50,7 +50,7 @@ error: Property
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:5
|
1 | a { width: 0.; }
| ^^^^^^^^^
| ^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:5
@ -59,14 +59,32 @@ error: Text
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:11
|
1 | a { width: 0.; }
| ^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:11
|
1 | a { width: 0.; }
| ^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:11
|
1 | a { width: 0.; }
| ^
error: Num(NumToken { value: 0.0 })
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:12
|
1 | a { width: 0.; }
| ^^
| ^
error: Num
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:12
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/thvW-_S_FCA5eKxKgRyxig/input.css:1:13
|
1 | a { width: 0.; }
| ^^
| ^

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 14,
"end": 13,
"ctxt": 0
},
"name": {
@ -82,21 +82,46 @@
},
"values": [
{
"type": "PercentValue",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 14,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 11,
"end": 13,
"ctxt": 0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
"value": 0.0
}
{
"span": {
"start": 11,
"end": 13,
"ctxt": 0
},
"token": {
"Num": {
"value": 0.0
}
}
},
{
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/number/minus-dot/input.css:1:11
|
1 | a { width: -0.; }
| ^^^^

View File

@ -50,7 +50,7 @@ error: Property
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:5
|
1 | a { width: +0.; }
| ^^^^^^^^^^
| ^^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:5
@ -59,14 +59,32 @@ error: Text
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^
error: Num(NumToken { value: 0.0 })
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:12
|
1 | a { width: +0.; }
| ^^^
| ^^
error: Num
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:12
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:14
|
1 | a { width: +0.; }
| ^^^
| ^

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 14,
"end": 13,
"ctxt": 0
},
"name": {
@ -82,13 +82,46 @@
},
"values": [
{
"type": "Number",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 14,
"ctxt": 0
},
"value": -0.0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
{
"span": {
"start": 11,
"end": 13,
"ctxt": 0
},
"token": {
"Num": {
"value": 0.0
}
}
},
{
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/number/plus-dot/input.css:1:11
|
1 | a { width: +0.; }
| ^^^^

View File

@ -0,0 +1,90 @@
error: Stylesheet
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^^^^^^^^^^^^^^^^^
error: Rule
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^^^^^^^^^^^^^^^^^
error: StyleRule
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^^^^^^^^^^^^^^^^^
error: ComplexSelector
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^
error: CompoundSelector
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^
error: NamespacedName
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^
error: Text
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:1
|
1 | a { width: +0.; }
| ^
error: DeclBlock
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:3
|
1 | a { width: +0.; }
| ^^^^^^^^^^^^^^^
error: Property
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:5
|
1 | a { width: +0.; }
| ^^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:5
|
1 | a { width: +0.; }
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:11
|
1 | a { width: +0.; }
| ^
error: Num(NumToken { value: 0.0 })
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:12
|
1 | a { width: +0.; }
| ^^
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/6mrV_7sMC078PDku0AmwVw/input.css:1:14
|
1 | a { width: +0.; }
| ^

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 14,
"end": 12,
"ctxt": 0
},
"name": {
@ -82,13 +82,58 @@
},
"values": [
{
"type": "Number",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 14,
"ctxt": 0
},
"value": 0.0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
{
"span": {
"start": 11,
"end": 12,
"ctxt": 0
},
"token": {
"Num": {
"value": 0.0
}
}
},
{
"span": {
"start": 12,
"end": 13,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
},
{
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"token": {
"Delim": {
"value": "%"
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/percent/dot/input.css:1:11
|
1 | a { width: 0.%; }
| ^^^^

View File

@ -50,7 +50,7 @@ error: Property
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:5
|
1 | a { width: 0.%; }
| ^^^^^^^^^^
| ^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:5
@ -59,20 +59,38 @@ error: Text
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:11
|
1 | a { width: 0.%; }
| ^^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:11
|
1 | a { width: 0.%; }
| ^^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:11
|
1 | a { width: 0.%; }
| ^
error: Num(NumToken { value: 0.0 })
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:12
|
1 | a { width: 0.%; }
| ^^^
| ^
error: PercentValue
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:12
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:13
|
1 | a { width: 0.%; }
| ^^^
| ^
error: Num
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:12
error: Delim { value: '%' }
--> $DIR/tests/fixture/esbuild/misc/Wxf4N3jnpCG5lQzkYt7wog/input.css:1:14
|
1 | a { width: 0.%; }
| ^^
| ^

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 15,
"end": 13,
"ctxt": 0
},
"name": {
@ -82,21 +82,58 @@
},
"values": [
{
"type": "PercentValue",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 15,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 11,
"end": 14,
"ctxt": 0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
"value": 0.0
}
{
"span": {
"start": 11,
"end": 13,
"ctxt": 0
},
"token": {
"Num": {
"value": -0.0
}
}
},
{
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
},
{
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"token": {
"Delim": {
"value": "%"
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/percent/minus/input.css:1:11
|
1 | a { width: -0.%; }
| ^^^^^

View File

@ -50,7 +50,7 @@ error: Property
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:5
|
1 | a { width: -0.%; }
| ^^^^^^^^^^^
| ^^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:5
@ -59,20 +59,38 @@ error: Text
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:11
|
1 | a { width: -0.%; }
| ^^^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:11
|
1 | a { width: -0.%; }
| ^^^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:11
|
1 | a { width: -0.%; }
| ^
error: Num(NumToken { value: -0.0 })
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:12
|
1 | a { width: -0.%; }
| ^^^^
| ^^
error: PercentValue
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:12
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:14
|
1 | a { width: -0.%; }
| ^^^^
| ^
error: Num
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:12
error: Delim { value: '%' }
--> $DIR/tests/fixture/esbuild/misc/2Z7MIIhOQ0mreKqEgkeZYQ/input.css:1:15
|
1 | a { width: -0.%; }
| ^^^
| ^

View File

@ -67,7 +67,7 @@
"type": "Property",
"span": {
"start": 4,
"end": 15,
"end": 13,
"ctxt": 0
},
"name": {
@ -82,21 +82,58 @@
},
"values": [
{
"type": "PercentValue",
"type": "Tokens",
"span": {
"start": 11,
"start": 10,
"end": 15,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 11,
"end": 14,
"ctxt": 0
"tokens": [
{
"span": {
"start": 10,
"end": 11,
"ctxt": 0
},
"token": "WhiteSpace"
},
"value": -0.0
}
{
"span": {
"start": 11,
"end": 13,
"ctxt": 0
},
"token": {
"Num": {
"value": 0.0
}
}
},
{
"span": {
"start": 13,
"end": 14,
"ctxt": 0
},
"token": {
"Delim": {
"value": "."
}
}
},
{
"span": {
"start": 14,
"end": 15,
"ctxt": 0
},
"token": {
"Delim": {
"value": "%"
}
}
}
]
}
],
"important": null

View File

@ -0,0 +1,6 @@
error: Expected a property value
--> $DIR/tests/errors/percent/plus/input.css:1:11
|
1 | a { width: +0.%; }
| ^^^^^

View File

@ -50,7 +50,7 @@ error: Property
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:5
|
1 | a { width: +0.%; }
| ^^^^^^^^^^^
| ^^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:5
@ -59,20 +59,38 @@ error: Text
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:11
|
1 | a { width: +0.%; }
| ^^^^^
error: Tokens
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:11
|
1 | a { width: +0.%; }
| ^^^^^
error: WhiteSpace
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:11
|
1 | a { width: +0.%; }
| ^
error: Num(NumToken { value: 0.0 })
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:12
|
1 | a { width: +0.%; }
| ^^^^
| ^^
error: PercentValue
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:12
error: Delim { value: '.' }
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:14
|
1 | a { width: +0.%; }
| ^^^^
| ^
error: Num
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:12
error: Delim { value: '%' }
--> $DIR/tests/fixture/esbuild/misc/iY6z2A7vaO8bBm_U1Qrm8g/input.css:1:15
|
1 | a { width: +0.%; }
| ^^^
| ^

View File

@ -21,7 +21,7 @@ impl Visit for AssertValid {
}
match &s.args.tokens[0].token {
Token::Colon | Token::Num(..) => return,
Token::Colon | Token::Num { .. } => return,
_ => {}
}

View File

@ -87,7 +87,8 @@
"end": 32,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
@ -151,7 +152,8 @@
"end": 52,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
@ -215,7 +217,8 @@
"end": 72,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
@ -298,7 +301,8 @@
"end": 100,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -381,7 +385,8 @@
"end": 127,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -464,7 +469,8 @@
"end": 154,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+.10"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-.10"
}
}
],

View File

@ -106,7 +106,8 @@
"end": 23,
"ctxt": 0
},
"value": 255.0
"value": 255.0,
"raw": "255"
},
{
"type": "Number",
@ -115,7 +116,8 @@
"end": 26,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -124,7 +126,8 @@
"end": 30,
"ctxt": 0
},
"value": 17.0
"value": 17.0,
"raw": "17"
}
]
},
@ -135,7 +138,8 @@
"end": 33,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -144,7 +148,8 @@
"end": 35,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -153,7 +158,8 @@
"end": 37,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "Text",

View File

@ -88,7 +88,8 @@
"end": 13,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 15,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "Number",
@ -106,7 +108,8 @@
"end": 17,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -115,7 +118,8 @@
"end": 19,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 18,
"ctxt": 0
},
"kind": "p2x"
"kind": "p\\32x"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 20,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 22,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
{
"type": "Number",
@ -106,7 +108,8 @@
"end": 24,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
},
{
"type": "Number",
@ -115,7 +118,8 @@
"end": 26,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
}
],
"important": null
@ -145,7 +149,8 @@
"end": 54,
"ctxt": 0
},
"value": 5.0
"value": 5.0,
"raw": "5"
},
{
"type": "Number",
@ -154,7 +159,8 @@
"end": 56,
"ctxt": 0
},
"value": 6.0
"value": 6.0,
"raw": "6"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "0.1"
}
}
],

View File

@ -45,7 +45,8 @@
"end": 21,
"ctxt": 0
},
"value": 100.0
"value": 100.0,
"raw": "100"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0.0"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 16,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "UnitValue",
@ -113,7 +115,8 @@
"end": 18,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {
@ -138,7 +141,8 @@
"end": 22,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 17,
"ctxt": 0
},
"kind": ",x"
"kind": "\\2cx"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+0.1"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": ".0"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-.00"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 17,
"ctxt": 0
},
"kind": "x,"
"kind": "x\\2c "
}
}
],

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+0.1"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": ".10"
}
],
"important": null

View File

@ -45,7 +45,8 @@
"end": 19,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
}
},
{
@ -62,7 +63,8 @@
"end": 24,
"ctxt": 0
},
"value": 50.0
"value": 50.0,
"raw": "50"
}
}
],
@ -129,7 +131,8 @@
"end": 43,
"ctxt": 0
},
"value": 25.0
"value": 25.0,
"raw": "25"
}
},
{
@ -146,7 +149,8 @@
"end": 48,
"ctxt": 0
},
"value": 75.0
"value": 75.0,
"raw": "75"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-.0"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-0.1"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 17,
"ctxt": 0
},
"kind": "2x"
"kind": "\\32x"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 17,
"ctxt": 0
},
"kind": "em"
"kind": "\\65m"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-.00"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+.00"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-.10"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 29,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 31,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
}
],
"important": null

View File

@ -105,7 +105,8 @@
"end": 23,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {
@ -130,7 +131,8 @@
"end": 27,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {
@ -155,7 +157,8 @@
"end": 31,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {
@ -180,7 +183,8 @@
"end": 35,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {

View File

@ -65,7 +65,8 @@
"end": 27,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 20,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 22,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
{
"type": "Number",
@ -106,7 +108,8 @@
"end": 24,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
},
{
"type": "Number",
@ -115,7 +118,8 @@
"end": 26,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
}
],
"important": null
@ -145,7 +149,8 @@
"end": 54,
"ctxt": 0
},
"value": 5.0
"value": 5.0,
"raw": "5"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+0.0"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 16,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "Number",
@ -106,7 +108,8 @@
"end": 18,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -115,7 +118,8 @@
"end": 20,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
}
],
"important": null

View File

@ -53,7 +53,8 @@
"end": 22,
"ctxt": 0
},
"value": 100.0
"value": 100.0,
"raw": "100"
},
"unit": {
"span": {

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+.0"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+0.0"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": ".00"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+.0"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 13,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
{
"type": "Number",
@ -97,7 +98,8 @@
"end": 15,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "UnitValue",
@ -113,7 +115,8 @@
"end": 17,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
},
"unit": {
"span": {
@ -138,7 +141,8 @@
"end": 21,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {

View File

@ -1,72 +0,0 @@
error: Stylesheet
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^^^^^^^^^^^^^^^^^
error: Rule
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^^^^^^^^^^^^^^^^^
error: StyleRule
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^^^^^^^^^^^^^^^^^
error: ComplexSelector
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^
error: CompoundSelector
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^
error: NamespacedName
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^
error: Text
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:1
|
1 | a { width: -0.; }
| ^
error: DeclBlock
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:3
|
1 | a { width: -0.; }
| ^^^^^^^^^^^^^^^
error: Property
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:5
|
1 | a { width: -0.; }
| ^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:5
|
1 | a { width: -0.; }
| ^^^^^
error: Value
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:12
|
1 | a { width: -0.; }
| ^^^
error: Num
--> $DIR/tests/fixture/esbuild/misc/hfb4Q3SC19oWsisaiRslOA/input.css:1:12
|
1 | a { width: -0.; }
| ^^^

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "0.1"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-0.0"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "+.00"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-.0"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": ".10"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 16,
"ctxt": 0
},
"kind": "x,"
"kind": "x\\,"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-0.1"
}
],
"important": null

View File

@ -45,7 +45,8 @@
"end": 17,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0"
}
},
{
@ -62,7 +63,8 @@
"end": 21,
"ctxt": 0
},
"value": 50.0
"value": 50.0,
"raw": "50"
}
}
],
@ -129,7 +131,8 @@
"end": 35,
"ctxt": 0
},
"value": 25.0
"value": 25.0,
"raw": "25"
}
},
{
@ -146,7 +149,8 @@
"end": 39,
"ctxt": 0
},
"value": 75.0
"value": 75.0,
"raw": "75"
}
}
],

View File

@ -53,7 +53,8 @@
"end": 26,
"ctxt": 0
},
"value": 100.0
"value": 100.0,
"raw": "100"
},
"unit": {
"span": {

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 16,
"ctxt": 0
},
"kind": ",x"
"kind": "\\,x"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 15,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+.10"
}
}
],

View File

@ -95,7 +95,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": "0.0"
}
}
],

View File

@ -88,7 +88,8 @@
"end": 14,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": ".00"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 15,
"ctxt": 0
},
"value": -0.0
"value": -0.0,
"raw": "-0.0"
}
],
"important": null

View File

@ -88,7 +88,8 @@
"end": 13,
"ctxt": 0
},
"value": 0.0
"value": 0.0,
"raw": ".0"
}
],
"important": null

View File

@ -95,7 +95,8 @@
"end": 13,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -103,7 +104,7 @@
"end": 18,
"ctxt": 0
},
"kind": "e2x"
"kind": "e\\32x"
}
}
],

View File

@ -168,7 +168,8 @@
"end": 64,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
@ -428,7 +429,8 @@
"end": 269,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -478,7 +480,8 @@
"end": 310,
"ctxt": 0
},
"value": 20.0
"value": 20.0,
"raw": "20"
},
"unit": {
"span": {
@ -528,7 +531,8 @@
"end": 358,
"ctxt": 0
},
"value": 100.0
"value": 100.0,
"raw": "100"
},
"unit": {
"span": {
@ -578,7 +582,8 @@
"end": 401,
"ctxt": 0
},
"value": 100.0
"value": 100.0,
"raw": "100"
},
"unit": {
"span": {
@ -627,7 +632,8 @@
"end": 441,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
{
"type": "String",
@ -678,7 +684,8 @@
"end": 471,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {

View File

@ -7,4 +7,30 @@ div {
property: -0.1;
property: -.1;
property: +.1;
property: 0;
property: 10;
property: .10;
property: 12.34;
property: 0.1;
property: 1.0;
property: 0.0;
property: +0.0;
property: -0.0;
property: .0;
property: 1.200000;
property: 1.2e2;
property: 1e2;
property: .2e2;
property: 1.2E2;
property: 1.2e+2;
property: 1.2e-2;
property: -1;
property: -1.2;
property: -.2;
property: -.2;
property: +.2;
property: -1.2e3;
property: 1.75;
property: +1.75;
property: 1e;
}

View File

@ -2,7 +2,7 @@
"type": "Stylesheet",
"span": {
"start": 0,
"end": 161,
"end": 676,
"ctxt": 0
},
"rules": [
@ -10,7 +10,7 @@
"type": "StyleRule",
"span": {
"start": 0,
"end": 160,
"end": 675,
"ctxt": 0
},
"selectors": [
@ -59,7 +59,7 @@
"type": "DeclBlock",
"span": {
"start": 4,
"end": 160,
"end": 675,
"ctxt": 0
},
"items": [
@ -88,7 +88,8 @@
"end": 22,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
}
],
"important": null
@ -118,7 +119,8 @@
"end": 41,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "+10"
}
],
"important": null
@ -148,7 +150,8 @@
"end": 60,
"ctxt": 0
},
"value": -10.0
"value": -10.0,
"raw": "-10"
}
],
"important": null
@ -178,7 +181,8 @@
"end": 79,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "0.1"
}
],
"important": null
@ -208,7 +212,8 @@
"end": 99,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+0.1"
}
],
"important": null
@ -238,7 +243,8 @@
"end": 119,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-0.1"
}
],
"important": null
@ -268,7 +274,8 @@
"end": 138,
"ctxt": 0
},
"value": -0.1
"value": -0.1,
"raw": "-.1"
}
],
"important": null
@ -298,7 +305,830 @@
"end": 157,
"ctxt": 0
},
"value": 0.1
"value": 0.1,
"raw": "+.1"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 163,
"end": 174,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 163,
"end": 171,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 173,
"end": 174,
"ctxt": 0
},
"value": 0.0,
"raw": "0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 180,
"end": 192,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 180,
"end": 188,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 190,
"end": 192,
"ctxt": 0
},
"value": 10.0,
"raw": "10"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 198,
"end": 211,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 198,
"end": 206,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 208,
"end": 211,
"ctxt": 0
},
"value": 0.1,
"raw": ".10"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 217,
"end": 232,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 217,
"end": 225,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 227,
"end": 232,
"ctxt": 0
},
"value": 12.34,
"raw": "12.34"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 238,
"end": 251,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 238,
"end": 246,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 248,
"end": 251,
"ctxt": 0
},
"value": 0.1,
"raw": "0.1"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 257,
"end": 270,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 257,
"end": 265,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 267,
"end": 270,
"ctxt": 0
},
"value": 1.0,
"raw": "1.0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 276,
"end": 289,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 276,
"end": 284,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 286,
"end": 289,
"ctxt": 0
},
"value": 0.0,
"raw": "0.0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 295,
"end": 309,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 295,
"end": 303,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 305,
"end": 309,
"ctxt": 0
},
"value": 0.0,
"raw": "+0.0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 315,
"end": 329,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 315,
"end": 323,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 325,
"end": 329,
"ctxt": 0
},
"value": -0.0,
"raw": "-0.0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 335,
"end": 347,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 335,
"end": 343,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 345,
"end": 347,
"ctxt": 0
},
"value": 0.0,
"raw": ".0"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 353,
"end": 371,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 353,
"end": 361,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 363,
"end": 371,
"ctxt": 0
},
"value": 1.2,
"raw": "1.200000"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 377,
"end": 392,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 377,
"end": 385,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 387,
"end": 392,
"ctxt": 0
},
"value": 120.0,
"raw": "1.2e2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 398,
"end": 411,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 398,
"end": 406,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 408,
"end": 411,
"ctxt": 0
},
"value": 100.0,
"raw": "1e2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 417,
"end": 431,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 417,
"end": 425,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 427,
"end": 431,
"ctxt": 0
},
"value": 20.0,
"raw": ".2e2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 437,
"end": 452,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 437,
"end": 445,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 447,
"end": 452,
"ctxt": 0
},
"value": 120.0,
"raw": "1.2E2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 458,
"end": 474,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 458,
"end": 466,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 468,
"end": 474,
"ctxt": 0
},
"value": 120.0,
"raw": "1.2e+2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 480,
"end": 496,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 480,
"end": 488,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 490,
"end": 496,
"ctxt": 0
},
"value": 0.012,
"raw": "1.2e-2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 502,
"end": 514,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 502,
"end": 510,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 512,
"end": 514,
"ctxt": 0
},
"value": -1.0,
"raw": "-1"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 520,
"end": 534,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 520,
"end": 528,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 530,
"end": 534,
"ctxt": 0
},
"value": -1.2,
"raw": "-1.2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 540,
"end": 553,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 540,
"end": 548,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 550,
"end": 553,
"ctxt": 0
},
"value": -0.2,
"raw": "-.2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 559,
"end": 572,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 559,
"end": 567,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 569,
"end": 572,
"ctxt": 0
},
"value": -0.2,
"raw": "-.2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 578,
"end": 591,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 578,
"end": 586,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 588,
"end": 591,
"ctxt": 0
},
"value": 0.2,
"raw": "+.2"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 597,
"end": 613,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 597,
"end": 605,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 607,
"end": 613,
"ctxt": 0
},
"value": -1200.0,
"raw": "-1.2e3"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 619,
"end": 633,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 619,
"end": 627,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 629,
"end": 633,
"ctxt": 0
},
"value": 1.75,
"raw": "1.75"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 639,
"end": 654,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 639,
"end": 647,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "Number",
"span": {
"start": 649,
"end": 654,
"ctxt": 0
},
"value": 1.75,
"raw": "+1.75"
}
],
"important": null
},
{
"type": "Property",
"span": {
"start": 660,
"end": 672,
"ctxt": 0
},
"name": {
"type": "Text",
"span": {
"start": 660,
"end": 668,
"ctxt": 0
},
"value": "property",
"raw": "property"
},
"values": [
{
"type": "UnitValue",
"span": {
"start": 670,
"end": 672,
"ctxt": 0
},
"value": {
"type": "Number",
"span": {
"start": 670,
"end": 671,
"ctxt": 0
},
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
"start": 671,
"end": 672,
"ctxt": 0
},
"kind": "e"
}
}
],
"important": null

View File

@ -6,8 +6,8 @@ error: Stylesheet
3 | | property: +10;
4 | | property: -10;
... |
9 | | property: +.1;
10 | | }
35 | | property: 1e;
36 | | }
| |__^
error: Rule
@ -18,8 +18,8 @@ error: Rule
3 | | property: +10;
4 | | property: -10;
... |
9 | | property: +.1;
10 | | }
35 | | property: 1e;
36 | | }
| |_^
error: StyleRule
@ -30,8 +30,8 @@ error: StyleRule
3 | | property: +10;
4 | | property: -10;
... |
9 | | property: +.1;
10 | | }
35 | | property: 1e;
36 | | }
| |_^
error: ComplexSelector
@ -67,8 +67,8 @@ error: DeclBlock
3 | | property: +10;
4 | | property: -10;
... |
9 | | property: +.1;
10 | | }
35 | | property: 1e;
36 | | }
| |_^
error: Property
@ -263,3 +263,639 @@ error: Num
9 | property: +.1;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:10:5
|
10 | property: 0;
| ^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:10:5
|
10 | property: 0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:10:15
|
10 | property: 0;
| ^
error: Num
--> $DIR/tests/fixture/number/input.css:10:15
|
10 | property: 0;
| ^
error: Property
--> $DIR/tests/fixture/number/input.css:11:5
|
11 | property: 10;
| ^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:11:5
|
11 | property: 10;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:11:15
|
11 | property: 10;
| ^^
error: Num
--> $DIR/tests/fixture/number/input.css:11:15
|
11 | property: 10;
| ^^
error: Property
--> $DIR/tests/fixture/number/input.css:12:5
|
12 | property: .10;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:12:5
|
12 | property: .10;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:12:15
|
12 | property: .10;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:12:15
|
12 | property: .10;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:13:5
|
13 | property: 12.34;
| ^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:13:5
|
13 | property: 12.34;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:13:15
|
13 | property: 12.34;
| ^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:13:15
|
13 | property: 12.34;
| ^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:14:5
|
14 | property: 0.1;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:14:5
|
14 | property: 0.1;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:14:15
|
14 | property: 0.1;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:14:15
|
14 | property: 0.1;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:15:5
|
15 | property: 1.0;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:15:5
|
15 | property: 1.0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:15:15
|
15 | property: 1.0;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:15:15
|
15 | property: 1.0;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:16:5
|
16 | property: 0.0;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:16:5
|
16 | property: 0.0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:16:15
|
16 | property: 0.0;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:16:15
|
16 | property: 0.0;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:17:5
|
17 | property: +0.0;
| ^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:17:5
|
17 | property: +0.0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:17:15
|
17 | property: +0.0;
| ^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:17:15
|
17 | property: +0.0;
| ^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:18:5
|
18 | property: -0.0;
| ^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:18:5
|
18 | property: -0.0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:18:15
|
18 | property: -0.0;
| ^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:18:15
|
18 | property: -0.0;
| ^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:19:5
|
19 | property: .0;
| ^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:19:5
|
19 | property: .0;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:19:15
|
19 | property: .0;
| ^^
error: Num
--> $DIR/tests/fixture/number/input.css:19:15
|
19 | property: .0;
| ^^
error: Property
--> $DIR/tests/fixture/number/input.css:20:5
|
20 | property: 1.200000;
| ^^^^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:20:5
|
20 | property: 1.200000;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:20:15
|
20 | property: 1.200000;
| ^^^^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:20:15
|
20 | property: 1.200000;
| ^^^^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:21:5
|
21 | property: 1.2e2;
| ^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:21:5
|
21 | property: 1.2e2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:21:15
|
21 | property: 1.2e2;
| ^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:21:15
|
21 | property: 1.2e2;
| ^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:22:5
|
22 | property: 1e2;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:22:5
|
22 | property: 1e2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:22:15
|
22 | property: 1e2;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:22:15
|
22 | property: 1e2;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:23:5
|
23 | property: .2e2;
| ^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:23:5
|
23 | property: .2e2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:23:15
|
23 | property: .2e2;
| ^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:23:15
|
23 | property: .2e2;
| ^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:24:5
|
24 | property: 1.2E2;
| ^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:24:5
|
24 | property: 1.2E2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:24:15
|
24 | property: 1.2E2;
| ^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:24:15
|
24 | property: 1.2E2;
| ^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:25:5
|
25 | property: 1.2e+2;
| ^^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:25:5
|
25 | property: 1.2e+2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:25:15
|
25 | property: 1.2e+2;
| ^^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:25:15
|
25 | property: 1.2e+2;
| ^^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:26:5
|
26 | property: 1.2e-2;
| ^^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:26:5
|
26 | property: 1.2e-2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:26:15
|
26 | property: 1.2e-2;
| ^^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:26:15
|
26 | property: 1.2e-2;
| ^^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:27:5
|
27 | property: -1;
| ^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:27:5
|
27 | property: -1;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:27:15
|
27 | property: -1;
| ^^
error: Num
--> $DIR/tests/fixture/number/input.css:27:15
|
27 | property: -1;
| ^^
error: Property
--> $DIR/tests/fixture/number/input.css:28:5
|
28 | property: -1.2;
| ^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:28:5
|
28 | property: -1.2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:28:15
|
28 | property: -1.2;
| ^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:28:15
|
28 | property: -1.2;
| ^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:29:5
|
29 | property: -.2;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:29:5
|
29 | property: -.2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:29:15
|
29 | property: -.2;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:29:15
|
29 | property: -.2;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:30:5
|
30 | property: -.2;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:30:5
|
30 | property: -.2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:30:15
|
30 | property: -.2;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:30:15
|
30 | property: -.2;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:31:5
|
31 | property: +.2;
| ^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:31:5
|
31 | property: +.2;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:31:15
|
31 | property: +.2;
| ^^^
error: Num
--> $DIR/tests/fixture/number/input.css:31:15
|
31 | property: +.2;
| ^^^
error: Property
--> $DIR/tests/fixture/number/input.css:32:5
|
32 | property: -1.2e3;
| ^^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:32:5
|
32 | property: -1.2e3;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:32:15
|
32 | property: -1.2e3;
| ^^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:32:15
|
32 | property: -1.2e3;
| ^^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:33:5
|
33 | property: 1.75;
| ^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:33:5
|
33 | property: 1.75;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:33:15
|
33 | property: 1.75;
| ^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:33:15
|
33 | property: 1.75;
| ^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:34:5
|
34 | property: +1.75;
| ^^^^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:34:5
|
34 | property: +1.75;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:34:15
|
34 | property: +1.75;
| ^^^^^
error: Num
--> $DIR/tests/fixture/number/input.css:34:15
|
34 | property: +1.75;
| ^^^^^
error: Property
--> $DIR/tests/fixture/number/input.css:35:5
|
35 | property: 1e;
| ^^^^^^^^^^^^
error: Text
--> $DIR/tests/fixture/number/input.css:35:5
|
35 | property: 1e;
| ^^^^^^^^
error: Value
--> $DIR/tests/fixture/number/input.css:35:15
|
35 | property: 1e;
| ^^
error: UnitValue
--> $DIR/tests/fixture/number/input.css:35:15
|
35 | property: 1e;
| ^^
error: Num
--> $DIR/tests/fixture/number/input.css:35:15
|
35 | property: 1e;
| ^
error: Unit
--> $DIR/tests/fixture/number/input.css:35:16
|
35 | property: 1e;
| ^

View File

@ -172,7 +172,8 @@
"end": 67,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
},
"unit": {
"span": {
@ -346,7 +347,8 @@
"end": 135,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
},
"unit": {
"span": {
@ -501,7 +503,8 @@
"end": 196,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
},
"unit": {
"span": {
@ -656,7 +659,8 @@
"end": 257,
"ctxt": 0
},
"value": 4.0
"value": 4.0,
"raw": "4"
},
"unit": {
"span": {

View File

@ -114,7 +114,8 @@
"end": 23,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -188,7 +189,8 @@
"end": 42,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -213,7 +215,8 @@
"end": 48,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {
@ -288,7 +291,8 @@
"end": 67,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -313,7 +317,8 @@
"end": 73,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
}
}
}
@ -388,7 +393,8 @@
"end": 91,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -421,7 +427,8 @@
"end": 97,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
}
}
]
@ -441,7 +448,8 @@
"end": 102,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
},
"unit": {
"span": {
@ -524,7 +532,8 @@
"end": 121,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -550,7 +559,8 @@
"end": 127,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
}
]
}
@ -562,7 +572,8 @@
"end": 131,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
}
}
]
@ -636,7 +647,8 @@
"end": 148,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -677,7 +689,8 @@
"end": 155,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"right": {
"type": "Number",
@ -686,7 +699,8 @@
"end": 159,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
}
}
}
@ -715,7 +729,8 @@
"end": 165,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"right": {
"type": "Number",
@ -724,7 +739,8 @@
"end": 169,
"ctxt": 0
},
"value": 6.0
"value": 6.0,
"raw": "6"
}
}
}
@ -800,7 +816,8 @@
"end": 187,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -826,7 +843,8 @@
"end": 193,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
}
]
}
@ -838,7 +856,8 @@
"end": 197,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
}
}
]
@ -928,7 +947,8 @@
"end": 214,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -954,7 +974,8 @@
"end": 220,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
}
]
}
@ -974,7 +995,8 @@
"end": 224,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
}
]
}
@ -1001,7 +1023,8 @@
"end": 228,
"ctxt": 0
},
"value": 3.0
"value": 3.0,
"raw": "3"
},
"unit": {
"span": {
@ -1022,7 +1045,8 @@
"end": 234,
"ctxt": 0
},
"value": 5.0
"value": 5.0,
"raw": "5"
}
}
]

View File

@ -182,7 +182,8 @@
"end": 78,
"ctxt": 0
},
"value": 1987.0
"value": 1987.0,
"raw": "1987"
}
],
"important": null
@ -219,7 +220,8 @@
"end": 97,
"ctxt": 0
},
"value": 25.0
"value": 25.0,
"raw": "25"
}
}
],
@ -250,7 +252,8 @@
"end": 113,
"ctxt": 0
},
"value": 37.0
"value": 37.0,
"raw": "37"
}
],
"important": null
@ -287,7 +290,8 @@
"end": 128,
"ctxt": 0
},
"value": 12.0
"value": 12.0,
"raw": "12"
},
"unit": {
"span": {
@ -333,7 +337,8 @@
"end": 143,
"ctxt": 0
},
"value": 75.0
"value": 75.0,
"raw": "75"
},
"unit": {
"span": {

View File

@ -114,7 +114,8 @@
"end": 46,
"ctxt": 0
},
"value": 8.0
"value": 8.0,
"raw": "8"
},
"unit": {
"span": {
@ -159,7 +160,8 @@
"end": 63,
"ctxt": 0
},
"value": 8.0
"value": 8.0,
"raw": "8"
},
"unit": {
"span": {
@ -186,7 +188,8 @@
"end": 68,
"ctxt": 0
},
"value": 1.0
"value": 1.0,
"raw": "1"
},
"unit": {
"span": {

View File

@ -96,7 +96,8 @@
"end": 20,
"ctxt": 0
},
"value": 2.0
"value": 2.0,
"raw": "2"
},
"unit": {
"span": {
@ -219,7 +220,8 @@
"end": 66,
"ctxt": 0
},
"value": 10.0
"value": 10.0,
"raw": "10"
},
"unit": {
"span": {
@ -244,7 +246,8 @@
"end": 72,
"ctxt": 0
},
"value": 5.0
"value": 5.0,
"raw": "5"
},
"unit": {
"span": {

Some files were not shown because too many files have changed in this diff Show More