@ordojs/core
Version:
Core compiler and runtime for OrdoJS framework
99 lines • 2.23 kB
TypeScript
/**
* @fileoverview CSS Parser for OrdoJS Framework
* Parses CSS content into an AST structure for further processing
*/
import { type StyleBlockNode } from '../types/index.js';
/**
* CSS Parser options
*/
export interface CSSParserOptions {
/**
* Whether to generate source maps
*/
generateSourceMaps?: boolean;
/**
* Whether to validate CSS syntax
*/
validateSyntax?: boolean;
}
/**
* CSS Parser for OrdoJS components
*/
export declare class OrdoJSCSSParser {
private options;
private source;
private currentPosition;
private currentLine;
private currentColumn;
private errors;
constructor(options?: Partial<CSSParserOptions>);
/**
* Parse CSS content into a StyleBlockNode
*/
parse(source: string, scoped?: boolean): StyleBlockNode;
/**
* Parse CSS rules
*/
private parseRules;
/**
* Parse a single CSS rule
*/
private parseRule;
/**
* Parse a CSS selector
*/
private parseSelector;
/**
* Parse CSS declarations
*/
private parseDeclarations;
/**
* Parse a single CSS declaration
*/
private parseDeclaration;
/**
* Parse a CSS property name
*/
private parseIdentifier;
/**
* Parse a CSS property value
*/
private parseValue;
/**
* Check if a character is valid as the start of an identifier
*/
private isIdentifierStart;
/**
* Check if a character is valid as part of an identifier
*/
private isIdentifierPart;
/**
* Advance the current position
*/
private advance;
/**
* Skip whitespace characters
*/
private skipWhitespace;
/**
* Consume an expected character
*/
private consume;
/**
* Recover from an error by advancing to the next rule
*/
private recoverToNextRule;
/**
* Recover from an error by advancing to the next declaration
*/
private recoverToNextDeclaration;
/**
* Create a source location object
*/
private createSourceLocation;
/**
* Create a source range object
*/
private createSourceRange;
}
//# sourceMappingURL=css-parser.d.ts.map