Andrey Sitnik
123d45b9eb
Speed up declaration parsing by avoiding creating new array on each token
2026-05-19 09:36:14 +00:00
Andrey Sitnik
1a2b91cbba
Fix code format
2026-05-19 09:05:25 +00:00
Hyper-Z11 and GitHub
223304dbd8
chore: speed up space-only string check in lib/parser.js ( #2064 )
...
* chore: fast blank string check
* chore: use smaller code
2025-12-31 19:25:47 +01:00
Andrey Sitnik
a66145915f
Fix tests
2025-02-19 11:59:45 +00:00
Andrey Sitnik and Romain Menke
52935575d7
Fix text
...
Co-authored-by: Romain Menke <[email protected] >
2025-02-19 12:58:03 +01:00
hiepxanh and Andrey Sitnik
fcf9d1b5c1
update: parser.js to clarify error message
...
clarify error message by specify error variable
2025-02-19 12:58:03 +01:00
Romain Menke and GitHub
b8f001c4d5
Fix end position of rules with ownSemicon ( #2012 )
2025-02-10 21:44:27 +01:00
Andrey Sitnik
19afb318d6
Sort source code and fix ESLint
2024-08-31 23:26:27 +02:00
Eng Zer Jun
f16150a5f2
Replace indexOf === 0 with startsWith
...
It is more readable to call `startsWith` than to call `indexOf` and
compare the result with zero to determine whether a string starts with a
given prefix.
`startsWith` is also more efficient as it only compares at the beginning
of the string, while `indexOf` searches the entire string.
Signed-off-by: Eng Zer Jun <[email protected] >
2024-08-06 21:41:58 +08:00
dmitry
ba1913d3a5
replaced the redundant map function and removed the unused variable
2024-01-31 19:47:28 +04:00
Ido Rosenthal
b8bf0a2986
fix: node end offset
2023-08-29 11:37:38 +03:00
Romain Menke
6fa288a736
add source.end to Root nodes
2023-08-15 15:29:57 +02:00
Andrey Sitnik
89b7f7ac78
Update dependencies and code style
2023-07-06 13:38:48 +02:00
Andrey Sitnik
32fc84a4f7
Fix end position in empty Custom Properties
2022-03-07 03:08:38 +01:00
Andrey Sitnik
6f92b42e9f
Fix comment removal after ,
2022-02-09 17:23:27 +01:00
Andrey Sitnik
d62bc58e55
Clean up code
2022-02-09 17:02:16 +01:00
Andrey Sitnik
bf4c0f2a0a
Fix empty custom property parsing
2022-02-01 00:03:54 +01:00
Andrey Sitnik
9c147c6862
Fix changing declaration meaning by comment removing
2022-01-31 23:33:40 +01:00
Adaline Valentina Simonian
45097948ff
feat: Support ranges for errors and warnings
...
Allows for better diagnostics in linters, language servers, and plugins.
2021-11-16 17:15:01 -08:00
Gusted
fbbffb9a07
Return correct column on missed semicolon
...
I've added some test-cases to ensure it works.
Also added a comment about `why` we it need to get token[3]+1
And ultimately it resolves https://github.com/postcss/postcss/issues/1617
Regards,
Gusted
2021-07-21 16:33:08 +02:00
Andrey Sitnik
843ab11b6e
Add Prettier
2021-03-11 19:11:37 -05:00
Andrey Sitnik
35164d4d74
Improve position code
2020-09-16 17:43:45 -04:00
Andrey Sitnik
8da907cec7
Fix declaration position
2020-09-16 17:43:33 -04:00
Andrey Sitnik
84a657d8be
Remove line/column tracking from tokenizer
2020-09-09 01:21:14 -04:00
Andrey Sitnik
3860676e02
Fix offset
2020-09-08 22:33:51 -04:00
Ayaz Zaynutdinov and Andrey Sitnik
080c6b3002
Add offset property to position
2020-09-08 22:18:32 -04:00
Andrey Sitnik
0048657b13
Add "use strict" because it may effect on tokenizer performance
2020-09-08 01:46:46 -04:00
Andrey Sitnik
aaf34ef51e
Better empty declaration parsing
2020-09-08 01:04:55 -04:00
Andrey Sitnik
d4c1acf923
Keep whitespace in declaration on empty value
2020-09-07 14:02:30 -04:00
Andrey Sitnik
2680563d28
Improve at-rule parsing
2020-08-09 18:12:09 -07:00
Andrey Sitnik
c3b3015661
Improve test coverage
2020-08-04 17:37:21 -07:00
Andrey Sitnik
b27aa7d0a8
Improve custom properties parse with JSON data
2020-06-21 19:13:53 -04:00
Andrey Sitnik
d6eeb4edf7
Clean up regexps
2020-06-21 19:13:53 -04:00
Andrey Sitnik
288d2ffdb6
Clean up code
2020-06-21 19:13:53 -04:00
Andrey Sitnik
0e6be3a2dc
Fix rebase problems
2020-06-21 19:13:52 -04:00
Andrey Sitnik
04b816cbde
Remove Babel
2020-06-21 19:13:52 -04:00
Andrey Sitnik
f43a45a907
Use .es6 ext for ES6 sources
2015-08-17 16:20:40 +03:00
Andrey Sitnik
51a4822d52
Remove Root#prevMap for more consistence API
2015-08-17 16:20:39 +03:00
Andrey Sitnik
784d5b798a
Fix ESLint warnings
2015-08-17 16:20:39 +03:00
Andrey Sitnik
474f58e447
Clean up code
2015-08-17 16:20:39 +03:00
Andrey Sitnik
366ef95224
Clean up code
2015-08-17 16:20:39 +03:00
Andrey Sitnik
382de6113d
Move Safe Parser to separated project
2015-08-17 16:20:39 +03:00
Andrey Sitnik
b02e3a6aea
Prepare parser be extended in postcss-safe-parser
2015-08-17 16:20:39 +03:00
Andrey Sitnik
0008b3d4c2
Move to ESLint 1.0
2015-08-17 16:20:38 +03:00
Andrey Sitnik
b76b5a34fc
Move code style properties to Node#raw
2015-08-17 16:20:37 +03:00
Andrey Sitnik
c128e5b954
Clean up code styles
2015-08-17 16:20:37 +03:00
Andrey Sitnik
e5898c5769
Allow to parse at-words in declaration values
2015-04-14 00:33:19 +03:00
Andrey Sitnik
ac8c257ed5
Parse wrong close bracket
2015-03-28 18:46:36 +03:00
Andrey Sitnik
9ce8d09a14
Clean up important parsing
2015-03-25 15:15:35 +03:00
Ben Briggs
4a395c29d4
Parse spaces & comments inside important. Fixes #253 .
2015-03-22 21:10:37 +00:00