@jesscss/less-parser 2.0.0-alpha.4 → 2.0.0-alpha.6

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/package.json CHANGED
@@ -1,22 +1,19 @@
1
1
  {
2
2
  "name": "@jesscss/less-parser",
3
+ "type": "module",
3
4
  "publishConfig": {
4
5
  "access": "public"
5
6
  },
6
- "version": "2.0.0-alpha.4",
7
+ "version": "2.0.0-alpha.6",
7
8
  "description": "Jess LESS parser",
8
- "main": "lib/index.js",
9
+ "main": "lib/index.cjs",
9
10
  "types": "lib/index.d.ts",
10
11
  "exports": {
11
12
  ".": {
12
- "import": "./lib/index.js",
13
13
  "types": "./lib/index.d.ts",
14
- "source": "./src/index.ts"
15
- },
16
- "./*": {
17
- "types": "./lib/*.d.ts",
18
- "import": "./lib/*.js",
19
- "source": "./src/*.ts"
14
+ "source": "./src/index.ts",
15
+ "import": "./lib/index.js",
16
+ "require": "./lib/index.cjs"
20
17
  },
21
18
  "./package.json": "./package.json"
22
19
  },
@@ -24,14 +21,14 @@
24
21
  "lib"
25
22
  ],
26
23
  "dependencies": {
27
- "chevrotain": "^11.0.3",
28
- "chevrotain-allstar": "~0.3.0",
24
+ "chevrotain": "^12.0.0",
29
25
  "known-css-properties": "~0.37.0",
30
- "@jesscss/core": "2.0.0-alpha.4",
31
- "@jesscss/css-parser": "2.0.0-alpha.4"
26
+ "@jesscss/core": "2.0.0-alpha.6",
27
+ "@jesscss/css-parser": "2.0.0-alpha.6"
32
28
  },
33
29
  "devDependencies": {
34
30
  "@types/node": "^18.19.31",
31
+ "tsx": "~4.21.0",
35
32
  "@jesscss/shared": "2.0.0-alpha.1"
36
33
  },
37
34
  "author": "Matthew Dean <matthew-dean@users.noreply.github.com>",
@@ -40,11 +37,16 @@
40
37
  "url": "https://github.com/jesscss/jess/issues"
41
38
  },
42
39
  "homepage": "https://github.com/jesscss/jess#readme",
