Skip to content

Commit 6ec85ae

Browse files
committed
chore: restructure parser files
1 parent c11002f commit 6ec85ae

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

packages/compiler-core/__tests__/parse.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
DirectiveNode
1414
} from '../src/ast'
1515

16-
import { baseParse } from '../src/parser/index'
16+
import { baseParse } from '../src/parser'
1717

1818
/* eslint jest/no-disabled-tests: "off" */
1919

packages/compiler-core/src/compile.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { CompilerOptions } from './options'
2-
import { baseParse } from './parser/index'
2+
import { baseParse } from './parser'
33
import { transform, NodeTransform, DirectiveTransform } from './transform'
44
import { generate, CodegenResult } from './codegen'
55
import { RootNode } from './ast'

packages/compiler-core/src/options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ export interface ParserOptions
2828
* configured by higher-level compilers.
2929
*
3030
* HTML mode adds additional logic for handling special parsing behavior in
31-
* `<script>`, `<style>`,`<title>` and `<html>`, plus SVG and MathML
32-
* namespaces. The logic is handled inside compiler-core for efficiency.
31+
* `<script>`, `<style>`,`<title>` and `<textarea>`.
32+
* The logic is handled inside compiler-core for efficiency.
3333
*
3434
* SFC mode treats content of all root-level tags except `<template>` as plain
3535
* text.

packages/compiler-core/src/parser/index.ts renamed to packages/compiler-core/src/parser.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
TemplateChildNode,
1414
createRoot,
1515
createSimpleExpression
16-
} from '../ast'
17-
import { ParserOptions } from '../options'
16+
} from './ast'
17+
import { ParserOptions } from './options'
1818
import Tokenizer, {
1919
CharCodes,
2020
ParseMode,
@@ -23,22 +23,22 @@ import Tokenizer, {
2323
State,
2424
isWhitespace,
2525
toCharCodes
26-
} from './Tokenizer'
26+
} from './tokenizer'
2727
import {
2828
CompilerCompatOptions,
2929
CompilerDeprecationTypes,
3030
checkCompatEnabled,
3131
isCompatEnabled,
3232
warnDeprecation
33-
} from '../compat/compatConfig'
33+
} from './compat/compatConfig'
3434
import { NO, extend } from '@vue/shared'
3535
import {
3636
ErrorCodes,
3737
createCompilerError,
3838
defaultOnError,
3939
defaultOnWarn
40-
} from '../errors'
41-
import { forAliasRE, isCoreComponent, isStaticArgOf } from '../utils'
40+
} from './errors'
41+
import { forAliasRE, isCoreComponent, isStaticArgOf } from './utils'
4242
import { decodeHTML } from 'entities/lib/decode.js'
4343

4444
type OptionalOptions =

packages/compiler-core/src/parser/Tokenizer.ts renamed to packages/compiler-core/src/tokenizer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2222
IN THE SOFTWARE.
2323
*/
2424

25-
import { ErrorCodes } from '../errors'
26-
import { ElementNode, Position } from '../ast'
25+
import { ErrorCodes } from './errors'
26+
import { ElementNode, Position } from './ast'
2727

2828
/**
2929
* Note: entities is a non-browser-build-only dependency.

0 commit comments

Comments
 (0)