Skip to content

Commit bdb3ad2

Browse files
updated: use parser constants
1 parent 1406a34 commit bdb3ad2

File tree

4 files changed

+21
-19
lines changed

4 files changed

+21
-19
lines changed

package-lock.json

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"compiler"
3434
],
3535
"devDependencies": {
36+
"@riotjs/dom-bindings": "^4.3.0",
3637
"chai": "^4.2.0",
3738
"coveralls": "^3.0.6",
3839
"eslint": "^6.4.0",
@@ -55,9 +56,8 @@
5556
},
5657
"homepage": "https://github.com/riot/compiler#readme",
5758
"dependencies": {
58-
"@riotjs/dom-bindings": "^4.3.0",
59-
"@riotjs/parser": "^4.0.3",
60-
"@riotjs/util": "1.0.0",
59+
"@riotjs/parser": "^4.1.0",
60+
"@riotjs/util": "1.1.0",
6161
"acorn": "^7.0.0",
6262
"cssesc": "^3.0.0",
6363
"cumpa": "^1.0.1",

src/generators/template/constants.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// import {IS_BOOLEAN,IS_CUSTOM,IS_RAW,IS_SPREAD,IS_VOID} from '@riotjs/parser/src/constants'
1+
import {constants} from '@riotjs/parser'
22

33
export const BINDING_TYPES = 'bindingTypes'
44
export const EACH_BINDING_TYPE = 'EACH'
@@ -54,11 +54,10 @@ export const SLOT_TAG_NODE_NAME = 'slot'
5454
export const PROGRESS_TAG_NODE_NAME = 'progress'
5555

5656
// Riot Parser constants
57-
// TODO: import these values dynamically
58-
export const IS_RAW_NODE = 'isRaw'
59-
export const IS_VOID_NODE = 'isVoid'
60-
export const IS_CUSTOM_NODE = 'isCustom'
61-
export const IS_BOOLEAN_ATTRIBUTE = 'isBoolean'
62-
export const IS_SPREAD_ATTRIBUTE = 'isSpread'
57+
export const IS_RAW_NODE = constants.IS_RAW
58+
export const IS_VOID_NODE = constants.IS_VOID
59+
export const IS_CUSTOM_NODE = constants.IS_CUSTOM
60+
export const IS_BOOLEAN_ATTRIBUTE = constants.IS_BOOLEAN
61+
export const IS_SPREAD_ATTRIBUTE = constants.IS_SPREAD
6362

6463

src/generators/template/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { isBinaryExpression, isIdentifier, isLiteral, isThisExpression } from '.
2020
import { nullNode, simplePropertyNode } from '../../utils/custom-ast-nodes'
2121
import addLinesOffset from '../../utils/add-lines-offset'
2222
import compose from 'cumpa'
23-
import {createExpression} from './expressions'
23+
import {createExpression} from './expressions/index'
2424
import generateAST from '../../utils/generate-ast'
2525
import unescapeChar from '../../utils/unescape-char'
2626

0 commit comments

Comments
 (0)