refactor: further tweak compiler layers

This commit is contained in:
Evan You
2019-09-17 11:57:25 -04:00
parent 6c14b409ca
commit 132cef9063
31 changed files with 288 additions and 269 deletions

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -1,3 +1,3 @@
export { parse, ParserOptions, TextModes } from './parser'
export { ParserErrorTypes } from './errorTypes'
export * from './ast'
export * from './errorTypes'

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -0,0 +1 @@
// TODO

View File

@@ -35,10 +35,18 @@ export const defaultParserOptions: Required<ParserOptions> = {
getNamespace: () => Namespaces.HTML,
getTextMode: () => TextModes.DATA,
isVoidTag: () => false,
namedCharacterReferences: {},
namedCharacterReferences: {
'gt;': '>',
'lt;': '<',
'amp;': '&',
'apos;': "'",
'quot;': '"'
},
onError(code: ParserErrorTypes, loc: Position): void {
const error: any = new SyntaxError(
`${errorMessages[code]} (${loc.line}:${loc.column})`
`${__DEV__ || !__BROWSER__ ? errorMessages[code] : code} (${loc.line}:${
loc.column
})`
)
error.code = code
error.loc = loc
@@ -658,7 +666,7 @@ function parseTextData(
return text
}
// DATA or RCDATA.
// DATA or RCDATA. Entity decoding required.
const end = context.offset + length
let text: string = ''
@@ -767,7 +775,6 @@ function parseTextData(
}
}
}
return text
}

View File

@@ -0,0 +1 @@
// TODO