How to use the luaparse.ast function in luaparse

To help you get started, we’ve selected a few luaparse 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 ark120202 / babel-lua / packages / lua-types / src / index.js View on Github external
chunk,
  identifier,
  literal,
  tableKey,
  tableKeyString,
  tableValue,
  tableConstructorExpression,
  binaryExpression,
  unaryExpression,
  memberExpression,
  indexExpression,
  callExpression,
  tableCallExpression,
  stringCallExpression,
  comment,
} = luaparse.ast;

export function luaRaw(code) {
  return { type: 'LuaRaw', code };
}

export const stringLiteral = (value, raw) => literal(tokenTypes.StringLiteral, value, raw);
export const numericLiteral = (value, raw) => literal(tokenTypes.NumericLiteral, value, raw);
export const booleanLiteral = (value, raw) => literal(tokenTypes.BooleanLiteral, value, raw);
export const nilLiteral = () => literal(tokenTypes.NilLiteral, null);
export const varargLiteral = () => literal(tokenTypes.VarargLiteral, '...');

luaparse

A Lua parser in JavaScript

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis