JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3774
  • Score
    100M100P100Q99889F

JavaScript (ECMAScript) and Objective-J parser with preprocessor.

Package Exports

  • objj-parser
  • objj-parser/acorn
  • objj-parser/util/walk

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (objj-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Objective-J Parser

A tiny, fast JavaScript and/or Objective-J parser with built in preprocessor. Written in JavaScript.

It is extended from the Acorn JavaScript parser by Marijn Haverbeke:

Is used by the Objective-J compiler

It is 100% compatable with JavaScript with two extra options.

1: Turn on 'preprocess' to allow C like preprocess derectives.

It is 100% compatible with the Macros and Conditionals preprocessor directives defined in the GNU C 4.0 Preprocessor User Guide.

Example:

#define MAX(x, y) (x > y ? x : y)
var m1 = MAX(a, b);
var m2 = MAX(14, 20);

Will be parsed as if it was like this:

var m1 = (a > b ? a : b);
var m2 = (14 > 20 ? 14 : 20);

For more info see http://www.cappuccino-project.org/blog/2013/05/the-new-objective-j-2-0-compiler.html

2: Turn on 'objj' to allow Objective-J syntax

See http://www.cappuccino-project.org/learn/objective-j.html

Use from command line with different options: usage: acorn infile [--ecma3|--ecma5] [--strictSemicolons] [--trackComments] [--trackSpaces] [--locations] [--no-objj] [--no-preprocess] [--compact] [--silent] [--help]