Skip to content

Commit

Permalink
CSS: add unicode-range to hash table, see #321
Browse files Browse the repository at this point in the history
  • Loading branch information
tdewolff committed Oct 16, 2020
1 parent c2f5ff6 commit 7dada05
Showing 1 changed file with 48 additions and 41 deletions.
89 changes: 48 additions & 41 deletions css/hash.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
package css

// generated by hasher -type=Hash -file=hash.go; DO NOT EDIT, except for adding more constants to the list and rerun go generate

// uses github.com/tdewolff/hasher
//go:generate hasher -type=Hash -file=hash.go

// Hash defines perfect hashes for a predefined list of strings
type Hash uint32

// Unique hash definitions to be used instead of strings
// Identifiers for the hashes associated with the text in the comments.
const (
Ms_Filter Hash = 0xa // -ms-filter
Accelerator Hash = 0x3760b // accelerator
Aliceblue Hash = 0x7a209 // aliceblue
Align_Content Hash = 0xd8b0d // align-content
Align_Content Hash = 0xd980d // align-content
Align_Items Hash = 0x7ef0b // align-items
Align_Self Hash = 0x8cb0a // align-self
All Hash = 0x69103 // all
Expand All @@ -23,7 +21,7 @@ const (
Animation_Direction Hash = 0x8e913 // animation-direction
Animation_Duration Hash = 0x35d12 // animation-duration
Animation_Fill_Mode Hash = 0x66c13 // animation-fill-mode
Animation_Iteration_Count Hash = 0xd3c19 // animation-iteration-count
Animation_Iteration_Count Hash = 0xd4919 // animation-iteration-count
Animation_Name Hash = 0xca0e // animation-name
Animation_Play_State Hash = 0xfc14 // animation-play-state
Animation_Timing_Function Hash = 0x14119 // animation-timing-function
Expand Down Expand Up @@ -98,7 +96,7 @@ const (
Content Hash = 0x5607 // content
Cornflowerblue Hash = 0x4c70e // cornflowerblue
Cornsilk Hash = 0x4d508 // cornsilk
Counter_Increment Hash = 0xd5011 // counter-increment
Counter_Increment Hash = 0xd5d11 // counter-increment
Counter_Reset Hash = 0x4690d // counter-reset
Cue Hash = 0x4dd03 // cue
Cue_After Hash = 0x4dd09 // cue-after
Expand Down Expand Up @@ -242,8 +240,8 @@ const (
Local Hash = 0x9c105 // local
Magenta Hash = 0xced07 // magenta
Margin Hash = 0x53906 // margin
Margin_Bottom Hash = 0xda40d // margin-bottom
Margin_Left Hash = 0xdb00b // margin-left
Margin_Bottom Hash = 0xdb10d // margin-bottom
Margin_Left Hash = 0xdbd0b // margin-left
Margin_Right Hash = 0xb890c // margin-right
Margin_Top Hash = 0x5390a // margin-top
Marker_Offset Hash = 0xad00d // marker-offset
Expand All @@ -252,7 +250,7 @@ const (
Max Hash = 0x9d303 // max
Max_Height Hash = 0x9d30a // max-height
Max_Width Hash = 0x9dd09 // max-width
Media Hash = 0xd3805 // media
Media Hash = 0xd4505 // media
Medium Hash = 0x9e606 // medium
Mediumaquamarine Hash = 0x9e610 // mediumaquamarine
Mediumblue Hash = 0x9f60a // mediumblue
Expand Down Expand Up @@ -341,15 +339,15 @@ const (
Round Hash = 0x3005 // round
Row_Gap Hash = 0x6ec07 // row-gap
Royalblue Hash = 0x69509 // royalblue
Ruby_Align Hash = 0xd860a // ruby-align
Ruby_Align Hash = 0xd930a // ruby-align
Ruby_Overhang Hash = 0xe00d // ruby-overhang
Ruby_Position Hash = 0x1340d // ruby-position
S Hash = 0x201 // s
Saddlebrown Hash = 0xb50b // saddlebrown
Sandybrown Hash = 0x3850a // sandybrown
Sans_Serif Hash = 0x39b0a // sans-serif
Scroll Hash = 0x12006 // scroll
Scrollbar_3d_Light_Color Hash = 0xd6f18 // scrollbar-3d-light-color
Scrollbar_3d_Light_Color Hash = 0xd7c18 // scrollbar-3d-light-color
Scrollbar_Arrow_Color Hash = 0x12015 // scrollbar-arrow-color
Scrollbar_Base_Color Hash = 0x8a614 // scrollbar-base-color
Scrollbar_Dark_Shadow_Color Hash = 0x5d31b // scrollbar-dark-shadow-color
Expand Down Expand Up @@ -392,9 +390,9 @@ const (
Text_Justify Hash = 0x490c // text-justify
Text_Kashida_Space Hash = 0x5c12 // text-kashida-space
Text_Overflow Hash = 0x980d // text-overflow
Text_Shadow Hash = 0xd600b // text-shadow
Text_Transform Hash = 0xd970e // text-transform
Text_Underline_Position Hash = 0xdba17 // text-underline-position
Text_Shadow Hash = 0xd6d0b // text-shadow
Text_Transform Hash = 0xda40e // text-transform
Text_Underline_Position Hash = 0xdc717 // text-underline-position
Top Hash = 0x3be03 // top
Transition Hash = 0x4750a // transition
Transition_Delay Hash = 0x59a10 // transition-delay
Expand All @@ -405,17 +403,18 @@ const (
Turn Hash = 0xd1f04 // turn
Turquoise Hash = 0xa8209 // turquoise
Unicode_Bidi Hash = 0xcc40c // unicode-bidi
Unset Hash = 0xd2305 // unset
UnicodeRange Hash = 0xd230d // unicode-range
Unset Hash = 0xd3005 // unset
Url Hash = 0x3f403 // url
Var Hash = 0x64503 // var
Vertical_Align Hash = 0x7e60e // vertical-align
Visibility Hash = 0x4f70a // visibility
Voice_Family Hash = 0xd280c // voice-family
Volume Hash = 0xd3406 // volume
Voice_Family Hash = 0xd350c // voice-family
Volume Hash = 0xd4106 // volume
White Hash = 0x7b05 // white
White_Space Hash = 0x6500b // white-space
Whitesmoke Hash = 0x5c30a // whitesmoke
Widows Hash = 0xd6a06 // widows
Widows Hash = 0xd7706 // widows
Width Hash = 0x26b05 // width
Word_Break Hash = 0x1670a // word-break
Word_Spacing Hash = 0x28e0c // word-spacing
Expand All @@ -430,18 +429,22 @@ const (
Z_Index Hash = 0x68607 // z-index
)

// String returns the hash' name.
// String returns the text associated with the hash.
func (i Hash) String() string {
return string(i.Bytes())
}

// Bytes returns the text associated with the hash.
func (i Hash) Bytes() []byte {
start := uint32(i >> 8)
n := uint32(i & 0xff)
if start+n > uint32(len(_Hash_text)) {
return ""
return []byte{}
}
return _Hash_text[start : start+n]
}

// ToHash returns the hash whose name is s. It returns zero if there is no
// such hash. It is case sensitive.
// ToHash returns a hash Hash for a given []byte. Hash is a uint32 that is associated with the text in []byte. It returns zero if no match found.
func ToHash(s []byte) Hash {
if len(s) == 0 || len(s) > _Hash_maxLen {
return 0
Expand Down Expand Up @@ -475,7 +478,9 @@ NEXT:

const _Hash_hash0 = 0x9acb0442
const _Hash_maxLen = 27
const _Hash_text = "-ms-filteradial-gradientext-emphasis-colorgbackground-attach" +

var _Hash_text = []byte("" +
"-ms-filteradial-gradientext-emphasis-colorgbackground-attach" +
"mentext-indentext-justify-contentext-kashida-spacelevationav" +
"ajowhitext-decoration-line-heightext-overflow-xx-largerichne" +
"ssaddlebrowno-repeat-yanimation-namespacenteruby-overhangain" +
Expand Down Expand Up @@ -531,13 +536,14 @@ const _Hash_text = "-ms-filteradial-gradientext-emphasis-colorgbackground-attach
"ion-thicknesstrokeplace-selflex-flowriting-modepowderbluepro" +
"gidarkturquoisequotesupportsunicode-bidisplay-duringrid-colu" +
"mn-endarkmagentable-layout-floword-wrapadding-leftransparent" +
"urnunsetvoice-familyvolumedianimation-iteration-counter-incr" +
"ementext-shadowidowscrollbar-3d-light-coloruby-align-content" +
"ext-transformargin-bottomargin-leftext-underline-position"
"urnunicode-rangeunsetvoice-familyvolumedianimation-iteration" +
"-counter-incrementext-shadowidowscrollbar-3d-light-coloruby-" +
"align-contentext-transformargin-bottomargin-leftext-underlin" +
"e-position")

var _Hash_table = [1 << 10]Hash{
0x3: 0xc290b, // pause-after
0x6: 0xd5011, // counter-increment
0x6: 0xd5d11, // counter-increment
0x8: 0xcce07, // display
0x9: 0x51a0a, // darkviolet
0xb: 0xbf09, // no-repeat
Expand All @@ -551,7 +557,7 @@ var _Hash_table = [1 << 10]Hash{
0x20: 0x61114, // scrollbar-face-color
0x24: 0x2b60f, // border-collapse
0x25: 0x68607, // z-index
0x27: 0xd8b0d, // align-content
0x27: 0xd980d, // align-content
0x2a: 0x99f13, // list-style-position
0x2b: 0xcdb0f, // grid-column-end
0x2c: 0x14119, // animation-timing-function
Expand All @@ -564,7 +570,7 @@ var _Hash_table = [1 << 10]Hash{
0x42: 0x7a209, // aliceblue
0x43: 0xf309, // rosybrown
0x46: 0xa7c0f, // mediumturquoise
0x49: 0xd6a06, // widows
0x49: 0xd7706, // widows
0x4b: 0xb370f, // offset-position
0x4d: 0xd150b, // transparent
0x4e: 0x79d07, // initial
Expand Down Expand Up @@ -654,7 +660,7 @@ var _Hash_table = [1 << 10]Hash{
0x123: 0x48811, // column-rule-color
0x128: 0x40f0c, // caption-side
0x12a: 0xc9b0a, // powderblue
0x12b: 0xdba17, // text-underline-position
0x12b: 0xdc717, // text-underline-position
0x12d: 0x72315, // scrollbar-track-color
0x131: 0x81c0e, // grid-auto-flow
0x132: 0x7810c, // speak-header
Expand All @@ -681,7 +687,7 @@ var _Hash_table = [1 << 10]Hash{
0x16b: 0x5cb09, // keyframes
0x16f: 0x7b05, // white
0x172: 0x1004, // grad
0x174: 0xda40d, // margin-bottom
0x174: 0xdb10d, // margin-bottom
0x175: 0x31212, // border-right-color
0x177: 0x25404, // font
0x178: 0xc100d, // palegoldenrod
Expand All @@ -692,7 +698,7 @@ var _Hash_table = [1 << 10]Hash{
0x189: 0x4bb0c, // column-width
0x18a: 0x3c710, // border-top-style
0x18b: 0x1d604, // size
0x18c: 0xd3805, // media
0x18c: 0xd4505, // media
0x191: 0xb7c0e, // padding-bottom
0x194: 0x2df11, // border-left-color
0x195: 0x7a70a, // blueviolet
Expand All @@ -709,7 +715,7 @@ var _Hash_table = [1 << 10]Hash{
0x1af: 0x64503, // var
0x1b0: 0xaed02, // mm
0x1b6: 0x12015, // scrollbar-arrow-color
0x1b8: 0xd970e, // text-transform
0x1b8: 0xda40e, // text-transform
0x1b9: 0x65b0b, // font-weight
0x1ba: 0x53802, // cm
0x1bb: 0x12006, // scroll
Expand Down Expand Up @@ -772,7 +778,7 @@ var _Hash_table = [1 << 10]Hash{
0x251: 0xd1f04, // turn
0x256: 0xba70d, // outline-color
0x257: 0x9c304, // calc
0x258: 0xd3c19, // animation-iteration-count
0x258: 0xd4919, // animation-iteration-count
0x259: 0xad70d, // offset-anchor
0x25b: 0xa4e0e, // mediumseagreen
0x25e: 0x4620c, // column-count
Expand Down Expand Up @@ -802,7 +808,7 @@ var _Hash_table = [1 << 10]Hash{
0x29b: 0xb50b, // saddlebrown
0x2a0: 0x59505, // float
0x2a3: 0x6ec07, // row-gap
0x2a5: 0xd3406, // volume
0x2a5: 0xd4106, // volume
0x2a6: 0xab50a, // min-height
0x2a7: 0x77012, // grid-template-rows
0x2a9: 0x3760b, // accelerator
Expand Down Expand Up @@ -851,15 +857,15 @@ var _Hash_table = [1 << 10]Hash{
0x315: 0x2903, // rgb
0x316: 0x8ba09, // lightblue
0x317: 0x8d909, // direction
0x31a: 0xd280c, // voice-family
0x31a: 0xd350c, // voice-family
0x31c: 0x3480e, // border-spacing
0x321: 0x6d09, // elevation
0x323: 0x1c308, // repeat-x
0x324: 0x83e10, // layout-grid-line
0x326: 0xa000c, // mediumorchid
0x32b: 0xa6b11, // mediumspringgreen
0x32d: 0xa905, // large
0x32e: 0xd860a, // ruby-align
0x32e: 0xd930a, // ruby-align
0x330: 0xbfa0d, // darkslategray
0x332: 0x5c12, // text-kashida-space
0x334: 0xbb40d, // outline-style
Expand All @@ -872,6 +878,7 @@ var _Hash_table = [1 << 10]Hash{
0x340: 0x31905, // right
0x341: 0x3e70c, // border-width
0x343: 0xb6e0f, // background-clip
0x344: 0xd230d, // unicode-range
0x345: 0x74c05, // solid
0x346: 0x2df0b, // border-left
0x348: 0x9ec0a, // aquamarine
Expand Down Expand Up @@ -900,7 +907,7 @@ var _Hash_table = [1 << 10]Hash{
0x384: 0x9d303, // max
0x38c: 0xa608, // xx-large
0x38d: 0x3f309, // burlywood
0x38f: 0xd6f18, // scrollbar-3d-light-color
0x38f: 0xd7c18, // scrollbar-3d-light-color
0x390: 0x3ff09, // goldenrod
0x392: 0x92309, // lightpink
0x393: 0x8e0b, // line-height
Expand All @@ -921,8 +928,8 @@ var _Hash_table = [1 << 10]Hash{
0x3c0: 0x43909, // chocolate
0x3c3: 0x5f909, // font-size
0x3c5: 0x55f04, // flex
0x3c7: 0xd2305, // unset
0x3c8: 0xd600b, // text-shadow
0x3c7: 0xd3005, // unset
0x3c8: 0xd6d0b, // text-shadow
0x3ca: 0x4ec0b, // forestgreen
0x3cc: 0xbfe09, // slategray
0x3cd: 0x6ac11, // page-break-before
Expand All @@ -936,7 +943,7 @@ var _Hash_table = [1 << 10]Hash{
0x3de: 0x2d30c, // border-color
0x3df: 0x18e15, // background-position-x
0x3e0: 0x55005, // pitch
0x3e2: 0xdb00b, // margin-left
0x3e2: 0xdbd0b, // margin-left
0x3e3: 0x58504, // page
0x3e5: 0x57b0b, // padding-top
0x3e7: 0xb460d, // offset-rotate
Expand Down

0 comments on commit 7dada05

Please sign in to comment.