40
+ "module": "lib/index.js",
43
41
  "scripts": {
44
42
  "ci": "pnpm build && pnpm test",
45
43
  "build": "pnpm compile",
46
- "compile": "tsc -p tsconfig.build.json",
47
- "dev": "tsc -p tsconfig.build.json -w",
44
+ "compile": "tsdown --tsconfig tsconfig.build.json",
45
+ "dev": "tsdown --tsconfig tsconfig.build.json --watch",
46
+ "bench": "tsx test/bench.ts",
47
+ "bench:save": "tsx test/bench.ts --save",
48
+ "bench:memory": "cross-env NODE_OPTIONS=--expose-gc tsx test/bench.ts --memory",
49
+ "bench:heap": "cross-env NODE_OPTIONS=--expose-gc tsx test/bench.ts --heap-snapshot",
48
50
  "test": "cross-env TEST=true vitest --watch=false",
49
51
  "test:coverage": "cross-env TEST=true vitest --coverage",
50
52
  "lint:fix": "eslint --fix '**/*.{js,ts}'",
@@ -1 +0,0 @@
1
- export declare const syncLog: (data: object) => void;
@@ -1,34 +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
- // Find monorepo root by looking for pnpm-workspace.yaml
8
- function findMonorepoRoot(start) {
9
- let dir = start;
10
- while (dir !== '/') {
11
- if (existsSync(join(dir, 'pnpm-workspace.yaml'))) {
12
- return dir;
13
- }
14
- dir = dirname(dir);
15
- }
16
- return process.cwd();
17
- }
18
- const ROOT = findMonorepoRoot(__dirname);
19
- const LOG_DIR = join(ROOT, '.cursor');
20
- const LOG_PATH = process.env.DEBUG_LOG_PATH || join(LOG_DIR, 'debug.log');
21
- // Ensure directory exists
22
- try {
23
- mkdirSync(LOG_DIR, { recursive: true });
24
- }
25
- catch { }
26
- export const syncLog = (data) => {
27
- try {
28
- appendFileSync(LOG_PATH, JSON.stringify(data) + '\n');
29
- }
30
- catch {
31
- // Ignore errors
32
- }
33
- };
34
- //# sourceMappingURL=debug-log.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug-log.js","sourceRoot":"","sources":["../../src/__tests__/debug-log.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAErC,wDAAwD;AACxD,SAAS,gBAAgB,CAAC,KAAa;IACrC,IAAI,GAAG,GAAG,KAAK,CAAC;IAChB,OAAO,GAAG,KAAK,GAAG,EAAE,CAAC;QACnB,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC,EAAE,CAAC;YACjD,OAAO,GAAG,CAAC;QACb,CAAC;QACD,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,MAAM,IAAI,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACzC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAE1E,0BAA0B;AAC1B,IAAI,CAAC;IAAC,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAAC,CAAC;AAAC,MAAM,CAAC,CAAA,CAAC;AAEzD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,EAAE;IACtC,IAAI,CAAC;QACH,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,gBAAgB;IAClB,CAAC;AACH,CAAC,CAAC"}
@@ -1,156 +0,0 @@
1
- import type { TokenVocabulary, TokenType, IToken } from 'chevrotain';
2
- import { type Rule, type RuleContext as CssRuleContext, type CssParserConfig, CssActionsParser, type CssTokenType, type TokenMap as CssTokenMap } from '@jesscss/css-parser';
3
- import { Reference, type MathMode, type Node, type Extend, type ComplexSelector, type Selector } from '@jesscss/core';
4
- import { type LessExtraTokenType } from './lessTokens.js';
5
- export type LessParserConfig = CssParserConfig & {
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
- leakyRules?: 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
- /** Selectors in a selector sequence are extended */
54
- allExtended?: boolean;
55
- /** Mixin definition */
56
- isDefinition?: boolean;
57
- allowAnonymousMixins?: boolean;
58
- requireAccessorsAfterMixinCall?: boolean;
59
- inValueList?: boolean;
60
- allowComma?: boolean;
61
- /** Allow passing in the currently constructed Node */
62
- node?: Node;
63
- ruleIsFinished?: boolean;
64
- sequences?: Array<ComplexSelector | Extend>;
65
- asReference?: boolean;
66
- /** For :extend(...) */
67
- extendTargets?: ExtendTarget[];
68
- extendNodes?: Extend[];
69
- /** Inside an extend production - prevents 'all' from being consumed as selector */
70
- inExtend?: boolean;
71
- /** Inside a custom property value - used for deprecation warnings */
72
- inCustomPropertyValue?: boolean;
73
- /**
74
- * When true, the current production should wrap the *outermost* parsed value
75
- * (if it is a Less expression) in `Expression({ parens: true })`.
76
- *
77
- * This flag should only be set by value-entry productions (e.g. `valueSequence`)
78
- * and must be cleared for nested parsing so Expressions never contain Expressions.
79
- */
80
- wrapInExpression?: boolean;
81
- /**
82
- * Parse-time equivalent of `Context.parenFrames`. This is a boolean stack
83
- * (not a depth counter) because some productions (notably `Call`) intentionally
84
- * push `false` to disable the ambient "in parens" math behavior.
85
- */
86
- parenFrames?: boolean[];
87
- /**
88
- * Parse-time equivalent of `Context.calcFrames`.
89
- */
90
- calcFrames?: number;
91
- /**
92
- * Tracks where a detached ruleset literal is parsed from so we can
93
- * disambiguate Collection vs anonymous mixin semantics.
94
- */
95
- detachedRulesetUsage?: 'function-arg' | 'mixin-arg' | 'default-param';
96
- };
97
- /**
98
- * Unlike the historical Less parser, this parser
99
- * avoids all backtracking
100
- */
101
- export declare class LessActionsParser extends CssActionsParser {
102
- T: CssTokenMap;
103
- looseMode: boolean;
104
- leakyRules: boolean;
105
- /** Warnings collected during parsing */
106
- warnings: Array<{
107
- message: string;
108
- token?: IToken;
109
- deprecation?: string;
110
- }>;
111
- expressionSum: Rule;
112
- expressionProduct: Rule;
113
- expressionValue: Rule;
114
- functionValueList: Rule;
115
- ifFunction: Rule;
116
- booleanFunction: Rule;
117
- wrappedDeclarationList: Rule;
118
- varDeclarationOrCall: Rule;
119
- varName: Rule;
120
- selectorCapture: Rule;
121
- valueReference: Rule;
122
- varReference: Rule;
123
- mixinReference: Rule;
124
- mixinName: Rule;
125
- mixinOrQualifiedRule: Rule;
126
- qualifiedRuleBody: Rule;
127
- mixinArgs: Rule;
128
- mixinArgList: Rule;
129
- mixinArg: Rule;
130
- anonymousMixinDefinition: Rule;
131
- callArgument: Rule;
132
- extend: Rule;
133
- ampersandExtend: Rule;
134
- lookupOrCall: Rule;
135
- comparison: Rule;
136
- guard: Rule;
137
- guardDefault: Rule;
138
- guardOr: Rule;
139
- guardAnd: Rule;
140
- guardInParens: Rule;
141
- guardInner: Rule;
142
- guardWithCondition: Rule;
143
- guardWithConditionValue: Rule;
144
- exportAtRule: Rule;
145
- /** See `LessParserConfig.mathMode` */
146
- mathMode: MathMode;
147
- /** See `LessParserConfig.wrapOuterExpressions` */
148
- wrapOuterExpressions: boolean;
149
- constructor(tokenVocabulary: TokenVocabulary, T: any, config?: LessParserConfig);
150
- protected processValueToken(token: IToken, ctx?: RuleContext): Reference | Node<unknown, import("core/lib/tree/node-base.js").NodeOptions>;
151
- /**
152
- * Emits a deprecation warning during parsing.
153
- * Only collects warnings during the non-recording phase.
154
- */
155
- protected warnDeprecation(message: string, token?: IToken, deprecationId?: string): void;
156
- }
@@ -1,145 +0,0 @@
1
- import { tokenMatcher } from 'chevrotain';
2
- // import { LLStarLookaheadStrategy } from 'chevrotain-allstar'
3
- import { CssActionsParser, productions as cssProductions } from '@jesscss/css-parser';
4
- import { Reference, DefaultGuard, Interpolated, Any, Bool } from '@jesscss/core';
5
- import { getInterpolatedOrString } from './utils.js';
6
- import * as productions from './productions.js';
7
- /**
8
- * Unlike the historical Less parser, this parser
9
- * avoids all backtracking
10
- */
11
- export class LessActionsParser extends CssActionsParser {
12
- looseMode;
13
- leakyRules;
14
- /** Warnings collected during parsing */
15
- warnings = [];
16
- expressionSum;
17
- expressionProduct;
18
- expressionValue;
19
- functionValueList;
20
- booleanFunction;
21
- wrappedDeclarationList;
22
- varDeclarationOrCall;
23
- varName;
24
- selectorCapture;
25
- valueReference;
26
- varReference;
27
- // mixins
28
- mixinReference;
29
- mixinName;
30
- mixinOrQualifiedRule;
31
- qualifiedRuleBody;
32
- // mixinDefinition!: Rule;
33
- // mixinCall!: Rule;
34
- // mixinCallStatement!: Rule;
35
- mixinArgs;
36
- mixinArgList;
37
- mixinArg;
38
- anonymousMixinDefinition;
39
- callArgument;
40
- extend;
41
- ampersandExtend;
42
- // namespaces
43
- // accessors!: Rule;
44
- lookupOrCall;
45
- comparison;
46
- guard;
47
- guardDefault;
48
- guardOr;
49
- guardAnd;
50
- guardInParens;
51
- guardInner;
52
- guardWithCondition;
53
- guardWithConditionValue;
54
- exportAtRule;
55
- /** See `LessParserConfig.mathMode` */
56
- mathMode;
57
- /** See `LessParserConfig.wrapOuterExpressions` */
58
- wrapOuterExpressions;
59
- constructor(tokenVocabulary, T, config = {}) {
60
- let { legacyMode, looseMode = true, leakyRules = true, mathMode = 'parens-division', wrapOuterExpressions = true, ...rest } = config;
61
- legacyMode = legacyMode ?? looseMode;
62
- super(tokenVocabulary, T, { legacyMode, ...rest });
63
- this.looseMode = looseMode;
64
- this.leakyRules = leakyRules;
65
- this.mathMode = mathMode;
66
- this.wrapOuterExpressions = wrapOuterExpressions;
67
- this.warnings = [];
68
- const $ = this;
69
- /** Less extensions */
70
- for (let [key, value] of Object.entries(productions)) {
71
- // @ts-expect-error - this is fine
72
- let rule = value.call(this, T);
73
- if (key in cssProductions) {
74
- this.OVERRIDE_RULE(key, rule);
75
- }
76
- else {
77
- this.RULE(key, rule);
78
- }
79
- }
80
- if ($.constructor === LessActionsParser) {
81
- $.performSelfAnalysis();
82
- }
83
- }
84
- processValueToken(token, ctx) {
85
- let tokenType = token.tokenType;
86
- const TT = this.T;
87
- const tokenName = tokenType.name;
88
- // Check if this is an AtKeyword token (can be consumed via T.AtName category or T.Value category)
89
- // Also check tokenMatcher in case the token type name check doesn't work
90
- if (tokenType.name === 'AtKeyword' || tokenMatcher(token, this.T.AtKeyword)) {
91
- if (!this.RECORDING_PHASE && ctx?.inCustomPropertyValue) {
92
- const atName = token.image;
93
- const ident = token.image.slice(1);
94
- this.warnDeprecation(`"${atName}" in custom property values is treated as literal text, not a variable reference. Use "\@{${ident}}" if you want it to be evaluated.`, token, 'variable-in-unknown-value');
95
- return new Any(token.image, { role: 'any' }, this.getLocationInfo(token), this.context);
96
- }
97
- return new Reference(token.image.slice(1), { type: 'variable' }, this.getLocationInfo(token), this.context);
98
- }
99
- else if (tokenType.name === 'PropertyReference') {
100
- if (!this.RECORDING_PHASE) {
101
- if (ctx?.inCustomPropertyValue) {
102
- const atName = token.image;
103
- const ident = token.image.slice(1);
104
- this.warnDeprecation(`"${atName}" in custom property values is treated as literal text, not a property reference. Use "\${${ident}}" if you want it to be evaluated.`, token, 'property-in-unknown-value');
105
- return new Any(token.image, { role: 'any' }, this.getLocationInfo(token), this.context);
106
- }
107
- }
108
- return super.processValueToken(token, ctx);
109
- }
110
- else if (tokenType === TT['DefaultGuardFunc']) {
111
- return new DefaultGuard(token.image, undefined, this.getLocationInfo(token), this.context);
112
- }
113
- else if (tokenType.name === 'JavaScript'
114
- || (TT['JavaScript'] && tokenMatcher(token, TT['JavaScript']))) {
115
- throw new Error('Inline JavaScript using backticks is not supported. Use @use to import a JavaScript/TypeScript module instead. Script-module documentation is coming soon.');
116
- }
117
- else if (tokenType === TT['InterpolatedIdent']) {
118
- const result = getInterpolatedOrString(token.image, this.getLocationInfo(token), this.context);
119
- if (result instanceof Interpolated) {
120
- return result;
121
- }
122
- else {
123
- return new Any(result, { role: 'ident' }, this.getLocationInfo(token), this.context);
124
- }
125
- }
126
- else if (tokenType === TT['PlainIdent']) {
127
- // Parse true/false as Bool nodes in Less
128
- const image = token.image;
129
- if (image === 'true' || image === 'false') {
130
- return new Bool(image === 'true', undefined, this.getLocationInfo(token), this.context);
131
- }
132
- }
133
- return super.processValueToken(token, ctx);
134
- }
135
- /**
136
- * Emits a deprecation warning during parsing.
137
- * Only collects warnings during the non-recording phase.
138
- */
139
- warnDeprecation(message, token, deprecationId) {
140
- if (!this.RECORDING_PHASE) {
141
- this.warnings.push({ message, token, deprecation: deprecationId });
142
- }
143
- }
144
- }
145
- //# sourceMappingURL=lessActionsParser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lessActionsParser.js","sourceRoot":"","sources":["../src/lessActionsParser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,+DAA+D;AAC/D,OAAO,EAIL,gBAAgB,EAChB,WAAW,IAAI,cAAc,EAG9B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,GAAG,EACH,IAAI,EAML,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAGrD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAC;AAsHhD;;;GAGG;AACH,MAAM,OAAO,iBAAkB,SAAQ,gBAAgB;IAErD,SAAS,CAAU;IACnB,UAAU,CAAU;IACpB,wCAAwC;IACxC,QAAQ,GAAqE,EAAE,CAAC;IAEhF,aAAa,CAAQ;IACrB,iBAAiB,CAAQ;IACzB,eAAe,CAAQ;IACvB,iBAAiB,CAAQ;IAEzB,eAAe,CAAQ;IAEvB,sBAAsB,CAAQ;IAE9B,oBAAoB,CAAQ;IAC5B,OAAO,CAAQ;IACf,eAAe,CAAQ;IACvB,cAAc,CAAQ;IACtB,YAAY,CAAQ;IAEpB,SAAS;IACT,cAAc,CAAQ;IACtB,SAAS,CAAQ;IACjB,oBAAoB,CAAQ;IAC5B,iBAAiB,CAAQ;IACzB,0BAA0B;IAC1B,oBAAoB;IACpB,6BAA6B;IAC7B,SAAS,CAAQ;IACjB,YAAY,CAAQ;IACpB,QAAQ,CAAQ;IAChB,wBAAwB,CAAQ;IAEhC,YAAY,CAAQ;IAEpB,MAAM,CAAQ;IACd,eAAe,CAAQ;IAEvB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,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/F,IAAI,MAAM,YAAY,YAAY,EAAE,CAAC;gBACnC,OAAO,MAAM,CAAC;YAChB,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACvF,CAAC;QACH,CAAC;aAAM,IAAI,SAAS,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;YAC1C,yCAAyC;YACzC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC1B,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;gBAC1C,OAAO,IAAI,IAAI,CAAC,KAAK,KAAK,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YAC1F,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACO,eAAe,CAAC,OAAe,EAAE,KAAc,EAAE,aAAsB;QAC/E,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;CACF"}
@@ -1,3 +0,0 @@
1
- import { CssErrorMessageProvider } from '@jesscss/css-parser';
2
- export declare class LessErrorMessageProvider extends CssErrorMessageProvider {
3
- }
@@ -1,4 +0,0 @@
1
- import { CssErrorMessageProvider } from '@jesscss/css-parser';
2
- export class LessErrorMessageProvider extends CssErrorMessageProvider {
3
- }
4
- //# sourceMappingURL=lessErrorMessageProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lessErrorMessageProvider.js","sourceRoot":"","sources":["../src/lessErrorMessageProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;CAAG"}
@@ -1,22 +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' | 'AmpersandExtend' | '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 {};