UNPKG

@roku-road/bright

Version:

Blazing fast parser for BrightScript that gives you ESTree like AST

14 lines (13 loc) 2.59 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const lodash_1 = require("lodash"); const TOKENS = require("./Tokens"); const IGNORED_TOKENS = lodash_1.mapValues(TOKENS, () => []); const visitorKeys = Object.assign({}, IGNORED_TOKENS, { AdditionExpression: ["left", "right", "operator", "trailingComments"], Arguments: ["param"], ArrayElement: ["value", "trailingComments"], ArrayExpression: ["elements", "trailingComments"], AssignmentExpression: ["left", "right", "operator"], BlockStatement: ["body"], CallExpression: ["args", "callee"], Comment: [], ConditionalConst: ["operator", "left", "right"], ConditionalElseIfStatement: ["alternate", "body", "test"], ConditionalElseStatement: ["body"], ConditionalError: ["error"], ConditionalIfStatement: ["alternate", "body", "test", "trailingComments"], DimStatement: ["id", "ArrayExpression"], DotMemberExpression: ["operator", "right"], ElseIfStatement: ["test", "body", "trailingComments"], ElseStatement: ["body", "trailingComments"], EmptyStatement: ["trailingComments"], ForEachStatement: ["countExpression", "counter", "body", "trailingComments"], ForStatement: ["init", "test", "update", "body", "trailingComments"], FunctionDeclaration: [ "id", "ReturnType", "params", "body", "trailingComments", ], FunctionExpression: ["body", "params", "ReturnType", "trailingComments"], GoToStatement: ["id"], Identifier: ["asType", "name"], IfStatement: ["test", "consequent", "alternate", "trailingComments"], LibraryStatement: ["path"], Literal: ["raw", "value"], LogicExpression: ["operator", "left", "right"], MemberExpression: ["computed", "object", "properties"], MultiplicationExpression: ["operator", "left", "right"], NextStatement: ["trailingComments"], ObjectExpression: ["properties", "trailingComments"], Parameter: ["name", "TypeAnnotation", "value"], ParameterList: ["args"], ParenthesisExpression: ["expression"], PostfixExpression: ["operator", "argument"], PrintStatement: ["value", "trailingComments"], Program: ["body"], Property: ["key", "value"], RelationExpression: ["left", "right", "operator"], ReturnStatement: ["argument", "trailingComments"], StopStatement: ["trailingComments"], SubDeclaration: ["id", "params", "body", "ReturnType", "trailingComments"], SubExpression: ["body", "params", "trailingComments"], TypeAnnotation: [], UnTypedIdentifier: ["name"], UnaryExpression: ["operator", "argument"], WhileStatement: ["test", "body"], RokuTryStatement: ["body", "trailingComments", "exception", "onError"] }); exports.visitorKeys = visitorKeys;