File tree 5 files changed +4
-8
lines changed
5 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,13 @@ import { Token } from "../types.ts";
6
6
7
7
let debug = dbg ( "lex" ) ;
8
8
9
- export default lex ;
10
-
11
9
/**
12
10
* Convert a CSS string into an array of lexical tokens.
13
11
*
14
12
* @param {String } css CSS
15
13
* @returns {Array } lexical tokens
16
14
*/
17
- function lex ( css : string ) : Token [ ] {
15
+ export function lex ( css : string ) : Token [ ] {
18
16
var start = 0 ; // Debug timer start.
19
17
20
18
var buffer = "" ; // Character accumulator
Original file line number Diff line number Diff line change @@ -4,11 +4,9 @@ var TIMER = false; // `true` to time calls to `parse()` and print the results.
4
4
import dbg from "../debug.js" ;
5
5
let debug = dbg ( "parse" ) ;
6
6
7
- import lex from "../lexer/lexer.ts" ;
7
+ import { lex } from "../lexer/lexer.ts" ;
8
8
import { AST , Token } from "../types.ts" ;
9
9
10
- export default parse ;
11
-
12
10
var _comments : boolean ; // Whether comments are allowed.
13
11
var _depth : number ; // Current block nesting depth.
14
12
var _position : any ; // Whether to include line/column position.
@@ -22,7 +20,7 @@ var _tokens: Token[]; // Array of lexical tokens.
22
20
* @param {Boolean } [options.comments=false] allow comment nodes in the AST
23
21
* @returns {Object } `stringify`-able AST
24
22
*/
25
- function parse ( css : string | any [ ] , options : any ) : AST {
23
+ export function parse ( css : string | any [ ] , options : any ) : AST {
26
24
var start = 0 ; // Debug timer start.
27
25
28
26
options || ( options = { } ) ;
Original file line number Diff line number Diff line change 1
- import parse from "./parser/parser.ts" ;
1
+ import { parse } from "./parser/parser.ts" ;
2
2
3
3
var ast = parse ( "p { color: black; }" ) ;
4
4
console . log ( ast ) ;
You can’t perform that action at this time.
0 commit comments