After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795550 - css.lang: Add support for scientific notation and turn unit
css.lang: Add support for scientific notation and turn unit
Status: RESOLVED WONTFIX
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2018-04-25 16:33 UTC by Jeffery To
Modified: 2018-05-04 06:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
css.lang: Add support for scientific notation and turn unit (1.04 KB, patch)
2018-04-25 16:36 UTC, Jeffery To
needs-work Details | Review

Description Jeffery To 2018-04-25 16:33:39 UTC
Scientific notation for numbers[1] and the turn unit[2] may not be used often but they are support by browsers and would be nice to have them correctly highlighted.

Will attach a patch for this shortly.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/number#Examples
[2] https://developer.mozilla.org/en-US/docs/Web/CSS/angle#turn
Comment 1 Jeffery To 2018-04-25 16:36:27 UTC
Created attachment 371394 [details] [review]
css.lang: Add support for scientific notation and turn unit

This adds scientific notation and the turn unit to the dimension context.
Comment 2 Jeffery To 2018-04-25 17:59:05 UTC
I seem to have missed the case of an uppercase E, I will update the patch soon-ish, but I noticed there are also contexts for "resolution", "number" and "float"/"float number" (which already accepts scientific notation). Should I also update the resolution and number contexts with scientific notation (since wherever a number can be parsed, scientific notation is acceptable)?

(As a tangent, I'm trying to understand the difference between number and float-number, i.e. can these two be combined into one? Why can't float be "spelled out" in a regex like in dimension, instead of an extended regex as it is now? And why does float accept a string like "12." when that's not a valid CSS number?)
Comment 3 Sébastien Wilmet 2018-05-03 10:23:14 UTC
Review of attachment 371394 [details] [review]:

.
Comment 4 Jeffery To 2018-05-04 06:38:12 UTC
There's more I'd like to do with the number-related contexts, so I will close this and submit a larger patch in a new bug.

Also, with regards to the uppercase E, CSS syntax is case insensitive; I will submit a separate patch to address this.