How to use the acorn-jsx.keywordTypes function in acorn-jsx

To help you get started, we’ve selected a few acorn-jsx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hitext / hitext / src / temp-generators / lang-js / syntax.js View on Github external
case acorn.tokTypes.bitwiseOR:
                    case acorn.tokTypes.bitwiseXOR:
                    case acorn.tokTypes.bitwiseAND:
                    case acorn.tokTypes.equality:
                    case acorn.tokTypes.relational:
                    case acorn.tokTypes.bitShift:
                    case acorn.tokTypes.plusMin:
                    case acorn.tokTypes.modulo:
                    case acorn.tokTypes.star:
                    case acorn.tokTypes.slash:
                    case acorn.tokTypes.starstar:
                        type = 'operator';
                        break;

                    case acorn.keywordTypes.true:
                    case acorn.keywordTypes.false:
                    case acorn.keywordTypes.null:
                    case acorn.keywordTypes.undefined:
                        type = 'value-keyword';
                        break;

                    default:
                        if (token.type.keyword) {
                            type = 'keyword';
                            break;
                        }

                        // console.log('Unknown type', token);
                }
        }

        if (type) {

acorn-jsx

Modern, fast React.js JSX parser

MIT
Latest version published 3 years ago

Package Health Score

74 / 100
Full package analysis

Similar packages