File tree Expand file tree Collapse file tree 5 files changed +4
-8
lines changed
Expand file tree Collapse file tree 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";
66
77let debug = dbg ( "lex" ) ;
88
9- export default lex ;
10-
119/**
1210 * Convert a CSS string into an array of lexical tokens.
1311 *
1412 * @param {String } css CSS
1513 * @returns {Array } lexical tokens
1614 */
17- function lex ( css : string ) : Token [ ] {
15+ export function lex ( css : string ) : Token [ ] {
1816 var start = 0 ; // Debug timer start.
1917
2018 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.
44import dbg from "../debug.js" ;
55let debug = dbg ( "parse" ) ;
66
7- import lex from "../lexer/lexer.ts" ;
7+ import { lex } from "../lexer/lexer.ts" ;
88import { AST , Token } from "../types.ts" ;
99
10- export default parse ;
11-
1210var _comments : boolean ; // Whether comments are allowed.
1311var _depth : number ; // Current block nesting depth.
1412var _position : any ; // Whether to include line/column position.
@@ -22,7 +20,7 @@ var _tokens: Token[]; // Array of lexical tokens.
2220 * @param {Boolean } [options.comments=false] allow comment nodes in the AST
2321 * @returns {Object } `stringify`-able AST
2422 */
25- function parse ( css : string | any [ ] , options : any ) : AST {
23+ export function parse ( css : string | any [ ] , options : any ) : AST {
2624 var start = 0 ; // Debug timer start.
2725
2826 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" ;
22
33var ast = parse ( "p { color: black; }" ) ;
44console . log ( ast ) ;
You can’t perform that action at this time.
0 commit comments