-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move typed om implementation into a separate folder
- Loading branch information
1 parent
ecdca38
commit d3a49d3
Showing
5 changed files
with
161 additions
and
130 deletions.
There are no files selected for viewing
17 changes: 11 additions & 6 deletions
17
src/numeric-values.js → src/css-typed-om/numeric-values.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
|
||
export class Token {} | ||
|
||
// The output of tokenization step is a stream of zero or more of the following tokens: <ident-token>, <function-token>, | ||
// <at-keyword-token>, <hash-token>, <string-token>, <bad-string-token>, <url-token>, <bad-url-token>, <delim-token>, | ||
// <number-token>, <percentage-token>, <dimension-token>, <whitespace-token>, <CDO-token>, <CDC-token>, <colon-token>, | ||
// <semicolon-token>, <comma-token>, <[-token>, <]-token>, <(-token>, <)-token>, <{-token>, and <}-token>. | ||
export class IdentToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class FunctionToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class AtKeywordToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class HashToken extends Token { | ||
type; | ||
value; | ||
constructor(value, type = 'unrestricted') { | ||
super(); | ||
this.value = value; | ||
this.type = type; | ||
} | ||
} | ||
|
||
export class StringToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class BadStringToken extends Token {} | ||
|
||
export class UrlToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class BadUrlToken extends Token {} | ||
|
||
export class DelimToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class NumberToken extends Token { | ||
value; | ||
type; | ||
constructor(value, type = "integer") { | ||
super(); | ||
this.value = value; | ||
this.type = type; | ||
} | ||
} | ||
|
||
export class PercentageToken extends Token { | ||
value; | ||
constructor(value) { | ||
super(); | ||
this.value = value; | ||
} | ||
} | ||
|
||
export class DimensionToken extends Token { | ||
value; | ||
type; | ||
unit; | ||
constructor(value, type, unit) { | ||
super(); | ||
this.value = value; | ||
this.type = type; | ||
this.unit = unit; | ||
} | ||
} | ||
|
||
export class WhitespaceToken extends Token {} | ||
|
||
export class CDOToken extends Token {} | ||
|
||
export class CDCToken extends Token {} | ||
|
||
export class ColonToken extends Token {} | ||
|
||
export class SemicolonToken extends Token {} | ||
|
||
export class CommaToken extends Token {} | ||
|
||
export class LeftSquareBracketToken extends Token {} | ||
|
||
export class RightSquareBracketToken extends Token {} | ||
|
||
export class LeftParenthesisToken extends Token {} | ||
|
||
export class RightParenthesisToken extends Token {} | ||
|
||
export class LeftCurlyBracketToken extends Token {} | ||
|
||
export class RightCurlyBracketToken extends Token {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters