Common Lisp Package: JWACS-TESTS

README:

FUNCTION

Private

COERCE-TOKEN (LEXER TERMINAL)

Force LEXER to interpret the next token as TERMINAL. An error will be raised if that's not actually possible.

COMPILE-EXAMPLES (&KEY (COMPRESS-MODE T) (COMBINE-MODE T))

Compiles all the examples

COMPILE-LANG-TESTS (&KEY DEBUG-MODE)

Compile the language tests

FLAG-EXPECTED-FAILURE (TEST-NAME)

Add a test to the list of expected failures

GENVAR (&OPTIONAL ORIG-NAME)

Generates a unique string that will be our ugly name for variables. When *PRETTY-MODE* is non-NIL and ORIG-NAME is provided, the name will be unique but not all that ugly.

GET-CONSTRUCTOR (STRUCT-OBJECT)

Accept a structure object and return the (likely) name of its constructor. CAVEAT: Assumes that the structure was defined in the same package as its name.

MAKE-KEYWORD (X)

Makes a keyword out of a symbol.

MAKE-LEXER-FUNCTION (LEXER)

Returns a function of 0 arguments that calls NEXT-TOKEN on LEXER whenever it is called. This is normally the function that gets passed into a parser.

NEXT-TOKEN (LEXER)

Returns a token structure containing the next token in the lexing operation represented by LEXER. This token will have a terminal of NIL at end of stream. The next token will be fetched from the unget-stack if that stack is non-empty.

NON-NULL (X)

Return T if X is non-null. This is a convenience function that frees us from the necessity of having to know exactly which non-null value a test should expect.

POSITION-TO-LINE/COLUMN (TEXT INDEX)

Returns a cons cell containing the 1-based row and column for the character at INDEX in TEXT.

PRETTY-STRING (ELM)

Pretty-print ELM to a string value instead of a stream.

READ-ALL-TOKENS (JS-STRING)

Return a list of cons cells representing the tokens of JS-STRING. The CAR of each cell is the type of token, and the CDR is the source text.

SET-CURSOR (LEXER NEW-POS)

Sets the cursor of the lexer to the position specified by NEW-POS

SOURCE-ELEMENT-END (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SOURCE-ELEMENT-START (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

STRUCTURE-SLOTS (OBJECT)

Returns a list of the slot-names of the provided structure object

TEST-PARSE (STR)

Parse STR into a source model representation that does not include source positions

TEST-TRANSFORM (XFORM ELM)

Return the results of applying XFORM to ELM with any administrative source-elements converted to their non-administrative equivalents and with source positions removed.

TOKEN-END (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TOKEN-START (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TOKEN-TERMINAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TOKEN-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TYPE-ANALYZE (ELM)

Perform type analysis on ELM and return the corresponding type-map.

UGLY-PRINT (ELM STREAM)

Outputs the AST to a stream with variables and function names converted to unique identifiers (ie. JW0) and with all formatting removed.

UGLY-STRING (ELM)

Uglyprint LM to a string value instead of a stream

Undocumented

%MAKE-PROPERTY-CYCLE (&OPTIONAL (N 1000))

MAKE-ADD-HANDLER (&KEY ((LABEL DUM3035) NIL) ((START DUM3036) NIL) ((END DUM3037) NIL) ((HANDLER DUM3038) NIL) ((THUNK-BODY DUM3039) NIL))

MAKE-ARRAY-LITERAL (&KEY ((LABEL DUM411) NIL) ((START DUM412) NIL) ((END DUM413) NIL) ((ELEMENTS DUM414) NIL))

MAKE-BINARY-OPERATOR (&KEY ((LABEL DUM917) NIL) ((START DUM918) NIL) ((END DUM919) NIL) ((OP-SYMBOL DUM920) NIL) ((LEFT-ARG DUM921) NIL) ((RIGHT-ARG DUM922) NIL))

MAKE-BREAK-STATEMENT (&KEY ((LABEL DUM1850) NIL) ((START DUM1851) NIL) ((END DUM1852) NIL) ((TARGET-LABEL DUM1853) NIL))

MAKE-CASE-CLAUSE (&KEY ((LABEL DUM2142) NIL) ((START DUM2143) NIL) ((END DUM2144) NIL) ((VALUE DUM2145) NIL) ((BODY DUM2146) NIL))

MAKE-CATCH-CLAUSE (&KEY ((LABEL DUM2457) NIL) ((START DUM2458) NIL) ((END DUM2459) NIL) ((BINDING DUM2460) NIL) ((BODY DUM2461) NIL))

MAKE-COMMA-EXPR (&KEY ((LABEL DUM1074) NIL) ((START DUM1075) NIL) ((END DUM1076) NIL) ((EXPRS DUM1077) NIL))

MAKE-CONDITIONAL (&KEY ((LABEL DUM994) NIL) ((START DUM995) NIL) ((END DUM996) NIL) ((CONDITION DUM997) NIL) ((TRUE-ARG DUM998) NIL) ((FALSE-ARG DUM999) NIL))

MAKE-CONTINUE-STATEMENT (&KEY ((LABEL DUM1777) NIL) ((START DUM1778) NIL) ((END DUM1779) NIL) ((TARGET-LABEL DUM1780) NIL))

MAKE-DEFAULT-CLAUSE (&KEY ((LABEL DUM2220) NIL) ((START DUM2221) NIL) ((END DUM2222) NIL) ((BODY DUM2223) NIL))

MAKE-DO-STATEMENT (&KEY ((LABEL DUM1450) NIL) ((START DUM1451) NIL) ((END DUM1452) NIL) ((CONDITION DUM1453) NIL) ((BODY DUM1454) NIL))

MAKE-FINALLY-CLAUSE (&KEY ((LABEL DUM2534) NIL) ((START DUM2535) NIL) ((END DUM2536) NIL) ((BODY DUM2537) NIL))

MAKE-FN-CALL (&KEY ((LABEL DUM692) NIL) ((START DUM693) NIL) ((END DUM694) NIL) ((FN DUM695) NIL) ((ARGS DUM696) NIL))

MAKE-FOR (&KEY ((LABEL DUM1602) NIL) ((START DUM1603) NIL) ((END DUM1604) NIL) ((INITIALIZER DUM1605) NIL) ((CONDITION DUM1606) NIL) ((STEP DUM1607) NIL) ((BODY DUM1608) NIL))

MAKE-FOR-IN (&KEY ((LABEL DUM1695) NIL) ((START DUM1696) NIL) ((END DUM1697) NIL) ((BINDING DUM1698) NIL) ((COLLECTION DUM1699) NIL) ((BODY DUM1700) NIL))

MAKE-FUNCTION-DECL (&KEY ((LABEL DUM2607) NIL) ((START DUM2608) NIL) ((END DUM2609) NIL) ((NAME DUM2610) NIL) ((PARAMETERS DUM2611) NIL) ((BODY DUM2612) NIL))

MAKE-FUNCTION-EXPRESSION (&KEY ((LABEL DUM2693) NIL) ((START DUM2694) NIL) ((END DUM2695) NIL) ((NAME DUM2696) NIL) ((PARAMETERS DUM2697) NIL) ((BODY DUM2698) NIL))

MAKE-IDENTIFIER (&KEY ((LABEL DUM204) NIL) ((START DUM205) NIL) ((END DUM206) NIL) ((NAME DUM207) NIL))

MAKE-IF-STATEMENT (&KEY ((LABEL DUM1366) NIL) ((START DUM1367) NIL) ((END DUM1368) NIL) ((CONDITION DUM1369) NIL) ((THEN-STATEMENT DUM1370) NIL) ((ELSE-STATEMENT DUM1371) NIL))

MAKE-IMPORT-DECL (&KEY ((LABEL DUM3339) NIL) ((START DUM3340) NIL) ((END DUM3341) NIL) ((TYPE-SYMBOL DUM3342) NIL) ((URIPATH DUM3343) NIL))

MAKE-NEW-EXPR (&KEY ((LABEL DUM614) NIL) ((START DUM615) NIL) ((END DUM616) NIL) ((CONSTRUCTOR DUM617) NIL) ((ARGS DUM618) NIL))

MAKE-NUMERIC-LITERAL (&KEY ((LABEL DUM273) NIL) ((START DUM274) NIL) ((END DUM275) NIL) ((VALUE DUM276) NIL))

MAKE-OBJECT-LITERAL (&KEY ((LABEL DUM478) NIL) ((START DUM479) NIL) ((END DUM480) NIL) ((PROPERTIES DUM481) NIL))

MAKE-PROPERTY-ACCESS (&KEY ((LABEL DUM770) NIL) ((START DUM771) NIL) ((END DUM772) NIL) ((TARGET DUM773) NIL) ((FIELD DUM774) NIL))

MAKE-RE-LITERAL (&KEY ((LABEL DUM545) NIL) ((START DUM546) NIL) ((END DUM547) NIL) ((PATTERN DUM548) NIL) ((OPTIONS DUM549) NIL))

MAKE-REMOVE-HANDLER (&KEY ((LABEL DUM3116) NIL) ((START DUM3117) NIL) ((END DUM3118) NIL) ((HANDLER DUM3119) NIL) ((THUNK-BODY DUM3120) NIL))

MAKE-RESUME-STATEMENT (&KEY ((LABEL DUM3262) NIL) ((START DUM3263) NIL) ((END DUM3264) NIL) ((TARGET DUM3265) NIL) ((ARG DUM3266) NIL))

MAKE-RETURN-STATEMENT (&KEY ((LABEL DUM1923) NIL) ((START DUM1924) NIL) ((END DUM1925) NIL) ((ARG DUM1926) NIL))

MAKE-SOURCE-ELEMENT (&KEY ((LABEL DUM7) NIL) ((START DUM8) NIL) ((END DUM9) NIL))

MAKE-SPECIAL-VALUE (&KEY ((LABEL DUM137) NIL) ((START DUM138) NIL) ((END DUM139) NIL) ((SYMBOL DUM140) NIL))

MAKE-STATEMENT-BLOCK (&KEY ((LABEL DUM1293) NIL) ((START DUM1294) NIL) ((END DUM1295) NIL) ((STATEMENTS DUM1296) NIL))

MAKE-STRING-LITERAL (&KEY ((LABEL DUM342) NIL) ((START DUM343) NIL) ((END DUM344) NIL) ((VALUE DUM345) NIL))

MAKE-SUSPEND-STATEMENT (&KEY ((LABEL DUM3197) NIL) ((START DUM3198) NIL) ((END DUM3199) NIL))

MAKE-SWITCH (&KEY ((LABEL DUM2070) NIL) ((START DUM2071) NIL) ((END DUM2072) NIL) ((VALUE DUM2073) NIL) ((CLAUSES DUM2074) NIL))

MAKE-THROW-STATEMENT (&KEY ((LABEL DUM2293) NIL) ((START DUM2294) NIL) ((END DUM2295) NIL) ((VALUE DUM2296) NIL) ((TARGET DUM2297) NIL))

MAKE-TRY (&KEY ((LABEL DUM2372) NIL) ((START DUM2373) NIL) ((END DUM2374) NIL) ((BODY DUM2375) NIL) ((CATCH-CLAUSE DUM2376) NIL) ((FINALLY-CLAUSE DUM2377) NIL))

MAKE-UNARY-OPERATOR (&KEY ((LABEL DUM845) NIL) ((START DUM846) NIL) ((END DUM847) NIL) ((OP-SYMBOL DUM848) NIL) ((ARG DUM849) NIL))

MAKE-VAR-DECL (&KEY ((LABEL DUM1217) NIL) ((START DUM1218) NIL) ((END DUM1219) NIL) ((NAME DUM1220) NIL) ((INITIALIZER DUM1221) NIL))

MAKE-VAR-DECL-STATEMENT (&KEY ((LABEL DUM1147) NIL) ((START DUM1148) NIL) ((END DUM1149) NIL) ((VAR-DECLS DUM1150) NIL))

MAKE-WHILE (&KEY ((LABEL DUM1525) NIL) ((START DUM1526) NIL) ((END DUM1527) NIL) ((CONDITION DUM1528) NIL) ((BODY DUM1529) NIL))

MAKE-WITH (&KEY ((LABEL DUM1995) NIL) ((START DUM1996) NIL) ((END DUM1997) NIL) ((SCOPE-OBJECT DUM1998) NIL) ((BODY DUM1999) NIL))

SETFSOURCE-ELEMENT-END (NEW-VALUE INSTANCE)

SETFSOURCE-ELEMENT-START (NEW-VALUE INSTANCE)

SETFTOKEN-END (NEW-VALUE INSTANCE)

SETFTOKEN-START (NEW-VALUE INSTANCE)

SETFTOKEN-TERMINAL (NEW-VALUE INSTANCE)

SETFTOKEN-VALUE (NEW-VALUE INSTANCE)

TYPE-NAMES (VALUE-NODE-LIST)

MACRO

Private

EXPECT-ERROR (FORM &OPTIONAL (CONDITION-TYPE 'ERROR))

If evaluating FORM results in an error being raised, returns non-NIL. If the CONDITION-TYPE argument is provided, non-NIL is raised only if an error of that specific type is raised.

IN-LOCAL-SCOPE (&BODY BODY)

Execute BODY with *IN-LOCAL-SCOPE* bound to T

WITH-FRESH-GENVAR (&BODY BODY)

Make sure that GENVAR variable names will start from 0 and that continuation arguments will have a known value

WITH-INDENT (&BODY BODY)

Execute the contained forms with *indent* set one step deeper.

GENERIC-FUNCTION

Private

COMPUTE-TYPES (EXPRESSION-ELM GRAPH &OPTIONAL EXECUTION-CONTEXT)

Returns a list of value-nodes representing a set of possible types for the expression represented by EXPRESSION-ELM based on the type-graph GRAPH. EXPRESSION-ELM is evaluated in the global execution context unless EXECUTION-CONTEXT is specified. EXECUTION-CONTEXT can be either NIL (for global context), the name of a function, or a value-node that represents a function.

EXPLICITLY-TERMINATED-P (ELM TERMINATORS)

Returns non-NIL if ELM explicitly terminates via all control paths. The definition of 'termination' is configurable by the TERMINATORS argument. TERMINATORS is a list containing any or all of :RETURN :THROW :BREAK :CONTINUE :RESUME :SUSPEND. When :RETURN is in TERMINATORS, return statements are considered to terminate a control path; similarly for the other keywords.

FIND-FREE-VARIABLES (ELM)

Return a list of all the free variables in ELM

PRETTY-PRINT (ELM STREAM)

Print source element ELM to stream STREAM as parseable and human-readable text.

TRANSFORM (XFORM ELM)

Accepts a transformation name (symbol) and a source element, and returns a new source element that has been transformed in some way. Methods should /not/ perform destructive updates on the provided source-element.

Undocumented

MAKE-LOAD-FORM (OBJECT &OPTIONAL ENVIRONMENT)

TOKEN (CONDITION)

SLOT-ACCESSOR

Private

Undocumented

ENCOUNTERED-LINE-TERMINATOR (OBJECT)

SETFENCOUNTERED-LINE-TERMINATOR (NEW-VALUE OBJECT)

VARIABLE

Private

*CONT-ID*

An identifier whose name is *cont-name*

*CONT-NAME*

The name of the standard continuation parameter

*ESCAPE-SCRIPT-END-TAGS*

When non-NIL, escape script end tags (for supporting inline scripts

*INDENT*

Current indentation level, in spaces (not steps)

REGEXP-RE

(Lisp) regular expression for recognizing (Javascript) regular expression literals

Undocumented

*GENVAR-COUNTER*

BAR-ID

BAZ-ID

FOO-ID

CLASS

Private

ADD-HANDLER

Indicates that a new handler should be added to the handler stack at this point

CONTINUATION-CALL

A call to a continuation (as opposed to a call to any other sort of function)

CONTINUATION-FUNCTION

A function expression that is used as a continuation

JAVASCRIPT-LEXER

Represents the current state of a lexing operation

LOCATION-NODE

A type graph node that represents a location (eg variable, return value, parameter, intermediate value)

REMOVE-HANDLER

Indicates that a handler should be removed from the top of the handler stack at this point

SOURCE-ELEMENT

A common base type for all source elements

THUNK-FUNCTION

A function expression that is used as a thunk in a boxed trampoline result

TOKEN (CONDITION)

Represents a token returned by the lexer

VALUE-NODE

A node in the type graph that represents a value (object, function, number, etc.)

Undocumented

ARRAY-LITERAL

BINARY-OPERATOR

BREAK-STATEMENT

CASE-CLAUSE

CATCH-CLAUSE

COMMA-EXPR

CONDITIONAL

CONTINUE-STATEMENT

DEFAULT-CLAUSE

DO-STATEMENT

FINALLY-CLAUSE

FN-CALL

FOR

FOR-IN

FUNCTION-DECL

FUNCTION-EXPRESSION

IDENTIFIER

IF-STATEMENT

IMPORT-DECL

NEW-EXPR

NUMERIC-LITERAL

OBJECT-LITERAL

PROPERTY-ACCESS

RE-LITERAL

RESUME-STATEMENT

RETURN-STATEMENT

SPECIAL-VALUE

STATEMENT-BLOCK

STRING-LITERAL

SUSPEND-STATEMENT

SWITCH

THROW-STATEMENT

TRY

UNARY-OPERATOR

VAR-DECL

VAR-DECL-STATEMENT

WHILE

WITH