@jesscss/less-parser 2.0.0-alpha.8 → 2.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -10
- package/lib/ast/grammar.d.ts +2 -0
- package/lib/ast/grammar.d.ts.map +1 -0
- package/lib/grammar.cjs +39855 -31054
- package/lib/grammar.d.ts.map +1 -1
- package/lib/grammar.js +39855 -31054
- package/lib/index.cjs +49609 -15
- package/lib/index.d.ts +4 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +49607 -5
- package/lib/parse-error.d.ts +15 -0
- package/lib/parse-error.d.ts.map +1 -0
- package/package.json +9 -24
- package/lib/builders.d.ts +0 -381
- package/lib/builders.d.ts.map +0 -1
- package/lib/functional-parser.cjs +0 -2654
- package/lib/functional-parser.d.ts +0 -18
- package/lib/functional-parser.d.ts.map +0 -1
- package/lib/functional-parser.js +0 -2589
- package/lib/jess.cjs +0 -3968
- package/lib/jess.d.ts +0 -7
- package/lib/jess.d.ts.map +0 -1
- package/lib/jess.js +0 -3962
- package/lib/lessParser.d.ts +0 -38
- package/lib/lessParser.d.ts.map +0 -1
- package/lib/lessRecursiveParser.d.ts +0 -99
- package/lib/lessRecursiveParser.d.ts.map +0 -1
- package/lib/lessTokens.d.ts +0 -23
- package/lib/lessTokens.d.ts.map +0 -1
- package/lib/productions/guards.d.ts +0 -113
- package/lib/productions/guards.d.ts.map +0 -1
- package/lib/productions/index.d.ts +0 -5
- package/lib/productions/index.d.ts.map +0 -1
- package/lib/productions/root.d.ts +0 -38
- package/lib/productions/root.d.ts.map +0 -1
- package/lib/productions/selectors.d.ts +0 -41
- package/lib/productions/selectors.d.ts.map +0 -1
- package/lib/productions/values.d.ts +0 -35
- package/lib/productions/values.d.ts.map +0 -1
- package/lib/utils.d.ts +0 -9
- package/lib/utils.d.ts.map +0 -1
- package/src/__tests__/debug-log.ts +0 -35
- package/src/__tests__/wall5-parse.test.ts +0 -67
- package/src/builders.ts +0 -3190
- package/src/cst.ts +0 -25
- package/src/functional-parser.ts +0 -162
- package/src/grammar.ts +0 -870
- package/src/index.ts +0 -19
- package/src/jess.ts +0 -6
- package/src/lessParser.ts +0 -120
- package/src/lessRecursiveParser.ts +0 -279
- package/src/lessTokens.ts +0 -350
- package/src/productions/guards.ts +0 -1066
- package/src/productions/index.ts +0 -29
- package/src/productions/root.ts +0 -1613
- package/src/productions/selectors.ts +0 -1309
- package/src/productions/values.ts +0 -1449
- package/src/utils.ts +0 -178
package/lib/lessParser.d.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Lexer } from 'chevrotain';
|
|
2
|
-
import { LessRecursiveParser, type LessParserConfig } from './lessRecursiveParser.js';
|
|
3
|
-
import { type Node, type Rules, type IParseResult, type TreeContext } from '@jesscss/core';
|
|
4
|
-
export type LessRules = keyof {
|
|
5
|
-
[K in keyof LessRecursiveParser as LessRecursiveParser[K] extends (...args: any[]) => Node ? K : never]: true;
|
|
6
|
-
};
|
|
7
|
-
export type SyntacticContentAssistSuggestion = {
|
|
8
|
-
nextTokenType: string;
|
|
9
|
-
nextTokenLabel?: string;
|
|
10
|
-
ruleStack: string[];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated LEGACY — Chevrotain-lexer + recursive-descent Less parser. Superseded
|
|
14
|
-
* by the functional macro grammar (`LessParser` in ./grammar.ts). Kept only for
|
|
15
|
-
* benchmarking / migration reference; TO BE DELETED once the functional parser
|
|
16
|
-
* fully lands.
|
|
17
|
-
*/
|
|
18
|
-
export declare class LessParser {
|
|
19
|
-
lexer: Lexer;
|
|
20
|
-
parser: LessRecursiveParser;
|
|
21
|
-
constructor(config?: LessParserConfig);
|
|
22
|
-
parse(text: string): IParseResult<Rules>;
|
|
23
|
-
parse(text: string, rule: 'stylesheet'): IParseResult<Rules>;
|
|
24
|
-
parse(text: string, rule: 'stylesheet', options: {
|
|
25
|
-
context?: TreeContext;
|
|
26
|
-
}): IParseResult<Rules>;
|
|
27
|
-
parse(text: string, rule?: LessRules, options?: {
|
|
28
|
-
context?: TreeContext;
|
|
29
|
-
}): IParseResult;
|
|
30
|
-
/**
|
|
31
|
-
* @todo Implement content assist for the new parser
|
|
32
|
-
*/
|
|
33
|
-
suggest(text: string, init: {
|
|
34
|
-
offset: number;
|
|
35
|
-
rule?: LessRules;
|
|
36
|
-
}): SyntacticContentAssistSuggestion[];
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=lessParser.d.ts.map
|
package/lib/lessParser.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessParser.d.ts","sourceRoot":"","sources":["../src/lessParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA2C,MAAM,YAAY,CAAC;AAG5E,OAAO,EAAE,mBAAmB,EAAE,KAAK,gBAAgB,EAAiB,MAAM,0BAA0B,CAAC;AACrG,OAAO,EAAO,KAAK,IAAI,EAAE,KAAK,KAAK,EAAE,KAAK,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEhG,MAAM,MAAM,SAAS,GAAG,MAAM;KAC3B,CAAC,IAAI,MAAM,mBAAmB,IAAI,mBAAmB,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,GAAG,CAAC,GAAG,KAAK,GAAG,IAAI;CAC9G,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA0CF;;;;;GAKG;AACH,qBAAa,UAAU;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,mBAAmB,CAAC;IAE5B,YACE,MAAM,GAAE,gBAAqB,EAU9B;IAED,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACzC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IAC7D,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE;QAAE,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;IACjG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,YAAY,CAAC;IA+BzF;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,SAAS,CAAA;KAAE,GAAG,gCAAgC,EAAE,CAEpG;CACF"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { type IToken, type TokenType } from 'chevrotain';
|
|
2
|
-
import { CssRecursiveParser, type CssRecursiveParserConfig, type RuleContext as CssRuleContext, type CssTokenType } from '@jesscss/css-parser/jess';
|
|
3
|
-
import { type MathMode, type Node, type Extend, type ComplexSelector, type Selector } from '@jesscss/core';
|
|
4
|
-
import { type LessExtraTokenType } from './lessTokens.js';
|
|
5
|
-
export type LessParserConfig = CssRecursiveParserConfig & {
|
|
6
|
-
/**
|
|
7
|
-
* Is less strict with certain CSS rules and Less syntax
|
|
8
|
-
* that the old Less parser allowed.
|
|
9
|
-
*
|
|
10
|
-
* @note This will also enable CSS legacyMode unless
|
|
11
|
-
* legacyMode is explicitly false.
|
|
12
|
-
*/
|
|
13
|
-
looseMode?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Controls whether mixins and detached rulesets "leak" their inner rules.
|
|
16
|
-
* When true (default):
|
|
17
|
-
* - Mixins: Mixin and VarDeclaration nodes are 'public' and 'optional' respectively
|
|
18
|
-
* - Detached rulesets: Mixin and VarDeclaration nodes are 'public' and 'private' respectively
|
|
19
|
-
* When false:
|
|
20
|
-
* - Both mixins and detached rulesets: Mixin and VarDeclaration nodes are 'private'
|
|
21
|
-
*/
|
|
22
|
-
leakyScope?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Less math evaluation mode. Used during parsing to decide whether a given
|
|
25
|
-
* `Operation` should be represented as an `Expression` for Less→Jess conversion.
|
|
26
|
-
*
|
|
27
|
-
* Mirrors runtime behavior in `Context.shouldOperate()`.
|
|
28
|
-
*
|
|
29
|
-
* @default 'parens-division'
|
|
30
|
-
*/
|
|
31
|
-
mathMode?: MathMode;
|
|
32
|
-
/**
|
|
33
|
-
* When enabled (default), the parser will wrap the *outermost* Less math/value
|
|
34
|
-
* expressions (math operations, variable references, and chained mixin/variable
|
|
35
|
-
* calls) in an `Expression({ parens: true })`.
|
|
36
|
-
*
|
|
37
|
-
* This is purely a parse-time AST shape choice to support Less→Jess conversion.
|
|
38
|
-
*
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
wrapOuterExpressions?: boolean;
|
|
42
|
-
};
|
|
43
|
-
export type CombinedTokenMap = Record<CssTokenType, TokenType> & Record<LessExtraTokenType, TokenType>;
|
|
44
|
-
export type TokenMap = CombinedTokenMap;
|
|
45
|
-
export interface ExtendTarget {
|
|
46
|
-
selector?: Selector;
|
|
47
|
-
target: Selector;
|
|
48
|
-
flag: IToken | undefined;
|
|
49
|
-
}
|
|
50
|
-
export type RuleContext = CssRuleContext & {
|
|
51
|
-
selector?: Selector;
|
|
52
|
-
hasDefault?: boolean;
|
|
53
|
-
allExtended?: boolean;
|
|
54
|
-
isDefinition?: boolean;
|
|
55
|
-
allowAnonymousMixins?: boolean;
|
|
56
|
-
requireAccessorsAfterMixinCall?: boolean;
|
|
57
|
-
inValueList?: boolean;
|
|
58
|
-
allowComma?: boolean;
|
|
59
|
-
node?: Node;
|
|
60
|
-
ruleIsFinished?: boolean;
|
|
61
|
-
sequences?: Array<ComplexSelector | Extend>;
|
|
62
|
-
asReference?: boolean;
|
|
63
|
-
extendTargets?: ExtendTarget[];
|
|
64
|
-
extendNodes?: Extend[];
|
|
65
|
-
inExtend?: boolean;
|
|
66
|
-
wrapInExpression?: boolean;
|
|
67
|
-
parenFrames?: boolean[];
|
|
68
|
-
calcFrames?: number;
|
|
69
|
-
detachedRulesetUsage?: 'function-arg' | 'mixin-arg' | 'default-param';
|
|
70
|
-
inFunctionArgs?: boolean;
|
|
71
|
-
allowMixinCallWithoutAccessor?: boolean;
|
|
72
|
-
startValue?: Node;
|
|
73
|
-
atRulePreludeBareVariableAs?: 'index';
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated LEGACY — Chevrotain-based Less parser engine (extends the deprecated
|
|
77
|
-
* CssRecursiveParser). Superseded by the functional macro grammar in ./grammar.ts.
|
|
78
|
-
* Kept only for benchmarking; TO BE DELETED once the functional parser fully lands.
|
|
79
|
-
*/
|
|
80
|
-
export declare class LessRecursiveParser extends CssRecursiveParser {
|
|
81
|
-
T: TokenMap;
|
|
82
|
-
looseMode: boolean;
|
|
83
|
-
leakyScope: boolean;
|
|
84
|
-
/** Warnings collected during parsing */
|
|
85
|
-
warnings: Array<{
|
|
86
|
-
message: string;
|
|
87
|
-
token?: IToken;
|
|
88
|
-
deprecation?: string;
|
|
89
|
-
}>;
|
|
90
|
-
/** See `LessParserConfig.mathMode` */
|
|
91
|
-
mathMode: MathMode;
|
|
92
|
-
/** See `LessParserConfig.wrapOuterExpressions` */
|
|
93
|
-
wrapOuterExpressions: boolean;
|
|
94
|
-
private processLegacyMSFilterToken;
|
|
95
|
-
constructor(T: TokenMap, config?: LessParserConfig);
|
|
96
|
-
protected processValueToken(token: IToken, ctx?: RuleContext): Node;
|
|
97
|
-
warnDeprecation(message: string, token?: IToken, deprecationId?: string): void;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=lessRecursiveParser.d.ts.map
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AC;IAE9B,OAAO,CAAC,0BAA0B;IAiClC,YACE,CAAC,EAAE,QAAQ,EACX,MAAM,GAAE,gBAAqB,EAmC9B;IAED,UAAmB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAyE3E;IAED,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAE7E;CACF"}
|
package/lib/lessTokens.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type RawModeConfig, type TokenNames } from '@jesscss/css-parser';
|
|
2
|
-
/**
|
|
3
|
-
* Less-specific token names introduced by merges below
|
|
4
|
-
*
|
|
5
|
-
* @todo - Can't we infer this from the tokens?
|
|
6
|
-
*/
|
|
7
|
-
export type LessExtraTokenType = 'Ellipsis' | 'AtKeywordLessExtension' | 'Interpolated' | 'LineComment' | 'PlusAssign' | 'UnderscoreAssign' | 'AnonMixinStart' | 'GtEqAlias' | 'LtEqAlias' | 'Extend' | 'AmpersandLParen' | 'AmpersandTemplateContents' | 'AmpersandTemplateEnd' | 'AllFlag' | 'When' | 'WhenFunctionStart' | 'VarOrProp' | 'NestedReference' | 'PropertyReference' | 'Percent' | 'FormatFunction' | 'IfFunction' | 'BooleanFunction' | 'DefaultGuardIdent' | 'DefaultGuardFunc' | 'JavaScript' | 'InterpolatedIdent' | 'InterpolatedCustomProperty' | 'InterpolatedSelector';
|
|
8
|
-
declare function $preBuildTokens(): {
|
|
9
|
-
modes: any;
|
|
10
|
-
defaultMode: 'Default';
|
|
11
|
-
};
|
|
12
|
-
export declare const Fragments: string[][];
|
|
13
|
-
export declare const Tokens: {
|
|
14
|
-
modes: any;
|
|
15
|
-
defaultMode: 'Default';
|
|
16
|
-
};
|
|
17
|
-
type ReturnTokens = ReturnType<typeof $preBuildTokens>;
|
|
18
|
-
type TokenModes = ReturnTokens['modes'];
|
|
19
|
-
export type LessTokenType = TokenNames<TokenModes[keyof TokenModes]>;
|
|
20
|
-
export declare const lessFragments: () => ReadonlyArray<Readonly<[string, string]>>;
|
|
21
|
-
export declare const lessTokens: () => RawModeConfig;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=lessTokens.d.ts.map
|
package/lib/lessTokens.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lessTokens.d.ts","sourceRoot":"","sources":["../src/lessTokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAGlB,KAAK,UAAU,EAGhB,MAAM,qBAAqB,CAAC;AAM7B;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,wBAAwB,GACxB,cAAc,GACd,aAAa,GACb,YAAY,GACZ,kBAAkB,GAClB,gBAAgB,GAChB,WAAW,GACX,WAAW,GACX,QAAQ,GACR,iBAAiB,GACjB,2BAA2B,GAC3B,sBAAsB,GACtB,SAAS,GACT,MAAM,GACN,mBAAmB,GACnB,WAAW,GACX,iBAAiB,GACjB,mBAAmB,GACnB,SAAS,GACT,gBAAgB,GAChB,YAAY,GACZ,iBAAiB,GACjB,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,4BAA4B,GAC5B,sBAAsB,CAAC;AAU3B,iBAAS,eAAe;WAOb,GAAG;iBACG,SAAS;EA6QzB;AAED,eAAO,MAAM,SAAS,YAAwB,CAAC;AAC/C,eAAO,MAAM,MAAM;WAjRR,GAAG;iBACG,SAAS;CAgRc,CAAC;AAEzC,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AACvD,KAAK,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,UAAU,CAAC,CAAC,CAAC;AAErE,eAAO,MAAM,aAAa,QAAiC,aAAa,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;AACrG,eAAO,MAAM,UAAU,QAA8B,aAAa,CAAC"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import type { RuleContext } from '../lessRecursiveParser.js';
|
|
2
|
-
import type { TokenMap } from '../lessRecursiveParser.js';
|
|
3
|
-
import { Node, AtRuleStatement, DefaultGuard, Paren, Sequence, JsImport, StyleImport } from '@jesscss/core';
|
|
4
|
-
/** Use `any` for `this` to avoid structural incompatibility between LessRecursiveParser and CssRecursiveParser */
|
|
5
|
-
type P = any;
|
|
6
|
-
type ProductionRule = (...args: any[]) => any;
|
|
7
|
-
export declare function guard(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
8
|
-
/**
|
|
9
|
-
* 'or' expression
|
|
10
|
-
* Allows an (outer) comma like historical media queries
|
|
11
|
-
*/
|
|
12
|
-
export declare function guardOr(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
13
|
-
export declare function guardDefault(this: P, T: TokenMap): (ctx?: RuleContext) => DefaultGuard | undefined;
|
|
14
|
-
/**
|
|
15
|
-
* 'and' and 'or' expressions
|
|
16
|
-
*
|
|
17
|
-
* In Media queries level 4, you cannot have
|
|
18
|
-
* `([expr]) or ([expr]) and ([expr])` because
|
|
19
|
-
* of evaluation order ambiguity.
|
|
20
|
-
* However, Less allows it.
|
|
21
|
-
*/
|
|
22
|
-
export declare function guardAnd(this: P, T: TokenMap): ProductionRule;
|
|
23
|
-
export declare function guardInParens(this: P, T: TokenMap): (ctx: RuleContext) => Paren;
|
|
24
|
-
export declare function guardInner(this: P, _T: TokenMap): (ctx?: RuleContext) => any;
|
|
25
|
-
export declare function guardWithConditionValue(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
26
|
-
export declare function guardWithCondition(this: P, T: TokenMap): (ctx?: RuleContext) => void;
|
|
27
|
-
/**
|
|
28
|
-
* Currently, Less only allows a single comparison expression,
|
|
29
|
-
* unlike Media Queries Level 4, which allows a left and right
|
|
30
|
-
* comparison.
|
|
31
|
-
*/
|
|
32
|
-
export declare function comparison(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
33
|
-
/**
|
|
34
|
-
* Less (perhaps unwisely) allows bubbling of normally document-root
|
|
35
|
-
* at-rules, so we need to override CSS here.
|
|
36
|
-
*/
|
|
37
|
-
export declare function innerAtRule(this: P, _T: TokenMap): (ctx?: RuleContext) => Node;
|
|
38
|
-
/**
|
|
39
|
-
* Less override: allow variable reference as the first segment of a layer-name
|
|
40
|
-
* CSS: <ident> ('.' <ident>)*
|
|
41
|
-
* Less: (<var-ref> | <ident>) ('.' <ident>)*
|
|
42
|
-
*/
|
|
43
|
-
export declare function layerName(this: P, T: TokenMap): (ctx?: RuleContext) => Sequence | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Less override: allow variable reference for @keyframes name
|
|
46
|
-
* CSS: Ident | String
|
|
47
|
-
* Less: valueReference | Ident | String
|
|
48
|
-
*/
|
|
49
|
-
export declare function keyframesName(this: P, T: TokenMap): ProductionRule;
|
|
50
|
-
/**
|
|
51
|
-
* One of the rare rules that returns a token, because
|
|
52
|
-
* other rules will transform it differently.
|
|
53
|
-
*/
|
|
54
|
-
export declare function mixinName(this: P, T: TokenMap): ProductionRule;
|
|
55
|
-
/**
|
|
56
|
-
* Used within a value. These can be
|
|
57
|
-
* chained more recursively, unlike
|
|
58
|
-
* Less 1.x-4.x
|
|
59
|
-
* e.g. .mixin1() > .mixin2[@val1].ns() > .sub-mixin[@val2]
|
|
60
|
-
*
|
|
61
|
-
* This production intelligently decides whether to produce a Call or Reference
|
|
62
|
-
* based on whether there are parentheses at the end:
|
|
63
|
-
* - foo: #id; // Reference
|
|
64
|
-
* - foo: .class; // Reference
|
|
65
|
-
* - foo: #id > .scoped; // Reference
|
|
66
|
-
* - foo: #id > .scoped(); // Call
|
|
67
|
-
* - foo: #id[]; // Reference with accessor
|
|
68
|
-
* - foo: #id > .scoped[foo]; // Reference with accessor
|
|
69
|
-
* - foo: #id > .scoped[@ref](); // Call with accessor
|
|
70
|
-
*/
|
|
71
|
-
export declare function mixinReference(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
72
|
-
export declare function mixinArgs(this: P, T: TokenMap): ProductionRule;
|
|
73
|
-
export declare function lookupOrCall(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
74
|
-
/**
|
|
75
|
-
* @see https://lesscss.org/features/#mixins-feature-mixins-parametric-feature
|
|
76
|
-
*
|
|
77
|
-
* This rule is recursive to allow chevrotain-allstar (hopefully) to lookahead
|
|
78
|
-
* and find semi-colon separators vs. commas.
|
|
79
|
-
*/
|
|
80
|
-
export declare function mixinArgList(this: P, T: TokenMap): ProductionRule;
|
|
81
|
-
/**
|
|
82
|
-
* Less is more lenient about at-keywords. See lessTokens.ts for more details.
|
|
83
|
-
*/
|
|
84
|
-
export declare function varName(this: P, T: TokenMap): () => any;
|
|
85
|
-
/**
|
|
86
|
-
* Originally, we were creating alternatives for mixin calls and mixin definitions
|
|
87
|
-
* that could mostly overlap, which led to longer parsing. Instead, we parse
|
|
88
|
-
* as if it could be either, and then we disambiguate at the end.
|
|
89
|
-
*/
|
|
90
|
-
export declare function mixinArg(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
91
|
-
export declare function callArgument(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
92
|
-
/**
|
|
93
|
-
* Override unknownAtRule to handle @-export for stylesheet forwarding.
|
|
94
|
-
* @-export is like @-compose but with forward semantics and no `with` support.
|
|
95
|
-
*/
|
|
96
|
-
export declare function unknownAtRule(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
97
|
-
/**
|
|
98
|
-
* Parse Less v5 script-module imports.
|
|
99
|
-
*
|
|
100
|
-
* Stylesheet composition uses `@compose`; `@use` / `@-use` only become
|
|
101
|
-
* JsImport nodes for script-style paths and aliases like `#less/math`.
|
|
102
|
-
*/
|
|
103
|
-
export declare function useAtRule(this: P, T: TokenMap): (ctx?: RuleContext) => AtRuleStatement | JsImport | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* Parse @-export './foo.jess' [as <namespace>]
|
|
106
|
-
*
|
|
107
|
-
* Creates a StyleImport with forward semantics (members not visible locally but transitive).
|
|
108
|
-
* Does NOT support `with` (unlike @-compose).
|
|
109
|
-
* Participates in evaldTrees caching like @-compose.
|
|
110
|
-
*/
|
|
111
|
-
export declare function exportAtRule(this: P, T: TokenMap): (ctx?: RuleContext) => StyleImport;
|
|
112
|
-
export {};
|
|
113
|
-
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../../src/productions/guards.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAI1D,OAAO,EAEL,IAAI,EAEJ,eAAe,EAGf,YAAY,EACZ,KAAK,EAEL,QAAQ,EAOR,QAAQ,EACR,WAAW,EAIZ,MAAM,eAAe,CAAC;AAGvB,kHAAkH;AAClH,KAAK,CAAC,GAAG,GAAG,CAAC;AACb,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAsF9C,wBAAgB,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE3B,WAAW,SAezB;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE7B,WAAW,SA8BzB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAElC,WAAW,8BAWzB;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,cAAc,CA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AAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,cAAc,CAwFjE;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,aAO3C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE9B,WAAW,SA+DzB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAElC,WAAW,SAgBzB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAEnC,WAAW,SAUzB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE/B,WAAW,4CA0DzB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAElC,WAAW,iBA8CzB"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { stylesheet, main, declarationList, declaration, mediaQuery, mediaCondition, mediaConditionWithoutOr, lessMediaQueryFromString, lessMediaQueryFromReference, lessMediaQueryTail, mediaInParens, mediaFeature, mfValue, mfNonIdentifierValue, wrappedDeclarationList, qualifiedRuleBody, qualifiedRule, mixinOrQualifiedRule } from './root.js';
|
|
2
|
-
export { relativeSelector, forgivingSelectorList, selectorList, compoundSelector, complexSelector, ampersandExtend, extend, simpleSelector, attributeSelector, anonymousMixinDefinition, importAtRule, varDeclarationOrCall, selectorCapture, valueSequence, squareValue } from './selectors.js';
|
|
3
|
-
export { expressionSum, expressionProduct, expressionValue, nthValue, knownFunctions, customValue, innerCustomValue, customBlock, mathProduct, mathSum, calcFunction, ifFunction, booleanFunction, urlFunction, varReference, valueReference, functionCall, functionCallArgs, value, string, mathValue } from './values.js';
|
|
4
|
-
export { guard, guardOr, guardDefault, guardAnd, guardInParens, guardInner, guardWithConditionValue, guardWithCondition, comparison, innerAtRule, layerName, keyframesName, mixinName, mixinReference, mixinArgs, lookupOrCall, mixinArgList, varName, mixinArg, callArgument, unknownAtRule, exportAtRule, useAtRule } from './guards.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/productions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAC1E,uBAAuB,EAAE,wBAAwB,EAAE,2BAA2B,EAC9E,kBAAkB,EAClB,aAAa,EACb,YAAY,EAAE,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EACnE,iBAAiB,EAAE,aAAa,EAAE,oBAAoB,EACvD,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EACzG,MAAM,EAAE,cAAc,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,EACjF,oBAAoB,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAClE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,aAAa,EAAE,iBAAiB,EAAE,eAAe,EAAE,QAAQ,EAAE,cAAc,EAC3E,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAChE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EACpF,YAAY,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EACzD,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EACjE,uBAAuB,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EACpE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAC9D,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAC3D,aAAa,EAAE,YAAY,EAAE,SAAS,EACvC,MAAM,aAAa,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import type { RuleContext } from '../lessRecursiveParser.js';
|
|
2
|
-
import { Node, Ruleset, Paren, CustomDeclaration } from '@jesscss/core';
|
|
3
|
-
import type { TokenMap } from '../lessRecursiveParser.js';
|
|
4
|
-
/** Use `any` for `this` to avoid structural incompatibility between LessRecursiveParser and CssRecursiveParser */
|
|
5
|
-
type P = any;
|
|
6
|
-
type ProductionRule = (...args: any[]) => any;
|
|
7
|
-
export declare function wrapOuterExpressionIfNeeded(this: P, node: Node, ctx: RuleContext | undefined): Node;
|
|
8
|
-
/** Charset moved within `main` (explained in that rule) */
|
|
9
|
-
export declare function stylesheet(this: P, T: TokenMap): ProductionRule;
|
|
10
|
-
/**
|
|
11
|
-
* Starts with a colon, with these conditions
|
|
12
|
-
* 1. It is not preceded by a space or
|
|
13
|
-
* 2. If it is preceded by a space, then it is
|
|
14
|
-
* followed by a space.
|
|
15
|
-
*/
|
|
16
|
-
export declare function main(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
17
|
-
export declare function declarationList(this: P, T: TokenMap): ProductionRule;
|
|
18
|
-
export declare function declaration(this: P, T: TokenMap): (ctx?: RuleContext) => CustomDeclaration | undefined;
|
|
19
|
-
export declare function mediaInParens(this: P, T: TokenMap): (ctx?: RuleContext) => Paren | undefined;
|
|
20
|
-
export declare function mediaQuery(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
21
|
-
export declare function mediaCondition(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
22
|
-
export declare function lessMediaQueryFromString(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
23
|
-
export declare function lessMediaQueryFromReference(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
24
|
-
export declare function lessMediaQueryTail(this: P, T: TokenMap): ProductionRule;
|
|
25
|
-
export declare function mediaConditionWithoutOr(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
26
|
-
export declare function mediaFeature(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
27
|
-
export declare function mfValue(this: P, T: TokenMap): ProductionRule;
|
|
28
|
-
export declare function mfNonIdentifierValue(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
29
|
-
export declare function wrappedDeclarationList(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
30
|
-
export declare function qualifiedRuleBody(this: P, T: TokenMap): (ctx?: RuleContext) => Ruleset | undefined;
|
|
31
|
-
export declare function qualifiedRule(this: P, T: TokenMap): ProductionRule;
|
|
32
|
-
/**
|
|
33
|
-
* In order to not do any backtracking, anything with a class or id selector start
|
|
34
|
-
* will end up here, and everything else will be shunted to the qualified rule.
|
|
35
|
-
*/
|
|
36
|
-
export declare function mixinOrQualifiedRule(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=root.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/productions/root.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAK7D,OAAO,EACL,IAAI,EAQJ,OAAO,EAQP,KAAK,EAgBL,iBAAiB,EAqBlB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAgB,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGxE,kHAAkH;AAClH,KAAK,CAAC,GAAG,GAAG,CAAC;AAGb,KAAK,cAAc,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAyI9C,wBAAgB,2BAA2B,CAAC,IAA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,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,cAAc,CAa5D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE1C,WAAW,SAsCzB;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE5C,WAAW,SAMzB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAEvC,WAAW,yBAyGzB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,cAAc,CA6FlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE1C,WAAW,SAsQzB"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { RuleContext, TokenMap } from '../lessRecursiveParser.js';
|
|
2
|
-
import type { IOrAlt } from 'chevrotain';
|
|
3
|
-
import { Block, AtRuleStatement, AttributeSelector, Mixin, VarDeclaration, Expression, SelectorCapture, ComplexSelector, SelectorList, Nil, Collection, StyleImport } from '@jesscss/core';
|
|
4
|
-
/** Use `any` for `this` to avoid structural incompatibility between LessRecursiveParser and CssRecursiveParser */
|
|
5
|
-
type P = any;
|
|
6
|
-
type Alt = IOrAlt<any>[];
|
|
7
|
-
type AltContext = (ctx?: RuleContext) => Alt;
|
|
8
|
-
type ProductionRule = (...args: any[]) => any;
|
|
9
|
-
export declare function attributeSelector(this: P, T: TokenMap, valueAlt?: AltContext): (ctx?: RuleContext) => AttributeSelector | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* We need to now handle a returned `Extend` node from the complexSelector rule
|
|
12
|
-
*/
|
|
13
|
-
export declare function relativeSelector(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
14
|
-
export declare function forgivingSelectorList(this: P, T: TokenMap): (ctx?: RuleContext) => ComplexSelector | SelectorList | undefined;
|
|
15
|
-
export declare function selectorList(this: P, T: TokenMap): (ctx?: RuleContext) => ComplexSelector | SelectorList | undefined;
|
|
16
|
-
export declare function compoundSelector(this: P, T: TokenMap): ProductionRule;
|
|
17
|
-
/**
|
|
18
|
-
* Extended with :extend
|
|
19
|
-
*/
|
|
20
|
-
export declare function complexSelector(this: P, T: TokenMap): ProductionRule;
|
|
21
|
-
/**
|
|
22
|
-
* &:extend(...) statement ending with a semicolon.
|
|
23
|
-
* This is the only valid standalone extend statement in Less.
|
|
24
|
-
*/
|
|
25
|
-
export declare function ampersandExtend(this: P, T: TokenMap): (ctx?: RuleContext) => Nil | undefined;
|
|
26
|
-
export declare function extend(this: P, T: TokenMap): (ctx?: RuleContext) => void;
|
|
27
|
-
export declare function simpleSelector(this: P, T: TokenMap): ProductionRule;
|
|
28
|
-
export declare function anonymousMixinDefinition(this: P, T: TokenMap): (ctx?: RuleContext) => Collection | Mixin | undefined;
|
|
29
|
-
/**
|
|
30
|
-
* Mostly copied from css importAtRule, but it maps
|
|
31
|
-
* differently to Jess nodes depending on if it's meant
|
|
32
|
-
* to be a Jess-style import or just an at-rule
|
|
33
|
-
*/
|
|
34
|
-
export declare function importAtRule(this: P, T: TokenMap): (ctx?: RuleContext) => AtRuleStatement | StyleImport | undefined;
|
|
35
|
-
/** Less variables */
|
|
36
|
-
export declare function varDeclarationOrCall(this: P, T: TokenMap): (ctx?: RuleContext) => Expression | VarDeclaration | undefined;
|
|
37
|
-
export declare function selectorCapture(this: P, T: TokenMap): (ctx?: RuleContext) => SelectorCapture | undefined;
|
|
38
|
-
export declare function valueSequence(this: P, _T: TokenMap): ProductionRule;
|
|
39
|
-
export declare function squareValue(this: P, T: TokenMap): (ctx?: RuleContext) => Block;
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"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AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAErC,WAAW,qBAqCzB;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE5B,WAAW,UAyCzB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,GAAG,cAAc,CAoInE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE9C,WAAW,oCAuFzB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAElC,WAAW,+CAuGzB;AAED,qBAAqB;AACrB,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAE1C,WAAW,6CAkHzB;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAErC,WAAW,iCA2BzB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,GAAG,cAAc,CAwCnE;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,UAEjC,WAAW,WA8BzB"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { RuleContext, TokenMap } from '../lessRecursiveParser.js';
|
|
2
|
-
import { Any, Block, Sequence, Call, Url, Expression } from '@jesscss/core';
|
|
3
|
-
/** Use `any` for `this` to avoid structural incompatibility between LessRecursiveParser and CssRecursiveParser */
|
|
4
|
-
type P = any;
|
|
5
|
-
type ProductionRule = (...args: any[]) => any;
|
|
6
|
-
export declare function expressionSum(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
7
|
-
export declare function expressionProduct(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
8
|
-
export declare function customValue(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
9
|
-
export declare function innerCustomValue(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
10
|
-
export declare function customBlock(this: P, T: TokenMap): (ctx?: RuleContext) => Block | Sequence | undefined;
|
|
11
|
-
export declare function expressionValue(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
12
|
-
/**
|
|
13
|
-
* Add interpolation
|
|
14
|
-
*/
|
|
15
|
-
export declare function nthValue(this: P, T: TokenMap): (ctx?: RuleContext) => Any<"any"> | undefined;
|
|
16
|
-
export declare function knownFunctions(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
17
|
-
export declare function urlFunction(this: P, T: TokenMap): (ctx?: RuleContext) => Url | undefined;
|
|
18
|
-
/**
|
|
19
|
-
* Override CSS calc() parsing so we can maintain parse-time `calcFrames`.
|
|
20
|
-
* This is the parse-time analogue of `Call.evalNode`'s calcFrames++/--.
|
|
21
|
-
*/
|
|
22
|
-
export declare function calcFunction(this: P, T: TokenMap): (ctx?: RuleContext) => Call;
|
|
23
|
-
export declare function ifFunction(this: P, T: TokenMap): (ctx?: RuleContext) => Call;
|
|
24
|
-
export declare function booleanFunction(this: P, T: TokenMap): (ctx?: RuleContext) => Expression;
|
|
25
|
-
export declare function varReference(this: P, T: TokenMap): ProductionRule;
|
|
26
|
-
export declare function valueReference(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
27
|
-
export declare function functionCall(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
28
|
-
export declare function functionCallArgs(this: P, T: TokenMap): ProductionRule;
|
|
29
|
-
export declare function value(this: P, T: TokenMap): ProductionRule;
|
|
30
|
-
export declare function string(this: P, T: TokenMap): (ctx?: RuleContext) => any;
|
|
31
|
-
export declare function mathValue(this: P, T: TokenMap): ProductionRule;
|
|
32
|
-
export declare function mathProduct(this: P, T: TokenMap): ProductionRule;
|
|
33
|
-
export declare function mathSum(this: P, T: TokenMap): ProductionRule;
|
|
34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esscss/core';
|
|
2
|
-
export declare const createInterpolatedReference: (prefix: string, varName: string, location?: any, context?: any) => Reference;
|
|
3
|
-
export declare const getInterpolatedNode: (name: string, location?: any, context?: any) => Interpolated;
|
|
4
|
-
export declare const normalizeMixinReferenceKey: (selector: Selector) => {
|
|
5
|
-
key: string | string[];
|
|
6
|
-
rawKey: Selector;
|
|
7
|
-
};
|
|
8
|
-
export declare const getInterpolatedOrString: (name: string, location?: any, context?: any) => Interpolated | string;
|
|
9
|
-
//# sourceMappingURL=utils.d.ts.map
|
package/lib/utils.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EAEZ,SAAS,EAIT,KAAK,QAAQ,EACd,MAAM,eAAe,CAAC;AAKvB,eAAO,MAAM,2BAA2B,WAC9B,MAAM,WACL,MAAM,aACJ,GAAG,YACJ,GAAG,KACZ,SAUF,CAAC;AAEF,eAAO,MAAM,mBAAmB,SACxB,MAAM,aACD,GAAG,YACJ,GAAG,KACZ,YAaF,CAAC;AAEF,eAAO,MAAM,0BAA0B,aAAc,QAAQ,KAAG;IAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAsCzG,CAAC;AAGF,eAAO,MAAM,uBAAuB,SAAU,MAAM,aAAa,GAAG,YAAY,GAAG,KAAG,YAAY,GAAG,MAsFpG,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Synchronous debug logging utility for tests.
|
|
3
|
-
* This file is in __tests__ so it won't be included in the public API.
|
|
4
|
-
*/
|
|
5
|
-
import { appendFileSync, existsSync, mkdirSync } from 'fs';
|
|
6
|
-
import { join, dirname } from 'path';
|
|
7
|
-
|
|
8
|
-
// Find monorepo root by looking for pnpm-workspace.yaml
|
|
9
|
-
function findMonorepoRoot(start: string): string {
|
|
10
|
-
let dir = start;
|
|
11
|
-
while (dir !== '/') {
|
|
12
|
-
if (existsSync(join(dir, 'pnpm-workspace.yaml'))) {
|
|
13
|
-
return dir;
|
|
14
|
-
}
|
|
15
|
-
dir = dirname(dir);
|
|
16
|
-
}
|
|
17
|
-
return process.cwd();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const ROOT = findMonorepoRoot(__dirname);
|
|
21
|
-
const LOG_DIR = join(ROOT, '.cursor');
|
|
22
|
-
const LOG_PATH = process.env.DEBUG_LOG_PATH || join(LOG_DIR, 'debug.log');
|
|
23
|
-
|
|
24
|
-
// Ensure directory exists
|
|
25
|
-
try {
|
|
26
|
-
mkdirSync(LOG_DIR, { recursive: true });
|
|
27
|
-
} catch {}
|
|
28
|
-
|
|
29
|
-
export const syncLog = (data: object) => {
|
|
30
|
-
try {
|
|
31
|
-
appendFileSync(LOG_PATH, JSON.stringify(data) + '\n');
|
|
32
|
-
} catch {
|
|
33
|
-
// Ignore errors
|
|
34
|
-
}
|
|
35
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unsafe-type-assertion -- test inspects parser tree internals structurally. */
|
|
2
|
-
import { describe, it, expect } from 'vitest';
|
|
3
|
-
import { Parser } from '../jess.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Bootstrap wall-5: `-(@gutter / 2)` (grid mixin `_grid.less`) threw
|
|
7
|
-
* `Cannot operate on Paren` at render. Root cause was in the grammar: the
|
|
8
|
-
* `-` in `-(…)` matched `GluedParen`'s lookbehind (its char class included a
|
|
9
|
-
* trailing `-`), so the paren body was parsed permissively — the inner `/`
|
|
10
|
-
* stayed a slash-`List` instead of a math `Operation`. `Negative` then tried to
|
|
11
|
-
* `operate` on the unreduced `Paren`, hitting the base `Cannot operate` throw.
|
|
12
|
-
*
|
|
13
|
-
* A standalone `(@g / 2)` (no leading minus) always took the strict `Paren`
|
|
14
|
-
* body and produced an `Operation`. The fix restricts GluedParen's trailing `-`
|
|
15
|
-
* to only match when it terminates an identifier, so a unary-minus paren falls
|
|
16
|
-
* through to the strict math paren.
|
|
17
|
-
*/
|
|
18
|
-
function firstOfType(node: any, type: string): any {
|
|
19
|
-
if (!node || typeof node !== 'object') {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
if (node.type === type) {
|
|
23
|
-
return node;
|
|
24
|
-
}
|
|
25
|
-
const keys = (node.constructor?.childKeys ?? []) as string[];
|
|
26
|
-
for (const k of keys) {
|
|
27
|
-
const v = node[k];
|
|
28
|
-
const arr = Array.isArray(v) ? v : [v];
|
|
29
|
-
for (const it of arr) {
|
|
30
|
-
const found = firstOfType(it, type);
|
|
31
|
-
if (found) {
|
|
32
|
-
return found;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
// Operation stores operands positionally
|
|
37
|
-
if (node.type === 'Operation') {
|
|
38
|
-
return firstOfType(node.left, type) ?? firstOfType(node.right, type);
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
describe('wall5 parse: unary-minus paren keeps math division', () => {
|
|
44
|
-
const parse = (src: string): any => {
|
|
45
|
-
const p = new Parser({ mathMode: 'parens-division' } as never);
|
|
46
|
-
return (p as any).parse(src, 'Stylesheet');
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
it('parses `-(30px / 2)` as Negative(Paren(Operation /)), not a slash-List', () => {
|
|
50
|
-
const res = parse('.x { width: -(30px / 2); }');
|
|
51
|
-
expect(res.errors ?? []).toHaveLength(0);
|
|
52
|
-
const neg = firstOfType(res.tree, 'Negative');
|
|
53
|
-
expect(neg).toBeDefined();
|
|
54
|
-
const paren = firstOfType(neg, 'Paren');
|
|
55
|
-
expect(paren).toBeDefined();
|
|
56
|
-
// The Paren's inner must be a division Operation (in-parens math), not a
|
|
57
|
-
// preserved slash-List.
|
|
58
|
-
expect(paren.value?.type).toBe('Operation');
|
|
59
|
-
expect(paren.value?.operator).toBe('/');
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('keeps the standalone `(30px / 2)` a division Operation too', () => {
|
|
63
|
-
const res = parse('.x { width: (30px / 2); }');
|
|
64
|
-
const paren = firstOfType(res.tree, 'Paren');
|
|
65
|
-
expect(paren?.value?.type).toBe('Operation');
|
|
66
|
-
});
|
|
67
|
-
});
|