diff --git a/docs/SPECIFICATION.html b/docs/SPECIFICATION.html index b63586f..7fb2c2b 100644 --- a/docs/SPECIFICATION.html +++ b/docs/SPECIFICATION.html @@ -92,13 +92,13 @@ ### 3.2 Declarations and assignment -A symbol MAY be declared without a value using `TYPE: name`. Such a declaration records the symbol's static type but does not create a readable runtime binding until an assignment occurs. +A symbol MAY be declared without a value using `TYPE name`. Such a declaration records the symbol's static type but does not create a readable runtime binding until an assignment occurs. The type and name MUST be separated by one or more space characters, and no other character MAY appear between them. -The first assignment to a symbol MUST use a typed form such as `TYPE: name = expression`, with optional spaces around `:` and `=`. Subsequent assignments MAY omit the type annotation, but the symbol's type MUST remain unchanged for the lifetime of that name, including after deletion and re-assignment. +The first assignment to a symbol MUST use a typed form such as `TYPE name = expression`, with one or more spaces between the type and name and optional spaces around `=`. Subsequent assignments MAY omit the type annotation, but the symbol's type MUST remain unchanged for the lifetime of that name, including after deletion and re-assignment. Assignments to undeclared identifiers without a type annotation MUST raise a runtime error. A binding MUST remain allocated until it is deleted with `DEL(name)`. -The built-in `ASSIGN(target, expression)` MUST provide expression-position assignment. The `target` MAY be a plain identifier or an indexed target. If the identifier does not yet exist, the typed form `ASSIGN(TYPE: name, expression)` MUST be used, and that typed form is valid only for plain identifiers. +The built-in `ASSIGN(target, expression)` MUST provide expression-position assignment. The `target` MAY be a plain identifier or an indexed target. If the identifier does not yet exist, the typed form `ASSIGN(TYPE name, expression)` MUST be used, and that typed form is valid only for plain identifiers. Indexed assignment to a tensor MUST use the form `tensor[i1, i2, ..., iN] = expression`. The base symbol MUST already be a `TNS`, the index count MUST match the tensor rank, indices MUST follow the language's one-based and negative-index rules, and the assignment MUST preserve the static element type at the selected position. @@ -120,11 +120,11 @@ ### 3.4 Exception handling -Structured exception handling MUST use either `TRY{ ... }CATCH{ ... }` or `TRY{ ... }CATCH(SYMBOL: name){ ... }`. A `TRY` block MUST be followed immediately by exactly one `CATCH` block, and a standalone `CATCH` is a syntax error. +Structured exception handling MUST use either `TRY{ ... }CATCH{ ... }` or `TRY{ ... }CATCH(SYMBOL name){ ... }`. A `TRY` block MUST be followed immediately by exactly one `CATCH` block, and a standalone `CATCH` is a syntax error. If the `TRY` block completes without a runtime error, the `CATCH` block MUST be skipped. If a runtime error occurs while executing the `TRY` block, execution of that block MUST stop and the matching `CATCH` block MUST execute. -In the parameterized form, `CATCH(SYMBOL: name)` MUST create a temporary `STR` binding named `name` in the handler's lexical environment containing the triggering error message. That temporary binding MUST shadow any existing binding of the same name only for the duration of the `CATCH` block. +In the parameterized form, `CATCH(SYMBOL name)` MUST create a temporary `STR` binding named `name` in the handler's lexical environment containing the triggering error message. That temporary binding MUST shadow any existing binding of the same name only for the duration of the `CATCH` block. `TRY` and `CATCH` MUST intercept interpreter-level errors. Errors raised inside `ASYNC` or other background execution contexts MUST be reported through the runtime's error-reporting mechanisms and MUST NOT synchronously transfer control to a surrounding `CATCH` block in another thread. @@ -378,7 +378,7 @@ #### 4.6.1 Function literals -`FUNC` statements MUST define explicit parameter and return types. The definition MUST use the `FUNC` keyword followed by the return type, a colon, the function name, a comma-separated list of typed parameters in parentheses, and the body in curly braces. +`FUNC` statements MUST define explicit parameter and return types. The definition MUST use the `FUNC` keyword followed by the return type, the function name, a comma-separated list of typed parameters in parentheses, and the body in curly braces. Type annotations in function definitions MUST use the `TYPE name` form, with one or more space characters between the type and the name. Parameters MAY declare a call-time default value. Positional parameters MUST appear before any parameters with defaults. A `RETURN(value)` statement terminates the function; the returned value MUST match the declared return type. Functions with a `MAP`, `TNS`, `FUNC`, or `THR` return type MUST execute an explicit `RETURN` or raise a runtime error. @@ -430,7 +430,7 @@ ### 5.1 Declarations, bindings, and lifetime -A declaration MUST record the symbol's static type without necessarily creating a readable runtime value. A readable binding is created only when a value is first assigned. +A declaration MUST record the symbol's static type without necessarily creating a readable runtime value. A readable binding is created only when a value is first assigned. In all type annotations, the type and name MUST be separated by one or more space characters, and other characters MUST NOT appear between them. Reading an undeclared symbol, a declared-but-never-assigned symbol, or a deleted symbol MUST raise a runtime error. Removing a binding MUST preserve its recorded static type, so any later re-assignment to the same name MUST still match the original type. @@ -647,7 +647,7 @@ The interpreter MUST NOT load `.prex` pointer files. -Runtime extension loading from Prefix source MUST use `EXTEND(EXTENSION: ext)`, defined in [9.1.8](#918-function-and-module-operators). The `ext` specifier MUST exclude the platform filename suffix (`.dll`, `.so`, `.dylib`) and MAY use package semantics with `..`. When `ext` names a package, the loader MUST attempt `ext..init`. +Runtime extension loading from Prefix source MUST use `EXTEND(EXTENSION ext)`, defined in [9.1.8](#918-function-and-module-operators). The `ext` specifier MUST exclude the platform filename suffix (`.dll`, `.so`, `.dylib`) and MAY use package semantics with `..`. When `ext` names a package, the loader MUST attempt `ext..init`. `EXTEND` MUST resolve extension libraries using the same extension search roots used by compiled-library loading: the calling module directory when available, then current working directory, then interpreter `ext/std`, `ext/usr`, `lib/std`, and `lib/usr` roots with bundled roots consulted before user roots. @@ -683,7 +683,7 @@ Built-in operators are pre-defined callable entities provided by the interpreter. They share the same uniform function-call syntax as user-defined functions: `NAME(arg1, arg2, ..., argN)`. The argument list MAY be empty for nullary operators. Arguments MUST be separated by commas; spaces MAY appear freely around commas and parentheses. Each operator has a fixed or variable arity; supplying the wrong number of arguments MUST raise a runtime error. -The subsections below use a type-annotation convention. A union notation such as `INT|FLT` restricts an argument to any one of the listed types. `ANY` denotes any runtime type (`BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`), including extension-defined types when extensions are active, unless the signature narrows the set explicitly. `SYMBOL` is a pseudo-type indicating that the argument MUST be a plain unquoted identifier; such operators receive the symbol name rather than its runtime value. +The subsections below use a type-annotation convention. A type annotation is written as `TYPE name`, where `TYPE` is followed by one or more space characters and then the annotated name. A union notation such as `INT|FLT` restricts an argument to any one of the listed types. `ANY` denotes any runtime type (`BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`), including extension-defined types when extensions are active, unless the signature narrows the set explicitly. `SYMBOL` is a pseudo-type indicating that the argument MUST be a plain unquoted identifier; such operators receive the symbol name rather than its runtime value. `MODULE` is a pseudo-type indicating that the argument MUST be a plain unquoted module identifier or a package-qualified module name using the language's `..` separator. A slash-separated signature such as `ADD/SUB/MUL` denotes a family of distinct operators that share the same argument rules and differ only in the named operation. @@ -697,161 +697,161 @@ #### 9.1.1 Symbol and type operators -- `BOOL: DEL(SYMBOL: name)` = MUST delete the readable runtime binding designated by `name`. Deletion MUST preserve the symbol's recorded static type as defined in [5.1](#51-declarations-bindings-and-lifetime). Deleting an undeclared, never-assigned, or already-deleted symbol MUST raise a runtime error. Deleting a frozen or permanently frozen binding MUST raise a runtime error. On success, `DEL` MUST return `FALSE`. +- `BOOL DEL(SYMBOL name)` = MUST delete the readable runtime binding designated by `name`. Deletion MUST preserve the symbol's recorded static type as defined in [5.1](#51-declarations-bindings-and-lifetime). Deleting an undeclared, never-assigned, or already-deleted symbol MUST raise a runtime error. Deleting a frozen or permanently frozen binding MUST raise a runtime error. On success, `DEL` MUST return `FALSE`. -- `BOOL: DEL(target)` or `BOOL: DEL(target)` = MUST delete the map entry identified by the final key in the chain of map indices. `target` MUST resolve to a `MAP` value and all intermediate lookups MUST resolve to nested `MAP` values; indexing a non-`MAP` MUST raise a runtime error. If an intermediate key does not exist, the operation MUST be a no-op. After deletion the modified map MUST be written back to the environment. `DEL` in indexed form MUST return `FALSE` whether it deleted an entry or completed as a no-op. +- `BOOL DEL(target)` or `BOOL DEL(target)` = MUST delete the map entry identified by the final key in the chain of map indices. `target` MUST resolve to a `MAP` value and all intermediate lookups MUST resolve to nested `MAP` values; indexing a non-`MAP` MUST raise a runtime error. If an intermediate key does not exist, the operation MUST be a no-op. After deletion the modified map MUST be written back to the environment. `DEL` in indexed form MUST return `FALSE` whether it deleted an entry or completed as a no-op. -- `ANY: ASSIGN(target, ANY: value)` = MUST evaluate `value`, assign it to `target`, and return the assigned value. `target` MAY be a plain identifier, a tensor indexed target, or a map indexed target. If a plain identifier has not yet been declared, the typed form `ASSIGN(TYPE: name, value)` MUST be used. The typed form MUST NOT be used with indexed targets. +- `ANY ASSIGN(target, ANY value)` = MUST evaluate `value`, assign it to `target`, and return the assigned value. `target` MAY be a plain identifier, a tensor indexed target, or a map indexed target. If a plain identifier has not yet been declared, the typed form `ASSIGN(TYPE name, value)` MUST be used. The typed form MUST NOT be used with indexed targets. -- `BOOL: EXIST(SYMBOL: name)` = MUST return `TRUE` if `name` resolves to a visible readable binding in the current lexical environment chain and `FALSE` otherwise. +- `BOOL EXIST(SYMBOL name)` = MUST return `TRUE` if `name` resolves to a visible readable binding in the current lexical environment chain and `FALSE` otherwise. -- `BOOL: ISBOOL/ISINT/ISFLT/ISSTR/ISTNS/ISMAP/ISFUNC/ISTHR(ANY: value)` = MUST return `TRUE` if the runtime type of `value` is respectively `BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`, and `FALSE` otherwise. +- `BOOL ISBOOL/ISINT/ISFLT/ISSTR/ISTNS/ISMAP/ISFUNC/ISTHR(ANY value)` = MUST return `TRUE` if the runtime type of `value` is respectively `BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`, and `FALSE` otherwise. -- `STR: TYPE(ANY: value)` = MUST return the runtime type name of `value` as a `STR`. For core language values, the result MUST be one of `BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`. For null or otherwise unrecognized internal values, the result MUST be `NULL`. Extension-defined values MUST report their registered type names. +- `STR TYPE(ANY value)` = MUST return the runtime type name of `value` as a `STR`. For core language values, the result MUST be one of `BOOL`, `INT`, `FLT`, `STR`, `TNS`, `MAP`, `FUNC`, or `THR`. For null or otherwise unrecognized internal values, the result MUST be `NULL`. Extension-defined values MUST report their registered type names. -- `STR: SIGNATURE(SYMBOL: name)` = MUST return a textual signature for `name`. If `name` denotes a user-defined function, the result MUST use the canonical function-signature form of this specification. For any other visible binding, the result MUST be `TYPE: name`. +- `STR SIGNATURE(SYMBOL name)` = MUST return a textual signature for `name`. If `name` denotes a user-defined function, the result MUST use the canonical function-signature form of this specification. For any other visible binding, the result MUST be `TYPE name`. -- `BOOL: FREEZE(SYMBOL: name)`, `BOOL: THAW(SYMBOL: name)`, and `BOOL: PERMAFREEZE(SYMBOL: name)` = MUST modify the mutability state of the binding designated by `name`. `FREEZE` MUST prevent reassignment and deletion until thawed. `PERMAFREEZE` MUST permanently prevent reassignment, deletion, and later thawing. `THAW` MUST clear a non-permanent freeze, MUST raise a runtime error when applied to a permanently frozen binding, and MUST otherwise succeed as a no-op when applied to a binding that is not currently frozen. `FREEZE`, `THAW`, and `PERMAFREEZE` MUST each return `FALSE` on success and MUST raise a runtime error if `name` is undefined. +- `BOOL FREEZE(SYMBOL name)`, `BOOL THAW(SYMBOL name)`, and `BOOL PERMAFREEZE(SYMBOL name)` = MUST modify the mutability state of the binding designated by `name`. `FREEZE` MUST prevent reassignment and deletion until thawed. `PERMAFREEZE` MUST permanently prevent reassignment, deletion, and later thawing. `THAW` MUST clear a non-permanent freeze, MUST raise a runtime error when applied to a permanently frozen binding, and MUST otherwise succeed as a no-op when applied to a binding that is not currently frozen. `FREEZE`, `THAW`, and `PERMAFREEZE` MUST each return `FALSE` on success and MUST raise a runtime error if `name` is undefined. -- `BOOL: FROZEN(SYMBOL: name)` and `BOOL: PERMAFROZEN(SYMBOL: name)` = MUST report the freeze state of `name`. `FROZEN` MUST return `TRUE` for any frozen or permanently frozen binding and `FALSE` otherwise. `PERMAFROZEN` MUST return `TRUE` only for permanently frozen bindings and `FALSE` otherwise. If `name` is undefined, both operators MUST return `FALSE`. +- `BOOL FROZEN(SYMBOL name)` and `BOOL PERMAFROZEN(SYMBOL name)` = MUST report the freeze state of `name`. `FROZEN` MUST return `TRUE` for any frozen or permanently frozen binding and `FALSE` otherwise. `PERMAFROZEN` MUST return `TRUE` only for permanently frozen bindings and `FALSE` otherwise. If `name` is undefined, both operators MUST return `FALSE`. --- #### 9.1.2 Conversion and construction operators -- `BOOL: BOOL(ANY: value)`, `INT: INT(BOOL|INT|FLT|STR: value)`, and `FLT: FLT(BOOL|INT|FLT|STR: value)` = MUST perform explicit scalar conversion. `BOOL(value)` MUST apply the language's truthiness rules and return a `BOOL`. Converting a `FLT` to `INT` MUST truncate toward zero. Converting `BOOL` to `INT` or `FLT` MUST map `TRUE` to `1` or `1.0` and `FALSE` to `0` or `0.0`. Converting a `STR` to `INT` MUST parse a base-prefixed integer literal, and if parsing fails the result MUST follow the string's boolean representation. Converting a `STR` to `FLT` MUST parse a base-prefixed floating-point literal or the special values `INF`, `-INF`, and `NaN`; invalid input MUST raise a runtime error. Passing any other type MUST raise a runtime error. +- `BOOL BOOL(ANY value)`, `INT INT(BOOL|INT|FLT|STR value)`, and `FLT FLT(BOOL|INT|FLT|STR value)` = MUST perform explicit scalar conversion. `BOOL(value)` MUST apply the language's truthiness rules and return a `BOOL`. Converting a `FLT` to `INT` MUST truncate toward zero. Converting `BOOL` to `INT` or `FLT` MUST map `TRUE` to `1` or `1.0` and `FALSE` to `0` or `0.0`. Converting a `STR` to `INT` MUST parse a base-prefixed integer literal, and if parsing fails the result MUST follow the string's boolean representation. Converting a `STR` to `FLT` MUST parse a base-prefixed floating-point literal or the special values `INF`, `-INF`, and `NaN`; invalid input MUST raise a runtime error. Passing any other type MUST raise a runtime error. -- `STR: STR(BOOL|STR|INT|FLT: value)` = MUST convert `value` to a `STR`. For `BOOL`, the result MUST be `TRUE` or `FALSE`. For `INT` and `FLT`, the result MUST be the base-prefixed numeric spelling, except that `INF`, `-INF`, and `NaN` render without a prefix. For `STR`, the result MUST be a copy. +- `STR STR(BOOL|STR|INT|FLT value)` = MUST convert `value` to a `STR`. For `BOOL`, the result MUST be `TRUE` or `FALSE`. For `INT` and `FLT`, the result MUST be the base-prefixed numeric spelling, except that `INF`, `-INF`, and `NaN` render without a prefix. For `STR`, the result MUST be a copy. -- `INT|FLT: CONVERT(INT|FLT: value, INT: base)` and `INT: BASE(INT|FLT: value)` = MUST expose numeric-base manipulation. `CONVERT` MUST return `value` represented in `base`, where `base` MUST be between `2` and `64`, inclusive. `BASE` MUST return the stored base of a numeric value. Asking for an invalid base MUST raise a runtime error. +- `INT|FLT CONVERT(INT|FLT value, INT base)` and `INT BASE(INT|FLT value)` = MUST expose numeric-base manipulation. `CONVERT` MUST return `value` represented in `base`, where `base` MUST be between `2` and `64`, inclusive. `BASE` MUST return the stored base of a numeric value. Asking for an invalid base MUST raise a runtime error. -- `TNS: BYTES(INT: value, STR: endian = "big")` = MUST convert a non-negative integer to a one-dimensional tensor of byte-sized `INT` elements in the range `0` through `0xFF`. `endian` MUST be either `"big"` or `"little"`. `BYTES(0)` MUST return a single zero byte. A negative integer or invalid endianness MUST raise a runtime error. +- `TNS BYTES(INT value, STR endian = "big")` = MUST convert a non-negative integer to a one-dimensional tensor of byte-sized `INT` elements in the range `0` through `0xFF`. `endian` MUST be either `"big"` or `"little"`. `BYTES(0)` MUST return a single zero byte. A negative integer or invalid endianness MUST raise a runtime error. -- `ANY: COPY(ANY: value)` and `ANY: DEEPCOPY(ANY: value)` = MUST return, respectively, a shallow copy and a deep copy of `value`. For primitive scalar values, both operations MAY return an equivalent scalar value. For `TNS` and `MAP`, `COPY` MUST duplicate only the outer container, while `DEEPCOPY` MUST recursively duplicate nested containers so that the result shares no mutable container objects with the input. +- `ANY COPY(ANY value)` and `ANY DEEPCOPY(ANY value)` = MUST return, respectively, a shallow copy and a deep copy of `value`. For primitive scalar values, both operations MAY return an equivalent scalar value. For `TNS` and `MAP`, `COPY` MUST duplicate only the outer container, while `DEEPCOPY` MUST recursively duplicate nested containers so that the result shares no mutable container objects with the input. -- `TNS: TINT/TFLT/TSTR(TNS: tensor)` = MUST convert each scalar element of `tensor` elementwise to `INT`, `FLT`, or `STR`, respectively. If any element cannot be converted, the operator MUST raise a runtime error. +- `TNS TINT/TFLT/TSTR(TNS tensor)` = MUST convert each scalar element of `tensor` elementwise to `INT`, `FLT`, or `STR`, respectively. If any element cannot be converted, the operator MUST raise a runtime error. -- `FLT: ROUND(FLT: value, STR: mode = "floor", INT: ndigits = 0)` = MUST round `value` to `ndigits` places to the right of the radix point, where negative `ndigits` values round to positions to the left of the radix point. Supported modes MUST include `"floor"`, `"ceiling"` and `"ceil"`, `"zero"`, and `"logical"` and `"half-up"`. When exactly two arguments are supplied and the second argument is an `INT`, it MUST be interpreted as `ndigits` and the mode MUST default to `"floor"`. +- `FLT ROUND(FLT value, STR mode = "floor", INT ndigits = 0)` = MUST round `value` to `ndigits` places to the right of the radix point, where negative `ndigits` values round to positions to the left of the radix point. Supported modes MUST include `"floor"`, `"ceiling"` and `"ceil"`, `"zero"`, and `"logical"` and `"half-up"`. When exactly two arguments are supplied and the second argument is an `INT`, it MUST be interpreted as `ndigits` and the mode MUST default to `"floor"`. --- #### 9.1.3 Arithmetic operators -- `INT|FLT: ADD/SUB/MUL/DIV/CDIV/POW/MOD(INT|FLT: a, INT|FLT: b)` = MUST implement, respectively, addition, subtraction, multiplication, division, ceiling division, exponentiation, and remainder. Except where an operator explicitly states otherwise, `a` and `b` MUST have the same numeric type. Division by zero MUST raise a runtime error. +- `INT|FLT ADD/SUB/MUL/DIV/CDIV/POW/MOD(INT|FLT a, INT|FLT b)` = MUST implement, respectively, addition, subtraction, multiplication, division, ceiling division, exponentiation, and remainder. Except where an operator explicitly states otherwise, `a` and `b` MUST have the same numeric type. Division by zero MUST raise a runtime error. -- `INT|FLT: NEG/ABS(INT|FLT: value)` = MUST return the additive inverse or absolute value of `value`, respectively. +- `INT|FLT NEG/ABS(INT|FLT value)` = MUST return the additive inverse or absolute value of `value`, respectively. -- `INT|FLT: GCD/LCM(INT|FLT: a, INT|FLT: b)` = MUST compute the greatest common divisor or least common multiple of `a` and `b`. Mixed `INT` and `FLT` operands MUST be rejected. +- `INT|FLT GCD/LCM(INT|FLT a, INT|FLT b)` = MUST compute the greatest common divisor or least common multiple of `a` and `b`. Mixed `INT` and `FLT` operands MUST be rejected. -- `INT|FLT: ROOT(INT|FLT: x, INT|FLT: n)` = MUST compute the `n`th root of `x`. For `INT` operands, positive `n` MUST produce the greatest integer `r` such that `r^n <= x` when that notion is defined; `n = 0` MUST raise a runtime error; and negative-`n` integer results are valid only where the reciprocal remains an integer. For `FLT` operands, the result MUST be `x^(1/n)`, with negative `x` permitted only when `n` denotes an odd integer. Invalid roots MUST raise a runtime error. +- `INT|FLT ROOT(INT|FLT x, INT|FLT n)` = MUST compute the `n`th root of `x`. For `INT` operands, positive `n` MUST produce the greatest integer `r` such that `r^n <= x` when that notion is defined; `n = 0` MUST raise a runtime error; and negative-`n` integer results are valid only where the reciprocal remains an integer. For `FLT` operands, the result MUST be `x^(1/n)`, with negative `x` permitted only when `n` denotes an odd integer. Invalid roots MUST raise a runtime error. -- `INT: IADD/ISUB/IMUL/IDIV/IPOW/IROOT(INT|FLT: a, INT|FLT: b)` and `FLT: FADD/FSUB/FMUL/FDIV/FPOW/FROOT(INT|FLT: a, INT|FLT: b)` = MUST first coerce both operands to the target numeric type and then perform the corresponding arithmetic operation. Failed coercion MUST raise a runtime error. +- `INT IADD/ISUB/IMUL/IDIV/IPOW/IROOT(INT|FLT a, INT|FLT b)` and `FLT FADD/FSUB/FMUL/FDIV/FPOW/FROOT(INT|FLT a, INT|FLT b)` = MUST first coerce both operands to the target numeric type and then perform the corresponding arithmetic operation. Failed coercion MUST raise a runtime error. -- `INT|FLT: SUM/PROD(INT|FLT: a1, ..., INT|FLT: aN)`, `INT: ISUM/IPROD(INT|FLT: a1, ..., INT|FLT: aN)`, and `FLT: FSUM/FPROD(INT|FLT: a1, ..., INT|FLT: aN)` = MUST compute the corresponding aggregate sum or product across all arguments. The unprefixed forms MUST reject mixed `INT` and `FLT` operands. +- `INT|FLT SUM/PROD(INT|FLT a1, ..., INT|FLT aN)`, `INT ISUM/IPROD(INT|FLT a1, ..., INT|FLT aN)`, and `FLT FSUM/FPROD(INT|FLT a1, ..., INT|FLT aN)` = MUST compute the corresponding aggregate sum or product across all arguments. The unprefixed forms MUST reject mixed `INT` and `FLT` operands. -- `INT|FLT|STR: MAX/MIN(INT|FLT|STR: a1, ..., INT|FLT|STR: aN)` = MUST return the numeric maximum or minimum for numeric arguments and the longest or shortest element for string arguments. Mixing runtime types MUST raise a runtime error. +- `INT|FLT|STR MAX/MIN(INT|FLT|STR a1, ..., INT|FLT|STR aN)` = MUST return the numeric maximum or minimum for numeric arguments and the longest or shortest element for string arguments. Mixing runtime types MUST raise a runtime error. -- `INT|FLT|STR: MAX/MIN(TNS: t1, ..., TNS: tN)` = MUST flatten the supplied tensors and apply the same maximum or minimum rules to their scalar elements. Every encountered element MUST be scalar, and all encountered scalar elements MUST have the same runtime type. +- `INT|FLT|STR MAX/MIN(TNS t1, ..., TNS tN)` = MUST flatten the supplied tensors and apply the same maximum or minimum rules to their scalar elements. Every encountered element MUST be scalar, and all encountered scalar elements MUST have the same runtime type. -- `INT|FLT: LOG(INT|FLT: value)` and `INT: CLOG(INT: value)` = MUST compute, respectively, floor base-2 logarithm and ceiling base-2 logarithm. The argument MUST be strictly positive. +- `INT|FLT LOG(INT|FLT value)` and `INT CLOG(INT value)` = MUST compute, respectively, floor base-2 logarithm and ceiling base-2 logarithm. The argument MUST be strictly positive. -- `INT: ILEN(INT: value)` = MUST return the length of the absolute value of `value` in binary digits. `ILEN(0)` MUST return `1`. +- `INT ILEN(INT value)` = MUST return the length of the absolute value of `value` in binary digits. `ILEN(0)` MUST return `1`. -- `INT: LEN(INT|STR: a1, ..., INT|STR: aN)` = MUST return the number of supplied arguments. Passing a `TNS` or any other unsupported type MUST raise a runtime error. +- `INT LEN(INT|STR a1, ..., INT|STR aN)` = MUST return the number of supplied arguments. Passing a `TNS` or any other unsupported type MUST raise a runtime error. --- #### 9.1.4 Logical and comparison operators -- `BOOL: AND/OR/XOR(ANY: a1, ..., ANY: aN)` and `BOOL: NOT(ANY: value)` = MUST perform boolean conjunction, disjunction, exclusive disjunction, and negation using the language's truthiness rules. +- `BOOL AND/OR/XOR(ANY a1, ..., ANY aN)` and `BOOL NOT(ANY value)` = MUST perform boolean conjunction, disjunction, exclusive disjunction, and negation using the language's truthiness rules. -- `BOOL: ALL(ANY: a1, ..., ANY: aN)` and `BOOL: ANY(ANY: a1, ..., ANY: aN)` = MUST compute boolean conjunction and disjunction across the supplied arguments and return the result as `BOOL`. +- `BOOL ALL(ANY a1, ..., ANY aN)` and `BOOL ANY(ANY a1, ..., ANY aN)` = MUST compute boolean conjunction and disjunction across the supplied arguments and return the result as `BOOL`. -- `BOOL: BOOL(ANY: value)` = MUST return the truthiness of `value` as `FALSE` or `TRUE` according to the boolean rules of the value's runtime type. +- `BOOL BOOL(ANY value)` = MUST return the truthiness of `value` as `FALSE` or `TRUE` according to the boolean rules of the value's runtime type. -- `INT: BAND/BOR/BXOR(INT: a, INT: b)`, `INT: BNOT(INT: value)`, and `INT: SHL/SHR(INT: a, INT: b)` = MUST perform bitwise boolean operations and bit shifting on integer operands. These operators MUST reject `INT` with a radix besides 2. +- `INT BAND/BOR/BXOR(INT a, INT b)`, `INT BNOT(INT value)`, and `INT SHL/SHR(INT a, INT b)` = MUST perform bitwise boolean operations and bit shifting on integer operands. These operators MUST reject `INT` with a radix besides 2. -- `BOOL: EQ/NEQ(ANY: a, ANY: b)` = MUST test equality or inequality using the language's normal value-comparison rules. +- `BOOL EQ/NEQ(ANY a, ANY b)` = MUST test equality or inequality using the language's normal value-comparison rules. -- `BOOL: GT/LT/GTE/LTE(INT|FLT: a, INT|FLT: b)` = MUST perform the corresponding ordered comparison on like-typed numeric operands and return `TRUE` when the relation holds and `FALSE` otherwise. Mixed `INT` and `FLT` comparisons MUST raise a runtime error. +- `BOOL GT/LT/GTE/LTE(INT|FLT a, INT|FLT b)` = MUST perform the corresponding ordered comparison on like-typed numeric operands and return `TRUE` when the relation holds and `FALSE` otherwise. Mixed `INT` and `FLT` comparisons MUST raise a runtime error. --- #### 9.1.5 String operators -- `INT: SLEN(STR: value)` = MUST return the character length of `value`. +- `INT SLEN(STR value)` = MUST return the character length of `value`. -- `STR: UPPER/LOWER(STR: value)` = MUST return the uppercase or lowercase form of `value`, respectively. +- `STR UPPER/LOWER(STR value)` = MUST return the uppercase or lowercase form of `value`, respectively. -- `INT|STR: FLIP(INT|STR: value)` = MUST reverse `value`. For `STR`, the result MUST be the character-reversed string. For `INT`, the result MUST reverse the integer's binary-digit spelling while preserving the sign. +- `INT|STR FLIP(INT|STR value)` = MUST reverse `value`. For `STR`, the result MUST be the character-reversed string. For `INT`, the result MUST reverse the integer's binary-digit spelling while preserving the sign. -- `INT|STR: SLICE(INT|STR: value, INT: start, INT: end)` = MUST slice either an integer or a string. For `STR`, the operator MUST return the inclusive character slice from `start` to `end`, counting from `1`, with negative indices counting from the end. For `INT`, the operator MUST return the corresponding inclusive slice of the integer's digit or bit representation according to the implementation's integer-slicing rules. +- `INT|STR SLICE(INT|STR value, INT start, INT end)` = MUST slice either an integer or a string. For `STR`, the operator MUST return the inclusive character slice from `start` to `end`, counting from `1`, with negative indices counting from the end. For `INT`, the operator MUST return the corresponding inclusive slice of the integer's digit or bit representation according to the implementation's integer-slicing rules. -- `INT|STR: JOIN(INT|STR: a1, ..., INT|STR: aN)` = MUST concatenate all arguments. When all arguments are `STR`, the result MUST be their direct concatenation. When all arguments are `INT`, the result MUST be an integer formed by concatenating their binary-digit spellings. Mixing positive and negative `INT` values or mixing `INT` and `STR` MUST raise a runtime error. +- `INT|STR JOIN(INT|STR a1, ..., INT|STR aN)` = MUST concatenate all arguments. When all arguments are `STR`, the result MUST be their direct concatenation. When all arguments are `INT`, the result MUST be an integer formed by concatenating their binary-digit spellings. Mixing positive and negative `INT` values or mixing `INT` and `STR` MUST raise a runtime error. -- `TNS: SPLIT(STR: value, STR: delimiter = " ")` = MUST split `value` on the exact substring `delimiter` and return the parts as a one-dimensional tensor of `STR`. `delimiter` MUST be non-empty. Consecutive delimiters and trailing delimiters MUST produce empty-string elements. +- `TNS SPLIT(STR value, STR delimiter = " ")` = MUST split `value` on the exact substring `delimiter` and return the parts as a one-dimensional tensor of `STR`. `delimiter` MUST be non-empty. Consecutive delimiters and trailing delimiters MUST produce empty-string elements. -- `STR: STRIP(STR: value, STR: remove)` = MUST return `value` with every occurrence of the non-empty substring `remove` removed. +- `STR STRIP(STR value, STR remove)` = MUST return `value` with every occurrence of the non-empty substring `remove` removed. -- `STR: REPLACE(STR: value, STR: old, STR: new)` = MUST return `value` with every occurrence of the non-empty substring `old` replaced by `new`. +- `STR REPLACE(STR value, STR old, STR new)` = MUST return `value` with every occurrence of the non-empty substring `old` replaced by `new`. --- #### 9.1.6 Tensor operators -- `TNS: TNS(TNS: shape, ANY: value)` and `TNS: TNS(STR: value)` = MUST construct tensors. In the shape form, `shape` MUST be a one-dimensional tensor of positive `INT` lengths and the result MUST be filled with `value`. In the string form, the result MUST be a one-dimensional tensor of one-character `STR` elements. +- `TNS TNS(TNS shape, ANY value)` and `TNS TNS(STR value)` = MUST construct tensors. In the shape form, `shape` MUST be a one-dimensional tensor of positive `INT` lengths and the result MUST be filled with `value`. In the string form, the result MUST be a one-dimensional tensor of one-character `STR` elements. -- `TNS: SHAPE(TNS: tensor)` and `INT: TLEN(TNS: tensor, INT: dim)` = MUST expose tensor shape information. `SHAPE` MUST return a one-dimensional tensor of dimension lengths, and `TLEN` MUST return the length of the specified one-based dimension. An out-of-range dimension MUST raise a runtime error. +- `TNS SHAPE(TNS tensor)` and `INT TLEN(TNS tensor, INT dim)` = MUST expose tensor shape information. `SHAPE` MUST return a one-dimensional tensor of dimension lengths, and `TLEN` MUST return the length of the specified one-based dimension. An out-of-range dimension MUST raise a runtime error. -- `TNS: TFLIP(TNS: tensor, INT: dim)` = MUST return a new tensor whose elements are reversed along the one-based dimension `dim`. +- `TNS TFLIP(TNS tensor, INT dim)` = MUST return a new tensor whose elements are reversed along the one-based dimension `dim`. -- `TNS: SCAT(TNS: src, TNS: dst, TNS: ind)` = MUST return a copy of `dst` with a rectangular slice replaced by `src`. `ind` MUST encode one inclusive `[lo, hi]` range pair per destination dimension. The selected slice shape MUST exactly match the shape of `src`, and out-of-range indices MUST raise a runtime error. +- `TNS SCAT(TNS src, TNS dst, TNS ind)` = MUST return a copy of `dst` with a rectangular slice replaced by `src`. `ind` MUST encode one inclusive `[lo, hi]` range pair per destination dimension. The selected slice shape MUST exactly match the shape of `src`, and out-of-range indices MUST raise a runtime error. -- `TNS: APPEND(ANY: elem, TNS: tns)` = MUST return a new one-dimensional tensor equal to `tns` with `elem` appended as the last element. If `tns` is not one-dimensional the operator MUST raise a runtime error. Prefix `TNS` values MAY contain heterogeneous element types; `APPEND` therefore MUST accept any element type and simply append it as the last element. +- `TNS APPEND(ANY elem, TNS tns)` = MUST return a new one-dimensional tensor equal to `tns` with `elem` appended as the last element. If `tns` is not one-dimensional the operator MUST raise a runtime error. Prefix `TNS` values MAY contain heterogeneous element types; `APPEND` therefore MUST accept any element type and simply append it as the last element. -- `TNS: FILL(TNS: tensor, ANY: value)` = MUST return a new tensor with the same shape as `tensor`, filled with `value`. `value` MUST satisfy the target tensor's element-type constraints. +- `TNS FILL(TNS tensor, ANY value)` = MUST return a new tensor with the same shape as `tensor`, filled with `value`. `value` MUST satisfy the target tensor's element-type constraints. -- `TNS: CONV(TNS: x, TNS: kernel, INT: stride_w = 1, INT: stride_h = 1, INT: pad_w = 0, INT: pad_h = 0, TNS: bias = [])` = MUST support both the legacy two-argument N-dimensional convolution form and the extended 2-D multi-output form. In the legacy form, `kernel` MUST have the same rank as `x`, every kernel dimension length MUST be odd, boundary sampling MUST clamp to the nearest valid index, and the result MUST have the same shape as `x`. In the extended form, when any keyword argument is supplied and `x` is rank 3 while `kernel` is rank 4 with shape `[kw, kh, in_c, out_c]`, the operator MUST perform 2-D convolution with the given strides, explicit zero padding, and optional per-output-channel bias, returning shape `[out_w, out_h, out_c]`. Where both inputs are `INT`, the output MUST be `INT`; otherwise it MUST be `FLT`. +- `TNS CONV(TNS x, TNS kernel, INT stride_w = 1, INT stride_h = 1, INT pad_w = 0, INT pad_h = 0, TNS bias = [])` = MUST support both the legacy two-argument N-dimensional convolution form and the extended 2-D multi-output form. In the legacy form, `kernel` MUST have the same rank as `x`, every kernel dimension length MUST be odd, boundary sampling MUST clamp to the nearest valid index, and the result MUST have the same shape as `x`. In the extended form, when any keyword argument is supplied and `x` is rank 3 while `kernel` is rank 4 with shape `[kw, kh, in_c, out_c]`, the operator MUST perform 2-D convolution with the given strides, explicit zero padding, and optional per-output-channel bias, returning shape `[out_w, out_h, out_c]`. Where both inputs are `INT`, the output MUST be `INT`; otherwise it MUST be `FLT`. -- `BOOL: IN(ANY: value, TNS: tensor)` = MUST return `TRUE` if any tensor element is equal to `value` and `FALSE` otherwise. +- `BOOL IN(ANY value, TNS tensor)` = MUST return `TRUE` if any tensor element is equal to `value` and `FALSE` otherwise. -- `TNS: MADD/MSUB/MMUL/MDIV(TNS: x, TNS: y)` = MUST perform elementwise tensor-tensor arithmetic. The input shapes MUST match exactly, the element types MUST be uniformly numeric and mutually compatible, and division by zero MUST raise a runtime error. +- `TNS MADD/MSUB/MMUL/MDIV(TNS x, TNS y)` = MUST perform elementwise tensor-tensor arithmetic. The input shapes MUST match exactly, the element types MUST be uniformly numeric and mutually compatible, and division by zero MUST raise a runtime error. -- `TNS: MSUM/MPROD(TNS: t1, ..., TNS: tN)` = MUST perform elementwise sum or product across tensors of identical shape and mutually compatible numeric element type. +- `TNS MSUM/MPROD(TNS t1, ..., TNS tN)` = MUST perform elementwise sum or product across tensors of identical shape and mutually compatible numeric element type. -- `TNS: TADD/TSUB/TMUL/TDIV/TPOW(TNS: tensor, INT|FLT: scalar)` = MUST perform tensor-scalar arithmetic. All tensor elements and the scalar MUST share the same numeric type, except where a specific operator explicitly permits widening. Division by zero MUST raise a runtime error. +- `TNS TADD/TSUB/TMUL/TDIV/TPOW(TNS tensor, INT|FLT scalar)` = MUST perform tensor-scalar arithmetic. All tensor elements and the scalar MUST share the same numeric type, except where a specific operator explicitly permits widening. Division by zero MUST raise a runtime error. --- #### 9.1.7 Map operators -- `TNS: KEYS(MAP: map)` and `TNS: VALUES(MAP: map)` = MUST return one-dimensional tensors containing, respectively, the keys and values of `map` in insertion order. +- `TNS KEYS(MAP map)` and `TNS VALUES(MAP map)` = MUST return one-dimensional tensors containing, respectively, the keys and values of `map` in insertion order. -- `BOOL: KEYIN(INT|FLT|STR: key, MAP: map)` and `BOOL: VALUEIN(ANY: value, MAP: map)` = MUST return `TRUE` when the given key or value occurs in `map` and `FALSE` otherwise. +- `BOOL KEYIN(INT|FLT|STR key, MAP map)` and `BOOL VALUEIN(ANY value, MAP map)` = MUST return `TRUE` when the given key or value occurs in `map` and `FALSE` otherwise. -- `BOOL: MATCH(MAP: map, MAP: template, INT: typing = 0, INT: recurse = 0, INT: shape = 0)` = MUST return `TRUE` if every key in `template` is present in `map`. When `typing` is non-zero, the corresponding stored value types MUST also match. When `shape` is non-zero, corresponding tensor values MUST additionally have identical shapes. When `recurse` is non-zero, the same rules MUST be applied recursively to nested maps. Any failed condition MUST produce `FALSE` rather than raising an error. +- `BOOL MATCH(MAP map, MAP template, INT typing = 0, INT recurse = 0, INT shape = 0)` = MUST return `TRUE` if every key in `template` is present in `map`. When `typing` is non-zero, the corresponding stored value types MUST also match. When `shape` is non-zero, corresponding tensor values MUST additionally have identical shapes. When `recurse` is non-zero, the same rules MUST be applied recursively to nested maps. Any failed condition MUST produce `FALSE` rather than raising an error. -- `MAP: INV(MAP: map)` = MUST return a new map whose keys and values are reversed. Every value in `map` MUST be a scalar key type (`INT`, `FLT`, or `STR`), and duplicate values MUST raise a runtime error. +- `MAP INV(MAP map)` = MUST return a new map whose keys and values are reversed. Every value in `map` MUST be a scalar key type (`INT`, `FLT`, or `STR`), and duplicate values MUST raise a runtime error. --- #### 9.1.8 Function and module operators -- `RUN(STR: source)` = MUST parse and execute `source` as Prefix code in the caller's current lexical environment. Parse failure or runtime failure inside the executed source MUST raise a runtime error. +- `RUN(STR source)` = MUST parse and execute `source` as Prefix code in the caller's current lexical environment. Parse failure or runtime failure inside the executed source MUST raise a runtime error. -- `BOOL: ASSERT(ANY: value)` = MUST raise a runtime error if `value` is falsey according to the language's truthiness rules. On success, it MUST return `TRUE`. +- `BOOL ASSERT(ANY value)` = MUST raise a runtime error if `value` is falsey according to the language's truthiness rules. On success, it MUST return `TRUE`. -- `BOOL: REFUTE(~BOOL: cond)` = MUST raise a runtime error if `cond` is truthy according to the language's truthiness rules. On success, it MUST return `TRUE`. +- `BOOL REFUTE(~BOOL cond)` = MUST raise a runtime error if `cond` is truthy according to the language's truthiness rules. On success, it MUST return `TRUE`. -- `THROW()` or `THROW(INT|STR: a1, ..., INT|STR: aN)` = MUST raise a runtime error. When one or more arguments are supplied, the error message MUST be formed by concatenating those arguments using the same rendering rules as `PRINT`, but without a trailing newline. When no arguments are supplied, the error message MUST be `"Exception thrown"`. +- `THROW()` or `THROW(INT|STR a1, ..., INT|STR aN)` = MUST raise a runtime error. When one or more arguments are supplied, the error message MUST be formed by concatenating those arguments using the same rendering rules as `PRINT`, but without a trailing newline. When no arguments are supplied, the error message MUST be `"Exception thrown"`. -- `BOOL: MAIN()` = MUST return `TRUE` when the call site is in the primary program source and `FALSE` when the call site is executing from imported module code. The result MUST depend on the source location of the call expression rather than on the dynamic caller stack. +- `BOOL MAIN()` = MUST return `TRUE` when the call site is in the primary program source and `FALSE` when the call site is executing from imported module code. The result MUST depend on the source location of the call expression rather than on the dynamic caller stack. -- `BOOL: EXTEND(EXTENSION: ext)` = MUST load the compiled extension designated by `ext`. The specifier `ext` MUST exclude the platform filename suffix and MAY use package-style `..` separators. If `ext` resolves to a package, the loader MUST attempt `ext..init`. Relative extension names MUST resolve using the calling module's source directory when available, then the current working directory, then the configured extension roots `ext/std`, `ext/usr`, `lib/std`, and `lib/usr` (with bundled roots searched before user roots). Repeating an `EXTEND` request for an already-loaded extension exposure MUST be idempotent. On success, `EXTEND` MUST return `FALSE`. +- `BOOL EXTEND(EXTENSION ext)` = MUST load the compiled extension designated by `ext`. The specifier `ext` MUST exclude the platform filename suffix and MAY use package-style `..` separators. If `ext` resolves to a package, the loader MUST attempt `ext..init`. Relative extension names MUST resolve using the calling module's source directory when available, then the current working directory, then the configured extension roots `ext/std`, `ext/usr`, `lib/std`, and `lib/usr` (with bundled roots searched before user roots). Repeating an `EXTEND` request for an already-loaded extension exposure MUST be idempotent. On success, `EXTEND` MUST return `FALSE`. Operators registered with the module-restriction flag (for example `PREFIX_EXTENSION_MODULE_RESTRICTED`) MUST be exposed only under the extending module's namespace. Importing that module MUST expose the extension namespace qualifier under the importing module's qualified name. `PREFIX_EXTENSION_ASMODULE` by itself MUST NOT restrict an operator to the extending module's namespace or cause that qualified exposure. Extension side effects outside operator registration (for example process-global hooks or host-side state) remain global. -- `BOOL: IMPORT(MODULE: name)` or `BOOL: IMPORT(MODULE: name, SYMBOL: alias)` = MUST load the named module, execute it in its own top-level environment on first import, cache that environment, and expose its bindings under the module name or the supplied alias. The implementation MUST search the referring source directory first, then bundled library locations as described in [8.2](#82-extensions-and-extend), [10](#10-standard-library), and the language's module-search rules. Re-importing an already loaded module MUST reuse the cached module namespace rather than re-executing the module. +- `BOOL IMPORT(MODULE name)` or `BOOL IMPORT(MODULE name, SYMBOL alias)` = MUST load the named module, execute it in its own top-level environment on first import, cache that environment, and expose its bindings under the module name or the supplied alias. The implementation MUST search the referring source directory first, then bundled library locations as described in [8.2](#82-extensions-and-extend), [10](#10-standard-library), and the language's module-search rules. Re-importing an already loaded module MUST reuse the cached module namespace rather than re-executing the module. Prefix package namespaces MUST use `..` as the package separator. The canonical form is `package..subpackage..module`. When `IMPORT(pkg)` is used and a package directory named `pkg` exists, the interpreter MUST prefer package resolution and attempt to load `pkg/init.pre`. If that package directory exists but contains no `init.pre`, the import MUST raise a runtime error. When `IMPORT(pkg..mod)` is used, the interpreter MUST resolve to `pkg/mod.pre`. If both a package directory and a same-named module file exist in the same search location, the package MUST take precedence. @@ -861,9 +861,9 @@ Module import MUST NOT implicitly load companion extension pointer files. Runtime extensions for module code MUST be loaded explicitly via `EXTEND` inside the module. On success, `IMPORT` MUST return `FALSE`. -- `BOOL: IMPORT_PATH(STR: path)` or `BOOL: IMPORT_PATH(STR: path, SYMBOL: alias)` = MUST load a module from an explicit filesystem path and expose it under `alias` or, if omitted, under a basename-derived module name. The argument MUST at minimum accept an absolute path to a `.pre` source file. The module's basename, excluding the `.pre` suffix, MUST be used as the default qualified module name when no alias is supplied. The loaded module MUST otherwise obey the same isolation, caching, and exposure rules as `IMPORT`. Runtime extensions for that module MUST be loaded explicitly via `EXTEND`. On success, `IMPORT_PATH` MUST return `FALSE`. +- `BOOL IMPORT_PATH(STR path)` or `BOOL IMPORT_PATH(STR path, SYMBOL alias)` = MUST load a module from an explicit filesystem path and expose it under `alias` or, if omitted, under a basename-derived module name. The argument MUST at minimum accept an absolute path to a `.pre` source file. The module's basename, excluding the `.pre` suffix, MUST be used as the default qualified module name when no alias is supplied. The loaded module MUST otherwise obey the same isolation, caching, and exposure rules as `IMPORT`. Runtime extensions for that module MUST be loaded explicitly via `EXTEND`. On success, `IMPORT_PATH` MUST return `FALSE`. -- `BOOL: EXPORT(SYMBOL: symbol, MODULE: module)` = MUST copy the caller's current binding for `symbol` into the namespace of the already imported module designated by `module`, making the exported binding available through that module's qualified namespace. `EXPORT` MUST return `FALSE` on success and MUST raise a runtime error if `module` is not currently imported. +- `BOOL EXPORT(SYMBOL symbol, MODULE module)` = MUST copy the caller's current binding for `symbol` into the namespace of the already imported module designated by `module`, making the exported binding available through that module's qualified namespace. `EXPORT` MUST return `FALSE` on success and MUST raise a runtime error if `module` is not currently imported. --- @@ -871,19 +871,19 @@ The expression form `ASYNC{ ... }` and the statement form `THR(symbol){ ... }` are defined in [3.6](#36-asynchronous-execution-and-threads). The operators in this subsection act on `THR` handles. -- `BOOL: PARALLEL(TNS: functions)` or `BOOL: PARALLEL(FUNC: f1, FUNC: f2, ..., FUNC: fN)` = MUST invoke each supplied function concurrently with no arguments, wait for all invocations to complete, and return `FALSE` on success. Any non-`FUNC` argument or any worker failure MUST raise a runtime error. +- `BOOL PARALLEL(TNS functions)` or `BOOL PARALLEL(FUNC f1, FUNC f2, ..., FUNC fN)` = MUST invoke each supplied function concurrently with no arguments, wait for all invocations to complete, and return `FALSE` on success. Any non-`FUNC` argument or any worker failure MUST raise a runtime error. -- `THR: AWAIT(THR: thread)` = MUST block until `thread` has finished and then return the same thread handle. +- `THR AWAIT(THR thread)` = MUST block until `thread` has finished and then return the same thread handle. -- `THR: PAUSE(THR: thread, FLT: seconds = -1)` = MUST pause `thread`. If `seconds` is supplied and is non-negative, the runtime MUST automatically resume the thread after that duration. Pausing a thread that is already paused MUST raise a runtime error. +- `THR PAUSE(THR thread, FLT seconds = -1)` = MUST pause `thread`. If `seconds` is supplied and is non-negative, the runtime MUST automatically resume the thread after that duration. Pausing a thread that is already paused MUST raise a runtime error. -- `THR: RESUME(THR: thread)` = MUST resume a paused thread. Resuming a thread that is not paused MUST raise a runtime error. +- `THR RESUME(THR thread)` = MUST resume a paused thread. Resuming a thread that is not paused MUST raise a runtime error. -- `BOOL: PAUSED(THR: thread)` = MUST return `TRUE` when `thread` is paused and `FALSE` otherwise. +- `BOOL PAUSED(THR thread)` = MUST return `TRUE` when `thread` is paused and `FALSE` otherwise. -- `THR: STOP(THR: thread)` = MUST cooperatively stop `thread`, mark it finished, and return the resulting handle. +- `THR STOP(THR thread)` = MUST cooperatively stop `thread`, mark it finished, and return the resulting handle. -- `THR: RESTART(THR: thread)` = MUST reinitialize `thread` and begin its execution again, returning the restarted handle. +- `THR RESTART(THR thread)` = MUST reinitialize `thread` and begin its execution again, returning the restarted handle. --- @@ -982,43 +982,43 @@ The operator semantics that use this format are defined next. -- `STR: SER(ANY: value)` = MUST serialize `value` to a `STR` containing a single JSON text that conforms to the encoding rules and schema described above. `SER` returns that `STR` on success. +- `STR SER(ANY value)` = MUST serialize `value` to a `STR` containing a single JSON text that conforms to the encoding rules and schema described above. `SER` returns that `STR` on success. -- `ANY: UNSER(STR: text)` = MUST parse `text` as JSON and reconstruct the runtime value according to the schema above. `UNSER` MUST raise a runtime error for invalid JSON, invalid/missing fields, invalid numeric spellings, unsupported key types for `MAP`, unknown discriminators that cannot be reconstructed, or other structural violations. +- `ANY UNSER(STR text)` = MUST parse `text` as JSON and reconstruct the runtime value according to the schema above. `UNSER` MUST raise a runtime error for invalid JSON, invalid/missing fields, invalid numeric spellings, unsupported key types for `MAP`, unknown discriminators that cannot be reconstructed, or other structural violations. --- #### 9.1.11 File and host operators -- `STR: READFILE(STR: path, STR: coding = "UTF-8")` = MUST read the filesystem object at `path` and return its contents as a `STR`. Supported `coding` values MUST include `UTF-8`, `UTF-8 BOM`, `UTF-16 LE`, `UTF-16 BE`, `ANSI`, `binary`, and `hexadecimal`, along with the aliases `bin` for `binary` and `hex` for `hexadecimal`. Coding names MUST be matched case-insensitively. Text decoders MUST tolerate invalid data using replacement semantics. `UTF-8` MUST accept and strip a BOM if present. `ANSI` MUST map to Windows-1252 on Windows and Latin-1 on other hosts. `binary` MUST return an 8-bit-per-byte bitstring, and `hexadecimal` MUST return lowercase hexadecimal text. Read failure MUST raise a runtime error. +- `STR READFILE(STR path, STR coding = "UTF-8")` = MUST read the filesystem object at `path` and return its contents as a `STR`. Supported `coding` values MUST include `UTF-8`, `UTF-8 BOM`, `UTF-16 LE`, `UTF-16 BE`, `ANSI`, `binary`, and `hexadecimal`, along with the aliases `bin` for `binary` and `hex` for `hexadecimal`. Coding names MUST be matched case-insensitively. Text decoders MUST tolerate invalid data using replacement semantics. `UTF-8` MUST accept and strip a BOM if present. `ANSI` MUST map to Windows-1252 on Windows and Latin-1 on other hosts. `binary` MUST return an 8-bit-per-byte bitstring, and `hexadecimal` MUST return lowercase hexadecimal text. Read failure MUST raise a runtime error. -- `BOOL: WRITEFILE(STR: blob, STR: path, STR: coding = "UTF-8")` = MUST write `blob` to `path` using the selected coding rules. Coding names MUST be matched case-insensitively. `UTF-8 BOM` MUST emit a BOM. `ANSI` MUST map to Windows-1252 on Windows and Latin-1 on other hosts. `binary` MUST require a bitstring whose length is a multiple of 8, and `hexadecimal` MUST require valid hexadecimal text. Invalid coding names or malformed binary or hexadecimal input MUST raise a runtime error. Ordinary I/O failure MUST cause the operator to return `FALSE`; successful writes MUST return `TRUE`. +- `BOOL WRITEFILE(STR blob, STR path, STR coding = "UTF-8")` = MUST write `blob` to `path` using the selected coding rules. Coding names MUST be matched case-insensitively. `UTF-8 BOM` MUST emit a BOM. `ANSI` MUST map to Windows-1252 on Windows and Latin-1 on other hosts. `binary` MUST require a bitstring whose length is a multiple of 8, and `hexadecimal` MUST require valid hexadecimal text. Invalid coding names or malformed binary or hexadecimal input MUST raise a runtime error. Ordinary I/O failure MUST cause the operator to return `FALSE`; successful writes MUST return `TRUE`. -- `BOOL: EXISTFILE(STR: path)` = MUST return `TRUE` if a filesystem object exists at `path` and `FALSE` otherwise. +- `BOOL EXISTFILE(STR path)` = MUST return `TRUE` if a filesystem object exists at `path` and `FALSE` otherwise. -- `BOOL: DELETEFILE(STR: path)` = MUST delete the filesystem object at `path` and return `TRUE` on success. Missing files, permission failures, and other deletion failures MUST raise a runtime error. +- `BOOL DELETEFILE(STR path)` = MUST delete the filesystem object at `path` and return `TRUE` on success. Missing files, permission failures, and other deletion failures MUST raise a runtime error. -- `STR: OS()` = MUST return a short lowercase ASCII string describing the host operating-system family, such as `win`, `linux`, `macos`, or `unix`. +- `STR OS()` = MUST return a short lowercase ASCII string describing the host operating-system family, such as `win`, `linux`, `macos`, or `unix`. -- `TNS: ARGV()` = MUST return the process argument vector as a one-dimensional tensor of `STR`, preserving the host-provided order. +- `TNS ARGV()` = MUST return the process argument vector as a one-dimensional tensor of `STR`, preserving the host-provided order. --- #### 9.1.12 Console and process operators -- `BOOL: PRINT(~STR: arg1, ..., ~STR: argN)` = MUST convert each argument to `STR`, concatenate the rendered arguments, append a trailing newline, write the result to the console output, record the corresponding I/O event in the execution log, and return `FALSE`. +- `BOOL PRINT(~STR arg1, ..., ~STR argN)` = MUST convert each argument to `STR`, concatenate the rendered arguments, append a trailing newline, write the result to the console output, record the corresponding I/O event in the execution log, and return `FALSE`. -- `STR: INPUT()` or `STR: INPUT(STR: prompt)` = MUST read a single line of text from the console input and return it as a `STR`. If `prompt` is supplied, the interpreter MUST write it to the console before reading input. The resulting input event MUST be recorded in the execution log, and if a prompt was supplied the recorded event MUST include that prompt text. +- `STR INPUT()` or `STR INPUT(STR prompt)` = MUST read a single line of text from the console input and return it as a `STR`. If `prompt` is supplied, the interpreter MUST write it to the console before reading input. The resulting input event MUST be recorded in the execution log, and if a prompt was supplied the recorded event MUST include that prompt text. -- `BOOL: WARN(~STR: arg1, ..., ~STR: argN)` = MUST behave like `PRINT`, except that output MUST occur only when the interpreter was started with `-verbose`, the rendered line MUST be prefixed with `WARNING: `, and the operator MUST return `TRUE` when output occurred and `FALSE` otherwise. Arguments outside `INT` and `STR` MUST raise a runtime error. +- `BOOL WARN(~STR arg1, ..., ~STR argN)` = MUST behave like `PRINT`, except that output MUST occur only when the interpreter was started with `-verbose`, the rendered line MUST be prefixed with `WARNING: `, and the operator MUST return `TRUE` when output occurred and `FALSE` otherwise. Arguments outside `INT` and `STR` MUST raise a runtime error. -- `INT: CL(STR: command)` = MUST execute `command` using the host command shell and return the resulting subprocess exit code as an `INT`. Failure to start the subprocess MUST raise a runtime error. The execution log MUST record the command text and resulting exit code. +- `INT CL(STR command)` = MUST execute `command` using the host command shell and return the resulting subprocess exit code as an `INT`. Failure to start the subprocess MUST raise a runtime error. The execution log MUST record the command text and resulting exit code. -- `EXIT()` or `EXIT(INT: code)` = MUST immediately terminate the interpreter and return process exit code `0` or the supplied integer `code`, respectively. The termination event MUST be recorded in the execution log when logging is enabled. +- `EXIT()` or `EXIT(INT code)` = MUST immediately terminate the interpreter and return process exit code `0` or the supplied integer `code`, respectively. The termination event MUST be recorded in the execution log when logging is enabled. -- `BOOL: SHUSH()` = MUST suppress forwarding of console output produced by operators such as `PRINT`, `WARN`, and shell-output capture from `CL`, while leaving the corresponding I/O events available for deterministic logging and replay. `INPUT` prompts MUST continue to be forwarded while shushing is active. `SHUSH` MUST return `FALSE`. +- `BOOL SHUSH()` = MUST suppress forwarding of console output produced by operators such as `PRINT`, `WARN`, and shell-output capture from `CL`, while leaving the corresponding I/O events available for deterministic logging and replay. `INPUT` prompts MUST continue to be forwarded while shushing is active. `SHUSH` MUST return `FALSE`. -- `BOOL: UNSHUSH()` = MUST clear the shush state established by `SHUSH` so that subsequent console output is forwarded normally again. `UNSHUSH` MUST return `FALSE`. +- `BOOL UNSHUSH()` = MUST clear the shush state established by `SHUSH` so that subsequent console output is forwarded normally again. `UNSHUSH` MUST return `FALSE`. --- @@ -1036,9 +1036,9 @@ #### 9.2.2 Declaration and assignment statements -The declaration form `TYPE: name` MUST record the static type of `name` without creating a readable runtime binding. Reading that symbol before a later assignment MUST raise a runtime error. +The declaration form `TYPE name` MUST record the static type of `name` without creating a readable runtime binding. Reading that symbol before a later assignment MUST raise a runtime error. The type and name MUST be separated by one or more space characters, and no other character MAY appear between them. -The assignment forms `TYPE: name = expression` and `name = expression` MUST, respectively, perform first assignment with declaration and subsequent assignment to an already-declared symbol. An untyped assignment to an undeclared symbol MUST raise a runtime error, and every assignment MUST preserve the symbol's recorded static type. +The assignment forms `TYPE name = expression` and `name = expression` MUST, respectively, perform first assignment with declaration and subsequent assignment to an already-declared symbol. An untyped assignment to an undeclared symbol MUST raise a runtime error, and every assignment MUST preserve the symbol's recorded static type. Indexed assignment statements `tensor[i1, ..., iN] = expression` and `map = expression` MUST follow the same typing, indexing, and mutation rules defined in [3.2](#32-declarations-and-assignment). Slice assignment to tensors MUST require exact shape agreement between the selected slice and the right-hand-side tensor value. @@ -1054,7 +1054,7 @@ #### 9.2.4 Exception-handling statements -Structured exception handling MUST use either `TRY{ ... }CATCH{ ... }` or `TRY{ ... }CATCH(SYMBOL: name){ ... }`. The `CATCH` block MUST immediately follow its `TRY` block, and exactly one `CATCH` block MUST be provided for each `TRY` statement. +Structured exception handling MUST use either `TRY{ ... }CATCH{ ... }` or `TRY{ ... }CATCH(SYMBOL name){ ... }`. The `CATCH` block MUST immediately follow its `TRY` block, and exactly one `CATCH` block MUST be provided for each `TRY` statement. If execution of the `TRY` block completes normally, the corresponding `CATCH` block MUST be skipped. If execution raises an interpreter-level runtime error, execution of the `TRY` block MUST stop and the `CATCH` block MUST run; in the parameterized form, the temporary binding named by `name` MUST be a `STR` containing the error message for the duration of that handler block only. @@ -1072,11 +1072,11 @@ #### 9.2.6 Function-definition and return statements -Named function definitions MUST use the `FUNC` statement form with an explicit return type, function name, typed parameter list, and block body. Parameters MAY declare default expressions, coerced parameters MUST be marked with `~`, and all parameter-binding and default-evaluation behavior MUST follow the rules defined in [4.6](#46-functions) and [5.3](#53-function-symbols-and-call-binding). +Named function definitions MUST use the `FUNC` statement form with an explicit return type, function name, typed parameter list, and block body. Parameters MAY declare default expressions, coerced parameters MUST be marked with `~`, and all parameter-binding and default-evaluation behavior MUST follow the rules defined in [4.6](#46-functions) and [5.3](#53-function-symbols-and-call-binding). Typed parameters and return annotations in the function syntax MUST use the `TYPE name` form, with one or more space characters between the type and the name. The statement `RETURN(expression)` MUST terminate the innermost enclosing function immediately and produce the supplied value as that function's result. The returned value MUST satisfy the function's declared return type, and using `RETURN` outside a function MUST raise a runtime error. -The statement `POP(SYMBOL: name)` MUST be valid only inside a function body. It MUST retrieve the current value bound to `name`, delete that binding from the environment, and then return the retrieved value as though `RETURN(name)` had executed immediately before the deletion. Using `POP` outside a function, or applying it to an unreadable binding, MUST raise a runtime error. +The statement `POP(SYMBOL name)` MUST be valid only inside a function body. It MUST retrieve the current value bound to `name`, delete that binding from the environment, and then return the retrieved value as though `RETURN(name)` had executed immediately before the deletion. Using `POP` outside a function, or applying it to an unreadable binding, MUST raise a runtime error. --- diff --git a/lib/std/csprng.pre b/lib/std/csprng.pre index f3c379b..154608b 100644 --- a/lib/std/csprng.pre +++ b/lib/std/csprng.pre @@ -1,33 +1,33 @@ ! ChaCha20-based cryptographically secure pseudorandom number generator -INT: MASK32 = SUB( POW(0b10, 0b100000), 1 ) ! 2^32-1 +INT MASK32 = SUB( POW(0b10, 0b100000), 1 ) ! 2^32-1 ! ChaCha20 constants ("expand 32-byte k") -MAP: CH_CONST = < ^ +MAP CH_CONST = < ^ 0b0 = 0b01100001011100000111000001100101, ^ 0b1 = 0b00110011001000000110010001101110, ^ 0b10 = 0b01111001011000100010110100110010, ^ 0b11 = 0b01101011001000000110010101110100 ^ > -TNS: ch_key = TNS([0b1000], 0b0) ! 8 words -TNS: ch_nonce = [0b0, 0b0, 0b0] ! use literals for short TNS -INT: ch_counter = 0 -TNS: ch_buf = TNS([0b10000], 0b0) ! 16 words -INT: ch_buf_pos = TLEN(ch_buf, 0b1) ! set to buffer length to force refill +TNS ch_key = TNS([0b1000], 0b0) ! 8 words +TNS ch_nonce = [0b0, 0b0, 0b0] ! use literals for short TNS +INT ch_counter = 0 +TNS ch_buf = TNS([0b10000], 0b0) ! 16 words +INT ch_buf_pos = TLEN(ch_buf, 0b1) ! set to buffer length to force refill -FUNC INT: ROTL32(INT: x, INT: n){ - INT: x32 = BAND(x, MASK32) - INT: left = BAND(SHL(x32, n), MASK32) - INT: right = SHR(x32, SUB(0b100000, n)) ! 32 - n +FUNC INT ROTL32(INT x, INT n){ + INT x32 = BAND(x, MASK32) + INT left = BAND(SHL(x32, n), MASK32) + INT right = SHR(x32, SUB(0b100000, n)) ! 32 - n RETURN( BAND(BOR(left, right), MASK32) ) } -FUNC INT: QR(TNS: s, INT: ia, INT: ib, INT: ic, INT: id){ - INT: a = s[ia] - INT: b = s[ib] - INT: c = s[ic] - INT: d = s[id] +FUNC INT QR(TNS s, INT ia, INT ib, INT ic, INT id){ + INT a = s[ia] + INT b = s[ib] + INT c = s[ic] + INT d = s[id] a = BAND( ADD(a, b), MASK32 ) d = ROTL32( BXOR(d, a), 0b10000 ) ! 16 @@ -45,10 +45,10 @@ FUNC INT: QR(TNS: s, INT: ia, INT: ib, INT: ic, INT: id){ RETURN(0) } -FUNC INT: CHACHA_BLOCK(){ - TNS: k = ch_key - TNS: n = ch_nonce - TNS: state = [ ^ +FUNC INT CHACHA_BLOCK(){ + TNS k = ch_key + TNS n = ch_nonce + TNS state = [ ^ CH_CONST<0b0>, ^ CH_CONST<0b1>, ^ CH_CONST<0b10>, ^ @@ -98,15 +98,15 @@ FUNC INT: CHACHA_BLOCK(){ RETURN(0b0) } -FUNC INT: REFILL_BUF(){ +FUNC INT REFILL_BUF(){ CHACHA_BLOCK() ch_buf_pos = 0b0 ch_counter = BAND( ADD(ch_counter, 0b1), MASK32 ) RETURN(0b0) } -FUNC INT: DERIVE_KEY_AND_NONCE(INT: seed){ - INT: s = BAND(seed, MASK32) +FUNC INT DERIVE_KEY_AND_NONCE(INT seed){ + INT s = BAND(seed, MASK32) FOR(i, 0b1000){ ! 8 key words (1000 == 8) s = BAND( ADD( MUL(s, ^ 0b01000001110001100100111001101101), ^ @@ -126,7 +126,7 @@ FUNC INT: DERIVE_KEY_AND_NONCE(INT: seed){ RETURN(0b0) } -FUNC INT: SEED(INT: seed){ +FUNC INT SEED(INT seed){ DERIVE_KEY_AND_NONCE(seed) ch_counter = 0b0 ch_buf = TNS([0b10000], 0b0) @@ -134,25 +134,25 @@ FUNC INT: SEED(INT: seed){ RETURN(ch_counter) } -FUNC INT: NEXT(){ +FUNC INT NEXT(){ IF( GTE(ch_buf_pos, TLEN(ch_buf, 0b1)) ){ ! buffer length REFILL_BUF() } - INT: v = ch_buf[ ADD(ch_buf_pos, 0b1) ] + INT v = ch_buf[ ADD(ch_buf_pos, 0b1) ] ch_buf_pos = ADD(ch_buf_pos, 0b1) RETURN(v) } -FUNC INT: RANGE(INT: max){ +FUNC INT RANGE(INT max){ ASSERT( GT(max, 0b0) ) RETURN( MOD(NEXT(), max) ) } -FUNC INT: RANGE_MIN_MAX(INT: min, INT: max){ +FUNC INT RANGE_MIN_MAX(INT min, INT max){ ASSERT( LTE(min, max) ) - INT: range = SUB(max, min) + INT range = SUB(max, min) IF( EQ(range, 0b0) ){ RETURN(min) } ASSERT( GT(range, 0b0) ) - INT: offset = RANGE(range) + INT offset = RANGE(range) RETURN( ADD(offset, min) ) } diff --git a/lib/std/diff.pre b/lib/std/diff.pre index be1c15f..af6e7f0 100644 --- a/lib/std/diff.pre +++ b/lib/std/diff.pre @@ -1,26 +1,26 @@ ! diff utilities for Prefix -FUNC STR: _append_line(STR: acc, STR: line){ +FUNC STR _append_line(STR acc, STR line){ IF( EQ(acc, "") ){ RETURN(line) } ELSE { RETURN( JOIN(acc, "\n", line) ) } } -FUNC STR: UNIFIED(STR: mod, STR: src){ - TNS: a = SPLIT(mod, "\n") - TNS: b = SPLIT(src, "\n") - INT: la = TLEN(a, 0d1) - INT: lb = TLEN(b, 0d1) - INT: n = MAX(la, lb) - STR: out = "" - INT: i = 0d1 +FUNC STR UNIFIED(STR mod, STR src){ + TNS a = SPLIT(mod, "\n") + TNS b = SPLIT(src, "\n") + INT la = TLEN(a, 0d1) + INT lb = TLEN(b, 0d1) + INT n = MAX(la, lb) + STR out = "" + INT i = 0d1 WHILE( LTE(i, n) ){ - STR: left = "" + STR left = "" IF( LTE(i, la) ){ left = a[i] } - STR: right = "" + STR right = "" IF( LTE(i, lb) ){ right = b[i] } IF( EQ(left, right) ){ IF( NEQ(left, "")){ - STR: line = JOIN(" ", left) + STR line = JOIN(" ", left) out = _append_line(out, line) } } ELSE { @@ -36,30 +36,30 @@ FUNC STR: UNIFIED(STR: mod, STR: src){ RETURN(out) } -FUNC STR: CONTEXT(STR: mod, STR: src){ +FUNC STR CONTEXT(STR mod, STR src){ ! For simplicity, use the same output as UNIFIED but with a ' ' prefix - STR: u = UNIFIED(mod, src) + STR u = UNIFIED(mod, src) IF( EQ(u, "") ){ RETURN("") } ! Prepend a simple header to resemble context diff RETURN( JOIN("*** a", "\n", u) ) } -FUNC STR: SIDE_BY_SIDE(STR: mod, STR: src){ - TNS: a = SPLIT(mod, "\n") - TNS: b = SPLIT(src, "\n") - INT: la = TLEN(a, 0d1) - INT: lb = TLEN(b, 0d1) - INT: n = MAX(la, lb) - STR: out = "" - INT: i = 0d1 +FUNC STR SIDE_BY_SIDE(STR mod, STR src){ + TNS a = SPLIT(mod, "\n") + TNS b = SPLIT(src, "\n") + INT la = TLEN(a, 0d1) + INT lb = TLEN(b, 0d1) + INT n = MAX(la, lb) + STR out = "" + INT i = 0d1 WHILE( LTE(i, n) ){ - STR: left = "" + STR left = "" IF( LTE(i, la) ){ left = a[i] } - STR: right = "" + STR right = "" IF( LTE(i, lb) ){ right = b[i] } - STR: marker = " " + STR marker = " " IF( NEQ(left, right)){ marker = "|" } - STR: line = JOIN(left, " ", marker, " ", right) + STR line = JOIN(left, " ", marker, " ", right) out = _append_line(out, line) i = ADD(i, 0d1) } diff --git a/lib/std/gui/init.pre b/lib/std/gui/init.pre index 13f499c..c0c18c4 100644 --- a/lib/std/gui/init.pre +++ b/lib/std/gui/init.pre @@ -2,18 +2,18 @@ EXTEND(EXTENSION: gui) -FUNC INT: SCREEN_WIDTH(){ +FUNC INT SCREEN_WIDTH(){ RETURN(SCREEN()[0d1]) } -FUNC INT: SCREEN_HEIGHT(){ +FUNC INT SCREEN_HEIGHT(){ RETURN(SCREEN()[0d2]) } -FUNC INT: WINDOW_WIDTH(INT: handle){ +FUNC INT WINDOW_WIDTH(INT handle){ RETURN(WINDOW(handle)[0d1]) } -FUNC INT: WINDOW_HEIGHT(INT: handle){ +FUNC INT WINDOW_HEIGHT(INT handle){ RETURN(WINDOW(handle)[0d2]) } diff --git a/lib/std/image/init.pre b/lib/std/image/init.pre index b3e667e..82e96de 100644 --- a/lib/std/image/init.pre +++ b/lib/std/image/init.pre @@ -10,8 +10,8 @@ EXTEND(EXTENSION: image) IMPORT(path) -FUNC TNS: LOAD(STR: img_path){ - STR: ext = path.EXTNAME(img_path) +FUNC TNS LOAD(STR img_path){ + STR ext = path.EXTNAME(img_path) IF(EQ(ext, "png")){ RETURN(LOAD_PNG(img_path)) } ELSEIF (OR(EQ(ext, "jpg"),EQ(ext, "jpeg"))){ @@ -23,70 +23,70 @@ FUNC TNS: LOAD(STR: img_path){ } } -FUNC INT: WIDTH(TNS: img){ +FUNC INT WIDTH(TNS img){ RETURN(TLEN(img, 0d1)) } -FUNC INT: HEIGHT(TNS: img){ +FUNC INT HEIGHT(TNS img){ RETURN(TLEN(img, 0d2)) } -FUNC INT: CHANNELS(TNS: img){ +FUNC INT CHANNELS(TNS img){ RETURN(TLEN(img, 0d3)) } -FUNC TNS: R(TNS: img){ +FUNC TNS R(TNS img){ RETURN(img[*, *, 0d1]) } -FUNC TNS: G(TNS: img){ +FUNC TNS G(TNS img){ RETURN(img[*, *, 0d2]) } -FUNC TNS: B(TNS: img){ +FUNC TNS B(TNS img){ RETURN(img[*, *, 0d3]) } -FUNC TNS: A(TNS: img){ +FUNC TNS A(TNS img){ RETURN(img[*, *, 0d4]) } -FUNC TNS: PIXEL(TNS: img, INT: x, INT: y){ +FUNC TNS PIXEL(TNS img, INT x, INT y){ RETURN(img[x, y, *]) } -FUNC INT: PIXEL_R(TNS: img, INT: x, INT: y){ +FUNC INT PIXEL_R(TNS img, INT x, INT y){ RETURN(img[x, y, 0d1]) } -FUNC INT: PIXEL_G(TNS: img, INT: x, INT: y){ +FUNC INT PIXEL_G(TNS img, INT x, INT y){ RETURN(img[x, y, 0d2]) } -FUNC INT: PIXEL_B(TNS: img, INT: x, INT: y){ +FUNC INT PIXEL_B(TNS img, INT x, INT y){ RETURN(img[x, y, 0d3]) } -FUNC INT: PIXEL_A(TNS: img, INT: x, INT: y){ +FUNC INT PIXEL_A(TNS img, INT x, INT y){ RETURN(img[x, y, 0d4]) } -FUNC TNS: FLIP_V(TNS: img){ +FUNC TNS FLIP_V(TNS img){ RETURN(TFLIP(img, 0d1)) } -FUNC TNS: FLIP_H(TNS: img){ +FUNC TNS FLIP_H(TNS img){ RETURN(TFLIP(img, 0d2)) } -FUNC TNS: INVERT(TNS: img){ - TNS: return = MSUB(TNS(SHAPE(img), 0xFF), img) +FUNC TNS INVERT(TNS img){ + TNS return = MSUB(TNS(SHAPE(img), 0xFF), img) return[*, *, 0d4] = img[*, *, 0d4] ! Preserve alpha POP(return) } -FUNC TNS: RECT(TNS: img, INT: x, INT: y, INT: width, INT: height, TNS: color, INT: fill, INT: thickness){ - TNS: pts = [ ^ +FUNC TNS RECT(TNS img, INT x, INT y, INT width, INT height, TNS color, INT fill, INT thickness){ + TNS pts = [ ^ [x, y], ^ [ADD(x, SUB(width, 0d1)), y], ^ [ADD(x, SUB(width, 0d1)), ADD(y, SUB(height, 0d1))], ^ @@ -96,37 +96,37 @@ FUNC TNS: RECT(TNS: img, INT: x, INT: y, INT: width, INT: height, TNS: color, IN RETURN(POLYGON(img, pts, color, fill, thickness)) } -FUNC TNS: RECTANGLE(TNS: img, INT: x, INT: y, INT: width, INT: height, TNS: color, INT: fill, INT: thickness){ +FUNC TNS RECTANGLE(TNS img, INT x, INT y, INT width, INT height, TNS color, INT fill, INT thickness){ RETURN(RECT(img, x, y, width, height, color, fill, thickness)) } -FUNC TNS: FILL_RECT(TNS: img, INT: x, INT: y, INT: width, INT: height, TNS: color){ +FUNC TNS FILL_RECT(TNS img, INT x, INT y, INT width, INT height, TNS color){ RETURN(RECT(img, x, y, width, height, color, 0d1, 0d1)) } -FUNC TNS: FILL_ELLIPSE(TNS: img, TNS: center, INT: rx, INT: ry, TNS: color){ +FUNC TNS FILL_ELLIPSE(TNS img, TNS center, INT rx, INT ry, TNS color){ RETURN(ELLIPSE(img, center, rx, ry, color, 0d1, 0d1)) } -FUNC TNS: SQUARE(TNS: img, INT: x, INT: y, INT: size, TNS: color, INT: fill, INT: thickness){ +FUNC TNS SQUARE(TNS img, INT x, INT y, INT size, TNS color, INT fill, INT thickness){ RETURN(RECT(img, x, y, size, size, color, fill, thickness)) } -FUNC TNS: CIRCLE(TNS: img, TNS: center, INT: radius, TNS: color, INT: fill, INT: thickness){ +FUNC TNS CIRCLE(TNS img, TNS center, INT radius, TNS color, INT fill, INT thickness){ RETURN(ELLIPSE(img, center, radius, radius, color, fill, thickness)) } -FUNC TNS: CROP(TNS: img, TNS: corners){ +FUNC TNS CROP(TNS img, TNS corners){ IF(NEQ(SHAPE(corners), [0d4, 0d2])){ THROW("CROP corners must be a 0d4 by 0d2 tensor: [[tl_x, tl_y], [tr_x, tr_y], [bl_x, bl_y], [br_x, br_y]]") } RETURN(img[MIN(corners[*, 0d1])-MAX(corners[*, 0d1]), MIN(corners[*, 0d2])-MAX(corners[*, 0d2]), *]) } -FUNC BOOL: SHOW(TNS: img){ +FUNC BOOL SHOW(TNS img){ ! Save the image to the provided path and open it with the system default ! viewer on Windows. `img_path` is treated as the target file path. - STR: img_path = "C:/Windows/Temp/tmp_img.png" + STR img_path = "C:/Windows/Temp/tmp_img.png" SAVE_PNG(img, img_path, 0d0) ! ShellExecuteW(hwnd, operation, file, params, dir, showcmd) ! Use NULL hwnd (0), operation "open", empty params and dir, showcmd=1 diff --git a/lib/std/path.pre b/lib/std/path.pre index c30b336..e91d7fa 100644 --- a/lib/std/path.pre +++ b/lib/std/path.pre @@ -1,47 +1,47 @@ ! Path utilities for Prefix -FUNC STR: NORMALIZE_PATH(STR: path){ +FUNC STR NORMALIZE_PATH(STR path){ RETURN(REPLACE(path,"\\","/")) } -FUNC STR: WINPATH(STR: path){ +FUNC STR WINPATH(STR path){ RETURN(REPLACE(path,"/","\\")) } -FUNC STR: BASEPATH(STR: path){ ! returns directory portion of path - STR: npath = NORMALIZE_PATH(path) - STR: base = BASENAME(npath) +FUNC STR BASEPATH(STR path){ ! returns directory portion of path + STR npath = NORMALIZE_PATH(path) + STR base = BASENAME(npath) IF(EQ(base, "")){ RETURN("") } - STR: dir = REPLACE(npath, JOIN("/", base), "") + STR dir = REPLACE(npath, JOIN("/", base), "") POP(dir) } -FUNC STR: BASENAME(STR: path){ ! returns filename portion of path - TNS: tpath = SPLIT(NORMALIZE_PATH(path), "/") - STR: basename = tpath[MAX(TLEN(tpath, 0d1), 0d1)] +FUNC STR BASENAME(STR path){ ! returns filename portion of path + TNS tpath = SPLIT(NORMALIZE_PATH(path), "/") + STR basename = tpath[MAX(TLEN(tpath, 0d1), 0d1)] DEL(tpath) POP(basename) } -FUNC TNS: SPLITEXT(STR: path){ ! returns [name without ext, ext] - STR: npath = NORMALIZE_PATH(path) - STR: base = BASENAME(npath) - STR: dir = BASEPATH(npath) - TNS: parts = SPLIT(base, ".") +FUNC TNS SPLITEXT(STR path){ ! returns [name without ext, ext] + STR npath = NORMALIZE_PATH(path) + STR base = BASENAME(npath) + STR dir = BASEPATH(npath) + TNS parts = SPLIT(base, ".") ! If there is no dot, return the path unchanged and empty ext IF(EQ(TLEN(parts, 0d1), 0d1)){ DEL(base) - TNS: result = [npath, ""] + TNS result = [npath, ""] POP(result) } ! Extension is the last segment (1-based indexing) - STR: ext = parts[ TLEN(parts, 0d1) ] + STR ext = parts[ TLEN(parts, 0d1) ] ! Name is base without the final "." + ext suffix - STR: name = REPLACE(base, JOIN(".", ext), "") + STR name = REPLACE(base, JOIN(".", ext), "") DEL(parts) - STR: delex = "" + STR delex = "" IF(EQ(dir, "")){ delex = name } ELSE { @@ -53,39 +53,39 @@ FUNC TNS: SPLITEXT(STR: path){ ! returns [name without ext, ext] } DEL(dir) DEL(name) - TNS: result = [delex, ext] + TNS result = [delex, ext] POP(result) } -FUNC STR: EXTNAME(STR: path){ ! returns extension portion of path +FUNC STR EXTNAME(STR path){ ! returns extension portion of path RETURN(SPLITEXT(path)[0d2]) } -FUNC STR: DELEXT(STR: path){ ! returns path without extension +FUNC STR DELEXT(STR path){ ! returns path without extension RETURN(SPLITEXT(path)[0d1]) } -FUNC STR: TEMPFILE(STR: local_path){ +FUNC STR TEMPFILE(STR local_path){ IF(EQ(OS(),"win")){ - STR: temp = "C:/Windows/Temp/" + STR temp = "C:/Windows/Temp/" } ELSEIF(EQ(OS(),"mac")){ THROW("TEMPFILE not implemented for macOS yet") ! per-user temp dirs on macOS are more complex ! add later } ELSE { - STR: temp = "/tmp/" + STR temp = "/tmp/" } - STR: final_path = JOIN(temp, local_path) + STR final_path = JOIN(temp, local_path) DEL(temp) POP(final_path) } -STR: interpreter = ARGV()[0d1] -STR: interpreter_dir = NORMALIZE_PATH(BASEPATH(ARGV()[0d1])) +STR interpreter = ARGV()[0d1] +STR interpreter_dir = NORMALIZE_PATH(BASEPATH(ARGV()[0d1])) IF(GTE(TLEN(ARGV(), 0d1), 0d2)){ - STR: script = ARGV()[0d2] - STR: script_dir = NORMALIZE_PATH(BASEPATH(ARGV()[0d2])) + STR script = ARGV()[0d2] + STR script_dir = NORMALIZE_PATH(BASEPATH(ARGV()[0d2])) } ELSE { - STR: script = "" - STR: script_dir = "" + STR script = "" + STR script_dir = "" } diff --git a/lib/std/prime.pre b/lib/std/prime.pre index 86b5a98..7dd79db 100644 --- a/lib/std/prime.pre +++ b/lib/std/prime.pre @@ -1,6 +1,6 @@ ! Primality and factorization functions -FUNC BOOL: IS_PRIME(INT: n){ +FUNC BOOL IS_PRIME(INT n){ IF(LTE(n, 0d1)){ RETURN(FALSE) } @@ -11,7 +11,7 @@ FUNC BOOL: IS_PRIME(INT: n){ IF(EQ(MOD(n, 0d2), 0d0)){ RETURN(FALSE) } - INT: i = 0d3 + INT i = 0d3 WHILE(LTE(MUL(i, i), n)){ IF(EQ(MOD(n, i), 0d0)){ RETURN(FALSE) @@ -21,8 +21,8 @@ FUNC BOOL: IS_PRIME(INT: n){ RETURN(TRUE) } -FUNC INT: NEXT_PRIME(INT: start){ - INT: n = ADD(start, 0d1) +FUNC INT NEXT_PRIME(INT start){ + INT n = ADD(start, 0d1) WHILE(0d1){ IF(IS_PRIME(n)){ RETURN(n) @@ -31,8 +31,8 @@ FUNC INT: NEXT_PRIME(INT: start){ } } -FUNC INT: PREV_PRIME(INT: start){ - INT: n = SUB(start, 0d1) +FUNC INT PREV_PRIME(INT start){ + INT n = SUB(start, 0d1) WHILE(GT(n, 0d1)){ IF(IS_PRIME(n)){ RETURN(n) @@ -42,10 +42,10 @@ FUNC INT: PREV_PRIME(INT: start){ RETURN(0d0) } -FUNC BOOL: IS_MERSENNE_PRIME(INT: p){ +FUNC BOOL IS_MERSENNE_PRIME(INT p){ IF(IS_PRIME(p)){ - INT: exp = POW(0d2, p) - INT: mersenne = SUB(exp, 0d1) + INT exp = POW(0d2, p) + INT mersenne = SUB(exp, 0d1) IF(IS_PRIME(mersenne)){ RETURN(TRUE) } @@ -55,24 +55,24 @@ FUNC BOOL: IS_MERSENNE_PRIME(INT: p){ } } -FUNC TNS: FACTOR(INT: n){ +FUNC TNS FACTOR(INT n){ IF(LTE(n, 0d1)){ - TNS: empty = [0d0] + TNS empty = [0d0] RETURN(empty) } - INT: p = 0d2 - INT: coll_len = 0d0 - TNS: coll = [0d0] ! placeholder, real shape tracked by coll_len + INT p = 0d2 + INT coll_len = 0d0 + TNS coll = [0d0] ! placeholder, real shape tracked by coll_len WHILE(LTE(MUL(p, p), n)){ IF(EQ(MOD(n, p), 0d0)){ IF(EQ(coll_len, 0d0)){ - TNS: first = [p] + TNS first = [p] coll = first coll_len = 0d1 } ELSE { - INT: old_len = TLEN(coll, 0d1) - INT: new_len = ADD(old_len, 0d1) - TNS: new_coll = TNS([new_len], 0d0) + INT old_len = TLEN(coll, 0d1) + INT new_len = ADD(old_len, 0d1) + TNS new_coll = TNS([new_len], 0d0) FOR(i, old_len){ new_coll[i] = coll[i] } @@ -87,13 +87,13 @@ FUNC TNS: FACTOR(INT: n){ } IF(GT(n, 0d1)){ IF(EQ(coll_len, 0d0)){ - TNS: last = [n] + TNS last = [n] coll = last coll_len = 0d1 } ELSE { - INT: old_len2 = TLEN(coll, 0d1) - INT: new_len2 = ADD(old_len2, 0d1) - TNS: new_coll2 = TNS([new_len2], 0d0) + INT old_len2 = TLEN(coll, 0d1) + INT new_len2 = ADD(old_len2, 0d1) + TNS new_coll2 = TNS([new_len2], 0d0) FOR(j, old_len2){ new_coll2[j] = coll[j] } diff --git a/lib/std/prng.pre b/lib/std/prng.pre index 90b7c33..782a561 100644 --- a/lib/std/prng.pre +++ b/lib/std/prng.pre @@ -1,32 +1,32 @@ ! LCG-based pseudorandom number generator -INT: MASK32 = SUB( POW(0b10, 0b100000), 0b1 ) ! 2^32 - 1 +INT MASK32 = SUB( POW(0b10, 0b100000), 0b1 ) ! 2^32 - 1 ! LCG constants: state = (A * state + C) mod 2^32 -INT: LCG_A = 0b000110010110011000001101 ! 1664525 -INT: LCG_C = 0b00111100011011101111001101011111 ! 1013904223 -INT: lcg_state = 0b1 +INT LCG_A = 0b000110010110011000001101 ! 1664525 +INT LCG_C = 0b00111100011011101111001101011111 ! 1013904223 +INT lcg_state = 0b1 -FUNC INT: SEED(INT: seed){ +FUNC INT SEED(INT seed){ lcg_state = BAND(seed, MASK32) RETURN(lcg_state) } -FUNC INT: NEXT(){ +FUNC INT NEXT(){ lcg_state = BAND( ADD( MUL(LCG_A, lcg_state), LCG_C ), MASK32 ) RETURN(lcg_state) } -FUNC INT: RANGE(INT: max){ +FUNC INT RANGE(INT max){ ASSERT( GT(max, 0b0) ) RETURN( MOD(NEXT(), max) ) } -FUNC INT: RANGE_MIN_MAX(INT: min, INT: max){ +FUNC INT RANGE_MIN_MAX(INT min, INT max){ ASSERT( LTE(min, max) ) - INT: range = SUB(max, min) + INT range = SUB(max, min) IF( EQ(range, 0b0) ){ RETURN(min) } ASSERT( GT(range, 0b0) ) - INT: offset = RANGE(range) + INT offset = RANGE(range) RETURN( ADD(offset, min) ) } diff --git a/lib/std/stats.pre b/lib/std/stats.pre index 19f991e..563d206 100644 --- a/lib/std/stats.pre +++ b/lib/std/stats.pre @@ -4,34 +4,34 @@ ! for simplicity; callers should pass a 1-D tensor (e.g. from SHAPE/SLICE or ! constructed directly). Functions return INT or FLT as documented below. -FUNC FLT: MEAN(TNS: values){ - INT: n = TLEN(values, 0d1) +FUNC FLT MEAN(TNS values){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { THROW("empty input") } - FLT: sum = 0d0.0 + FLT sum = 0d0.0 FOR(i, n){ FADD(@sum, values[i]) } RETURN(FDIV(sum, n)) } -FUNC FLT: MEDIAN(TNS: values){ - INT: n = TLEN(values, 0d1) +FUNC FLT MEDIAN(TNS values){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { THROW("empty input") } ! k1 is the lower median rank (1-based) - INT: k1 = DIV(ADD(n, 0d1), 0d10) ! DIV by 2 (binary 10) + INT k1 = DIV(ADD(n, 0d1), 0d10) ! DIV by 2 (binary 10) ! if even, k2 is k1+1, else k2==k1 - INT: is_even = MOD(n, 0d10) - INT: k2 = k1 + INT is_even = MOD(n, 0d10) + INT k2 = k1 IF(EQ(is_even, 0d0)) { k2 = ADD(k1, 0d1) } ! find k1 - FLT: val1 = 0d0.0 + FLT val1 = 0d0.0 FOR(i, n){ - FLT: cand = FLT(values[i]) - INT: less = 0d0 - INT: le = 0d0 + FLT cand = FLT(values[i]) + INT less = 0d0 + INT le = 0d0 FOR(j, n){ - FLT: v = FLT(values[j]) + FLT v = FLT(values[j]) IF(LT(v, cand)) { ADD(@less, 0d1) } IF(OR(LT(v, cand), EQ(v, cand))) { ADD(@le, 0d1) } } @@ -41,13 +41,13 @@ FUNC FLT: MEDIAN(TNS: values){ IF(EQ(k1, k2)) { RETURN(val1) } ! find k2 - FLT: val2 = 0d0.0 + FLT val2 = 0d0.0 FOR(i, n){ - FLT: cand = FLT(values[i]) - INT: less = 0d0 - INT: le = 0d0 + FLT cand = FLT(values[i]) + INT less = 0d0 + INT le = 0d0 FOR(j, n){ - FLT: v = FLT(values[j]) + FLT v = FLT(values[j]) IF(LT(v, cand)) { ADD(@less, 0d1) } IF(OR(LT(v, cand), EQ(v, cand))) { ADD(@le, 0d1) } } @@ -57,16 +57,16 @@ FUNC FLT: MEDIAN(TNS: values){ RETURN(DIV(ADD(val1, val2), 0d2.0)) } -FUNC TNS: MODE(TNS: values){ - INT: n = TLEN(values, 0d1) +FUNC TNS MODE(TNS values){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { RETURN([ ]) } ! Count frequencies via MAP to avoid O(n^2) rescans. - MAP: counts = < FLT(values[1]) = 1 > + MAP counts = < FLT(values[1]) = 1 > IF(GT(n, 0d1)){ FOR(i, SUB(n, 0d1)){ - INT: idx = ADD(i, 0d1) - FLT: v = FLT(values[idx]) + INT idx = ADD(i, 0d1) + FLT v = FLT(values[idx]) IF(KEYIN(v, counts)){ counts = ADD(counts, 0d1) } ELSE { @@ -75,21 +75,21 @@ FUNC TNS: MODE(TNS: values){ } } - INT: max_count = MAX(VALUES(counts)) - TNS: keys = KEYS(counts) - INT: klen = TLEN(keys, 0d1) + INT max_count = MAX(VALUES(counts)) + TNS keys = KEYS(counts) + INT klen = TLEN(keys, 0d1) - INT: mode_count = 0d0 + INT mode_count = 0d0 FOR(i, klen){ - FLT: k = FLT(keys[i]) + FLT k = FLT(keys[i]) IF(EQ(counts, max_count)) { ADD(@mode_count, 0d1) } } IF(EQ(mode_count, 0d0)) { RETURN([ ]) } - TNS: out = TNS([mode_count], 0d0.0) - INT: out_i = 0d0 + TNS out = TNS([mode_count], 0d0.0) + INT out_i = 0d0 FOR(i, klen){ - FLT: k = FLT(keys[i]) + FLT k = FLT(keys[i]) IF(EQ(counts, max_count)){ ADD(@out_i, 0d1) out[out_i] = k @@ -98,32 +98,32 @@ FUNC TNS: MODE(TNS: values){ RETURN(out) } -FUNC FLT: HMEAN(TNS: values){ - INT: n = TLEN(values, 0d1) +FUNC FLT HMEAN(TNS values){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { THROW("empty input") } - FLT: denom = 0d0.0 + FLT denom = 0d0.0 FOR(i, n){ ADD(@denom, FDIV(0d1.0, values[i])) } RETURN(FDIV(n, denom)) } -FUNC FLT: QUANTILE(TNS: values, INT: q_num, INT: q_den){ - INT: n = TLEN(values, 0d1) +FUNC FLT QUANTILE(TNS values, INT q_num, INT q_den){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { THROW("empty input") } ! target index = floor(q * (n-1)) + 1, with q = q_num/q_den - INT: range = SUB(n, 0d1) - INT: prod = MUL(q_num, range) - INT: target = DIV(prod, q_den) - INT: k = ADD(target, 0d1) + INT range = SUB(n, 0d1) + INT prod = MUL(q_num, range) + INT target = DIV(prod, q_den) + INT k = ADD(target, 0d1) - FLT: out = 0d0.0 + FLT out = 0d0.0 FOR(i, n){ - FLT: cand = FLT(values[i]) - INT: less = 0d0 - INT: le = 0d0 + FLT cand = FLT(values[i]) + INT less = 0d0 + INT le = 0d0 FOR(j, n){ - FLT: v = FLT(values[j]) + FLT v = FLT(values[j]) IF(LT(v, cand)) { ADD(@less, 0d1) } IF(OR(LT(v, cand), EQ(v, cand))) { ADD(@le, 0d1) } } @@ -132,42 +132,42 @@ FUNC FLT: QUANTILE(TNS: values, INT: q_num, INT: q_den){ RETURN(out) } -FUNC FLT: VARIANCE(TNS: values, INT: sample = 0d0){ - INT: n = TLEN(values, 0d1) +FUNC FLT VARIANCE(TNS values, INT sample = 0d0){ + INT n = TLEN(values, 0d1) IF(EQ(n, 0d0)) { THROW("empty input") } - FLT: mean = MEAN(values) - FLT: var_sum = 0d0.0 + FLT mean = MEAN(values) + FLT var_sum = 0d0.0 FOR(i, n){ - FLT: diff = FSUB(values[i], mean) + FLT diff = FSUB(values[i], mean) ADD(@var_sum, MUL(diff, diff)) } - INT: denom = SUB(n, sample) + INT denom = SUB(n, sample) ! Tests expect integer-division semantics (truncation) for variance - FLT: raw = FDIV(var_sum, denom) - FLT: truncated = FLT(INT(raw)) + FLT raw = FDIV(var_sum, denom) + FLT truncated = FLT(INT(raw)) RETURN(truncated) } -FUNC FLT: STDEV(TNS: values, INT: sample = 0d0){ - FLT: var = VARIANCE(values, sample) +FUNC FLT STDEV(TNS values, INT sample = 0d0){ + FLT var = VARIANCE(values, sample) ! Square root: exponent 1/2 -> binary literal 0.1 (equals 0.5) RETURN(POW(var, 0d0.5)) } -FUNC TNS: HISTOGRAM(TNS: values, INT: bins){ - INT: n = TLEN(values, 0d1) +FUNC TNS HISTOGRAM(TNS values, INT bins){ + INT n = TLEN(values, 0d1) IF(OR(EQ(n, 0d0), LT(bins, 0d1))) { RETURN(TNS([bins], 0d0)) } ! find min and max - FLT: mn = FLT(values[0d1]) - FLT: mx = FLT(values[0d1]) + FLT mn = FLT(values[0d1]) + FLT mx = FLT(values[0d1]) FOR(i, n){ - FLT: v = FLT(values[i]) + FLT v = FLT(values[i]) IF(LT(v, mn)) { mn = v } IF(GT(v, mx)) { mx = v } } - TNS: hist = TNS([bins], 0d0) + TNS hist = TNS([bins], 0d0) IF(EQ(mn, mx)){ ! all values equal -> put all counts in first bin hist[0d1] = n @@ -175,22 +175,22 @@ FUNC TNS: HISTOGRAM(TNS: values, INT: bins){ } ! width denominator: (mx - mn + 1) to ensure max maps to last bin - FLT: den = ADD(SUB(mx, mn), 0d1.0) + FLT den = ADD(SUB(mx, mn), 0d1.0) FOR(i, n){ - FLT: offset = FSUB(values[i], mn) - FLT: ratio = FDIV(FMUL(offset, bins), den) - INT: bin = INT(ratio) + FLT offset = FSUB(values[i], mn) + FLT ratio = FDIV(FMUL(offset, bins), den) + INT bin = INT(ratio) ! bin ranges 0..bins-1 -> store at 1-based index - INT: bi = ADD(bin, 0d1) + INT bi = ADD(bin, 0d1) hist[bi] = ADD(hist[bi], 0d1) } RETURN(hist) } -FUNC TNS: DESCRIBE(TNS: values){ - INT: n = TLEN(values, 0d1) +FUNC TNS DESCRIBE(TNS values){ + INT n = TLEN(values, 0d1) ! desc layout: [count, mean, stdev, min, max] -> length 5 (binary 101) - TNS: desc = TNS([101], 0d0) + TNS desc = TNS([101], 0d0) IF(EQ(n, 0d0)){ desc[0d1] = 0d0 RETURN(desc) @@ -200,10 +200,10 @@ FUNC TNS: DESCRIBE(TNS: values){ desc[0d3] = INT(STDEV(values, 0d0)) ! min / max - FLT: mn = FLT(values[0d1]) - FLT: mx = FLT(values[0d1]) + FLT mn = FLT(values[0d1]) + FLT mx = FLT(values[0d1]) FOR(i, n){ - FLT: v = FLT(values[i]) + FLT v = FLT(values[i]) IF(LT(v, mn)) { mn = v } diff --git a/lib/std/waveforms.pre b/lib/std/waveforms.pre index b77465e..6f37d65 100644 --- a/lib/std/waveforms.pre +++ b/lib/std/waveforms.pre @@ -1,31 +1,31 @@ ! Waveform utilities ! MS_DEN is the number of milliseconds per second (1000). -INT: MS_DEN = 0d1000 +INT MS_DEN = 0d1000 ! Clamp audio-like values into a safe, conventional percent range [-100, 100]. -INT: AUDIO_MAX = 0d100 +INT AUDIO_MAX = 0d100 -FUNC INT: AUDIO_CLAMP(INT: v){ +FUNC INT AUDIO_CLAMP(INT v){ IF(GT(v, AUDIO_MAX)){ RETURN(AUDIO_MAX) } IF(LT(v, NEG(AUDIO_MAX))){ RETURN(NEG(AUDIO_MAX)) } RETURN(v) } -FUNC TNS: SQUARE(INT: freq, INT: ms, INT: amp, INT: sr){ +FUNC TNS SQUARE(INT freq, INT ms, INT amp, INT sr){ ASSERT(GT(freq, 0d0)) ASSERT(GT(ms, 0d0)) ASSERT(GT(sr, 0d0)) - INT: frames = DIV(MUL(sr, ms), MS_DEN) - TNS: shape = [frames] - TNS: out = TNS(shape, 0d0) + INT frames = DIV(MUL(sr, ms), MS_DEN) + TNS shape = [frames] + TNS out = TNS(shape, 0d0) DEL(shape) - INT: period = CDIV(sr, freq) + INT period = CDIV(sr, freq) IF(LTE(period, 0d0)){ RETURN(out) } - INT: half = DIV(period, 0d2) + INT half = DIV(period, 0d2) PARFOR(idx, frames){ - INT: pos = MOD(SUB(idx, 0d1), period) - INT: v = amp + INT pos = MOD(SUB(idx, 0d1), period) + INT v = amp IF(GTE(pos, half)){ v = NEG(amp) } out[idx] = AUDIO_CLAMP(v) } @@ -37,21 +37,21 @@ FUNC TNS: SQUARE(INT: freq, INT: ms, INT: amp, INT: sr){ RETURN(out) } -FUNC TNS: SAWTOOTH(INT: freq, INT: ms, INT: amp, INT: sr){ +FUNC TNS SAWTOOTH(INT freq, INT ms, INT amp, INT sr){ ASSERT(GT(freq, 0d0)) ASSERT(GT(ms, 0d0)) ASSERT(GT(sr, 0d0)) - INT: frames = DIV(MUL(sr, ms), MS_DEN) - TNS: shape = [frames] - TNS: out = TNS(shape, 0d0) + INT frames = DIV(MUL(sr, ms), MS_DEN) + TNS shape = [frames] + TNS out = TNS(shape, 0d0) DEL(shape) - INT: period = CDIV(sr, freq) + INT period = CDIV(sr, freq) IF(LTE(period, 0d0)){ RETURN(out) } PARFOR(idx, frames){ - INT: pos = MOD(SUB(idx, 0d1), period) - INT: num = MUL(MUL(MUL(pos, 0d4), amp), 0d1) - INT: tmp = DIV(num, period) - INT: v = SUB(tmp, amp) + INT pos = MOD(SUB(idx, 0d1), period) + INT num = MUL(MUL(MUL(pos, 0d4), amp), 0d1) + INT tmp = DIV(num, period) + INT v = SUB(tmp, amp) out[idx] = AUDIO_CLAMP(v) } DEL(frames) @@ -63,28 +63,28 @@ FUNC TNS: SAWTOOTH(INT: freq, INT: ms, INT: amp, INT: sr){ RETURN(out) } -FUNC TNS: TRIANGLE(INT: freq, INT: ms, INT: amp, INT: sr){ +FUNC TNS TRIANGLE(INT freq, INT ms, INT amp, INT sr){ ASSERT(GT(freq, 0d0)) ASSERT(GT(ms, 0d0)) ASSERT(GT(sr, 0d0)) - INT: frames = DIV(MUL(sr, ms), MS_DEN) - TNS: shape = [frames] - TNS: out = TNS(shape, 0d0) + INT frames = DIV(MUL(sr, ms), MS_DEN) + TNS shape = [frames] + TNS out = TNS(shape, 0d0) DEL(shape) - INT: period = CDIV(sr, freq) + INT period = CDIV(sr, freq) IF(LTE(period, 0d0)){ RETURN(out) } - INT: half = DIV(period, 0d2) + INT half = DIV(period, 0d2) PARFOR(idx, frames){ - INT: pos = MOD(SUB(idx, 0d1), period) - INT: v = 0d0 + INT pos = MOD(SUB(idx, 0d1), period) + INT v = 0d0 IF(LT(pos, half)){ - INT: num = MUL(MUL(MUL(pos, 0d4), amp), 0d1) - INT: tmp = DIV(num, period) + INT num = MUL(MUL(MUL(pos, 0d4), amp), 0d1) + INT tmp = DIV(num, period) v = ADD(NEG(amp), tmp) }ELSE{ - INT: t = SUB(pos, half) - INT: num = MUL(MUL(MUL(t, 0d4), amp), 0d1) - INT: tmp = DIV(num, period) + INT t = SUB(pos, half) + INT num = MUL(MUL(MUL(t, 0d4), amp), 0d1) + INT tmp = DIV(num, period) v = SUB(amp, tmp) } out[idx] = AUDIO_CLAMP(v) @@ -100,25 +100,25 @@ FUNC TNS: TRIANGLE(INT: freq, INT: ms, INT: amp, INT: sr){ RETURN(out) } -FUNC TNS: SINE(INT: freq, INT: ms, INT: amp, INT: sr){ +FUNC TNS SINE(INT freq, INT ms, INT amp, INT sr){ ASSERT(GT(freq, 0d0)) ASSERT(GT(ms, 0d0)) ASSERT(GT(sr, 0d0)) - INT: frames = DIV(MUL(sr, ms), MS_DEN) - TNS: shape = [frames] - TNS: base = SAWTOOTH(freq, ms, amp, sr) - TNS: out = TNS(shape, 0d0) + INT frames = DIV(MUL(sr, ms), MS_DEN) + TNS shape = [frames] + TNS base = SAWTOOTH(freq, ms, amp, sr) + TNS out = TNS(shape, 0d0) DEL(shape) PARFOR(idx, frames){ - INT: previ = idx + INT previ = idx IF(GT(idx, 0d1)){ previ = SUB(idx, 0d1) } - INT: nexti = idx + INT nexti = idx IF(LT(idx, frames)){ nexti = ADD(idx, 0d1) } - INT: a = base[previ] - INT: b = base[idx] - INT: c = base[nexti] - INT: sum = ADD(ADD(a, b), c) - INT: v = DIV(sum, 0d3) + INT a = base[previ] + INT b = base[idx] + INT c = base[nexti] + INT sum = ADD(ADD(a, b), c) + INT v = DIV(sum, 0d3) out[idx] = AUDIO_CLAMP(v) } DEL(frames) @@ -131,22 +131,22 @@ FUNC TNS: SINE(INT: freq, INT: ms, INT: amp, INT: sr){ RETURN(out) } -FUNC TNS: PULSE(INT: freq, INT: ms, INT: amp, INT: sr, INT: duty){ +FUNC TNS PULSE(INT freq, INT ms, INT amp, INT sr, INT duty){ ASSERT(GT(freq, 0d0)) ASSERT(GT(ms, 0d0)) ASSERT(GT(sr, 0d0)) ASSERT(GTE(duty, 0d0)) ASSERT(LTE(duty, 0d100)) - INT: frames = DIV(MUL(sr, ms), MS_DEN) - TNS: shape = [frames] - TNS: out = TNS(shape, 0d0) + INT frames = DIV(MUL(sr, ms), MS_DEN) + TNS shape = [frames] + TNS out = TNS(shape, 0d0) DEL(shape) - INT: period = CDIV(sr, freq) + INT period = CDIV(sr, freq) IF(LTE(period, 0d0)){ RETURN(out) } - INT: thresh = DIV(MUL(period, duty), 0d100) + INT thresh = DIV(MUL(period, duty), 0d100) PARFOR(idx, frames){ - INT: pos = MOD(SUB(idx, 0d1), period) - INT: v = amp + INT pos = MOD(SUB(idx, 0d1), period) + INT v = amp IF(GTE(pos, thresh)){ v = NEG(amp) } out[idx] = AUDIO_CLAMP(v) } @@ -160,63 +160,63 @@ FUNC TNS: PULSE(INT: freq, INT: ms, INT: amp, INT: sr, INT: duty){ ! Filters -FUNC TNS: ENVELOPE_ADSR( ^ - TNS: shape, ^ - INT: attack, ^ - INT: decay, ^ - INT: sustain, ^ - INT: release ^ +FUNC TNS ENVELOPE_ADSR( ^ + TNS shape, ^ + INT attack, ^ + INT decay, ^ + INT sustain, ^ + INT release ^ ){ ASSERT(GTE(attack, 0d0)) ASSERT(GTE(decay, 0d0)) ASSERT(GTE(sustain, 0d0)) ASSERT(GTE(release, 0d0)) ! determine frames from shape tensor ([1, frames] expected) - INT: slen = TLEN(shape, 0d1) - INT: frames = 0 + INT slen = TLEN(shape, 0d1) + INT frames = 0 IF(EQ(slen, 0d1)){ frames = shape[0d1] } ELSE { frames = shape[0d2] } - TNS: out = TNS(shape, 0d0) + TNS out = TNS(shape, 0d0) ! clamp segment lengths so they don't exceed frames - INT: a = attack + INT a = attack IF(GT(a, frames)){ a = frames } - INT: d = decay + INT d = decay IF(GT(ADD(a,d), frames)){ d = SUB(frames, a) } - INT: r = release + INT r = release IF(GT(ADD(ADD(a,d), r), frames)){ r = SUB(frames, ADD(a,d)) } - INT: s_len = SUB(frames, ADD(ADD(a,d), r)) + INT s_len = SUB(frames, ADD(ADD(a,d), r)) PARFOR(idx, frames){ - INT: z = SUB(idx, 0d1) - INT: v = 0d0 + INT z = SUB(idx, 0d1) + INT v = 0d0 IF(LT(z, a)){ ! attack: ramp 0 -> 100 IF(EQ(a, 0d0)){ v = 0d4 }ELSE{ - INT: num = MUL(idx, 0d4) + INT num = MUL(idx, 0d4) v = DIV(num, a) } } ELSE { - INT: pos = SUB(z, a) + INT pos = SUB(z, a) IF(LT(pos, d)){ ! decay: ramp 100 -> sustain IF(EQ(d, 0d0)){ v = sustain }ELSE{ - INT: num = MUL(SUB(0d4, sustain), SUB(d, pos)) - INT: tmp = DIV(num, d) + INT num = MUL(SUB(0d4, sustain), SUB(d, pos)) + INT tmp = DIV(num, d) v = ADD(sustain, tmp) } }ELSE{ - INT: pos2 = SUB(pos, d) + INT pos2 = SUB(pos, d) IF(LT(pos2, s_len)){ ! sustain region v = sustain }ELSE{ ! release region: ramp sustain -> 0 - INT: relpos = SUB(pos2, s_len) - INT: relrem = SUB(r, relpos) + INT relpos = SUB(pos2, s_len) + INT relrem = SUB(r, relpos) IF(OR(EQ(r, 0d0), LTE(relrem, 0d0))){ v = 0d0 }ELSE{ - INT: num = MUL(sustain, relrem) + INT num = MUL(sustain, relrem) v = DIV(num, r) } } @@ -233,30 +233,30 @@ FUNC TNS: ENVELOPE_ADSR( ^ RETURN(out) } -FUNC TNS: LOWPASS(TNS: inp, INT: cutoff, INT: sr){ +FUNC TNS LOWPASS(TNS inp, INT cutoff, INT sr){ ASSERT(GT(cutoff, 0d0)) ASSERT(GT(sr, 0d0)) - TNS: shape = SHAPE(inp) - INT: slen = TLEN(shape, 0d1) - INT: frames = 0 + TNS shape = SHAPE(inp) + INT slen = TLEN(shape, 0d1) + INT frames = 0 IF(EQ(slen, 0d1)){frames = shape[0d1] }ELSE{ frames = shape[0d2]} - TNS: out = TNS(shape, 0d0) - INT: period = CDIV(sr, cutoff) + TNS out = TNS(shape, 0d0) + INT period = CDIV(sr, cutoff) IF(LTE(period, 0d0)){ RETURN(out) } PARFOR(idx, frames){ - INT: z = SUB(idx, 0d1) + INT z = SUB(idx, 0d1) ! compute window start - INT: start = SUB(z, SUB(period, 0d1)) + INT start = SUB(z, SUB(period, 0d1)) IF(LT(start, 0d0)){ start = 0d0 } - INT: j = start - INT: sum = 0d0 + INT j = start + INT sum = 0d0 WHILE(LTE(j, z)){ - INT: sample = inp[ADD(j, 0d1)] + INT sample = inp[ADD(j, 0d1)] sum = ADD(sum, sample) j = ADD(j, 0d1) } - INT: count = SUB( ADD(z, 0d1), start ) - INT: avg = 0d0 + INT count = SUB( ADD(z, 0d1), start ) + INT avg = 0d0 IF(GTE(count, 0d1)){ avg = DIV(sum, count) } out[idx] = AUDIO_CLAMP(avg) } @@ -271,18 +271,18 @@ FUNC TNS: LOWPASS(TNS: inp, INT: cutoff, INT: sr){ RETURN(out) } -FUNC TNS: HIGHPASS(TNS: inp, INT: cutoff, INT: sr){ +FUNC TNS HIGHPASS(TNS inp, INT cutoff, INT sr){ ! highpass = original - lowpass - TNS: low = LOWPASS(inp, cutoff, sr) - TNS: shape = SHAPE(inp) - TNS: out = TNS(shape, 0d0) - INT: slen = TLEN(shape, 0d1) - INT: frames = 0d0 + TNS low = LOWPASS(inp, cutoff, sr) + TNS shape = SHAPE(inp) + TNS out = TNS(shape, 0d0) + INT slen = TLEN(shape, 0d1) + INT frames = 0d0 IF(EQ(slen, 0d1)){frames = shape[0d1]} ELSE {frames = shape[0d2]} PARFOR(idx, frames){ - INT: i1 = idx - INT: a = inp[i1] - INT: b = low[i1] + INT i1 = idx + INT a = inp[i1] + INT b = low[i1] out[i1] = AUDIO_CLAMP(SUB(a, b)) } DEL(slen) diff --git a/src/builtins.c b/src/builtins.c index 34fe0bb..ff46d0e 100644 --- a/src/builtins.c +++ b/src/builtins.c @@ -6572,45 +6572,25 @@ static Value builtin_signature(Interpreter* interp, Value* args, int argc, Expr* if (entry && entry->initialized) { if (entry->value.type == VAL_FUNC && entry->value.as.func != NULL) { struct Func* f = entry->value.as.func; - // Build signature in the canonical form: "FUNC R: name(T1: arg1, ... )" + // Build signature in the canonical form: "R name(T1 arg1, ...)" size_t cap = 512; char* buf = malloc(cap); if (!buf) RUNTIME_ERROR(interp, "Out of memory", line, col); buf[0] = '\0'; - const char* rname = "ANY"; - switch (f->return_type) { - case TYPE_BOOL: rname = "BOOL"; break; - case TYPE_INT: rname = "INT"; break; - case TYPE_FLT: rname = "FLT"; break; - case TYPE_STR: rname = "STR"; break; - case TYPE_TNS: rname = "TNS"; break; - case TYPE_MAP: rname = "MAP"; break; - case TYPE_FUNC: rname = "FUNC"; break; - case TYPE_THR: rname = "THR"; break; - default: rname = "ANY"; break; - } + const char* rname = decl_type_name(f->return_type); + if (strcmp(rname, "UNKNOWN") == 0) rname = "ANY"; strcat(buf, rname); - strcat(buf, ": "); + strcat(buf, " "); strcat(buf, f->name ? f->name : name); strcat(buf, "("); for (size_t i = 0; i < f->params.count; i++) { Param p = f->params.items[i]; - const char* tname = "UNKNOWN"; - switch (p.type) { - case TYPE_BOOL: tname = "BOOL"; break; - case TYPE_INT: tname = "INT"; break; - case TYPE_FLT: tname = "FLT"; break; - case TYPE_STR: tname = "STR"; break; - case TYPE_TNS: tname = "TNS"; break; - case TYPE_MAP: tname = "MAP"; break; - case TYPE_FUNC: tname = "FUNC"; break; - case TYPE_THR: tname = "THR"; break; - default: tname = "ANY"; break; - } + const char* tname = decl_type_name(p.type); + if (strcmp(tname, "UNKNOWN") == 0) tname = "ANY"; if (i > 0) strcat(buf, ", "); if (p.coerced) strcat(buf, "~"); strcat(buf, tname); - strcat(buf, ": "); + strcat(buf, " "); strcat(buf, p.name ? p.name : ""); if (p.default_value != NULL) { Value dv = eval_expr(interp, p.default_value, f->closure); @@ -6649,7 +6629,7 @@ static Value builtin_signature(Interpreter* interp, Value* args, int argc, Expr* } } - // Non-function: return "TYPE: name" using declared type if available + // Non-function: return "TYPE name" using declared type if available if (!entry) { RUNTIME_ERROR(interp, "SIGNATURE: identifier not found or uninitialized", line, col); } @@ -6668,7 +6648,7 @@ static Value builtin_signature(Interpreter* interp, Value* args, int argc, Expr* size_t len = strlen(tname) + 2 + strlen(name) + 1; char* res = malloc(len + 1); if (!res) RUNTIME_ERROR(interp, "Out of memory", line, col); - snprintf(res, len + 1, "%s: %s", tname, name); + snprintf(res, len + 1, "%s %s", tname, name); Value out = value_str(res); free(res); return out; diff --git a/src/parser.c b/src/parser.c index 70e0feb..1306bd8 100644 --- a/src/parser.c +++ b/src/parser.c @@ -33,12 +33,14 @@ void parser_init(Parser* parser, Lexer* lexer) { parser->error_col = 0; parser->current_token = lexer_next_token(parser->lexer); parser->next_token = lexer_next_token(parser->lexer); + parser->lookahead2_token = lexer_next_token(parser->lexer); } static void advance(Parser* parser) { parser->previous_token = parser->current_token; parser->current_token = parser->next_token; - parser->next_token = lexer_next_token(parser->lexer); + parser->next_token = parser->lookahead2_token; + parser->lookahead2_token = lexer_next_token(parser->lexer); /* If the lexer produced an error token, report it and advance until we reach a non-error token. Use a loop instead of recursion so the @@ -50,7 +52,8 @@ static void advance(Parser* parser) { parser->previous_token = parser->current_token; parser->current_token = parser->next_token; - parser->next_token = lexer_next_token(parser->lexer); + parser->next_token = parser->lookahead2_token; + parser->lookahead2_token = lexer_next_token(parser->lexer); } } @@ -88,6 +91,159 @@ static DeclType parse_type_name(const char* name) { return TYPE_UNKNOWN; } +static const char* k_type_name_gap_error = "Type annotations require one or more spaces between type and name"; + +static size_t token_source_width(const Token* token) { + if (!token) return 0; + if (token->literal) return strlen(token->literal); + + switch (token->type) { + case TOKEN_FUNC: return 4; + case TOKEN_THR: return 3; + default: return 0; + } +} + +static bool require_space_only_gap(Parser* parser, const Token* left, const Token* right, const char* message) { + char* line_text; + size_t line_len; + size_t left_width; + int gap_start_col; + int gap_end_col; + + if (!left || !right || right->type != TOKEN_IDENT) { + report_error(parser, message); + return false; + } + /* If tokens are on different physical lines, allow that only when the + characters between them in the raw source consist solely of spaces and + valid line-continuation sequences (caret followed by a newline or a + caret immediately before a comment). This implements the language's + caret continuation semantics so declarations split across physical + lines can still be treated as a single logical line. */ + if (left->line != right->line) { + Lexer* lexer = parser->lexer; + if (!lexer || !lexer->source) { + report_error(parser, message); + return false; + } + + left_width = token_source_width(left); + if (left_width == 0) { + report_error(parser, message); + return false; + } + + /* Compute absolute offsets for the end of the left token and the + start of the right token by scanning to each line start. */ + size_t idx = 0; + int cur_line = 1; + while (idx < lexer->source_len && cur_line < left->line) { + if (lexer->source[idx] == '\n') cur_line++; + idx++; + } + if (cur_line != left->line) { report_error(parser, message); return false; } + size_t left_line_start = idx; + size_t left_start_offset = left_line_start + (size_t)((left->column > 0) ? (left->column - 1) : 0); + size_t left_end_offset = left_start_offset + left_width; + + idx = 0; cur_line = 1; + while (idx < lexer->source_len && cur_line < right->line) { + if (lexer->source[idx] == '\n') cur_line++; + idx++; + } + if (cur_line != right->line) { report_error(parser, message); return false; } + size_t right_line_start = idx; + size_t right_start_offset = right_line_start + (size_t)((right->column > 0) ? (right->column - 1) : 0); + + if (right_start_offset <= left_end_offset) { report_error(parser, message); return false; } + + /* Walk the raw source between the two token offsets and accept only + spaces and valid caret-continuation sequences. */ + size_t pos = left_end_offset; + while (pos < right_start_offset) { + char ch = lexer->source[pos]; + if (ch == ' ') { pos++; continue; } + + if (ch == '^') { + /* Must match the same rules as the lexer: '^' followed by LF, + CR (optionally CRLF), or '!' (a comment) is a valid + continuation. Anything else is invalid here. */ + if (pos + 1 >= lexer->source_len) { report_error(parser, message); return false; } + char next = lexer->source[pos + 1]; + if (next == '\n') { pos += 2; continue; } + if (next == '\r') { pos += 2; if (pos < lexer->source_len && lexer->source[pos] == '\n') pos++; continue; } + if (next == '!') { + /* Skip '!' and the comment text until the line terminator. */ + pos += 2; + while (pos < lexer->source_len && lexer->source[pos] != '\n' && lexer->source[pos] != '\r') pos++; + if (pos < lexer->source_len) { + if (lexer->source[pos] == '\r') { pos++; if (pos < lexer->source_len && lexer->source[pos] == '\n') pos++; } + else if (lexer->source[pos] == '\n') pos++; + } + continue; + } + + report_error(parser, message); + return false; + } + + /* Any other character (including tabs or plain newlines) is invalid + as a gap between type and name. */ + report_error(parser, message); + return false; + } + + return true; + } + + left_width = token_source_width(left); + if (left_width == 0) { + report_error(parser, message); + return false; + } + + gap_start_col = left->column + (int)left_width; + gap_end_col = right->column - 1; + if (gap_end_col < gap_start_col) { + report_error(parser, message); + return false; + } + + line_text = lexer_get_line(parser->lexer, left->line); + if (!line_text) { + report_error(parser, message); + return false; + } + + line_len = strlen(line_text); + if ((size_t)gap_end_col > line_len) { + free(line_text); + report_error(parser, message); + return false; + } + + for (int col = gap_start_col; col <= gap_end_col; col++) { + if (line_text[col - 1] != ' ') { + free(line_text); + report_error(parser, message); + return false; + } + } + + free(line_text); + return true; +} + +static bool advance_to_annotated_name(Parser* parser, const char* message) { + if (!require_space_only_gap(parser, &parser->current_token, &parser->next_token, message)) { + return false; + } + + advance(parser); + return true; +} + static int base_from_literal_prefix(const char* s, size_t* prefix_len) { if (!s || s[0] != '0') return -1; char p = s[1]; @@ -208,6 +364,17 @@ static bool is_type_token(PTokenType type) { return type == TOKEN_IDENT || type == TOKEN_FUNC || type == TOKEN_THR; } +static bool starts_named_type_annotation(Parser* parser) { + return is_type_token(parser->current_token.type) && + (parser->next_token.type == TOKEN_IDENT || parser->next_token.type == TOKEN_COLON); +} + +static bool looks_like_func_definition(Parser* parser) { + return parser->current_token.type == TOKEN_FUNC && + is_type_token(parser->next_token.type) && + (parser->lookahead2_token.type == TOKEN_IDENT || parser->lookahead2_token.type == TOKEN_COLON); +} + static bool parse_param_list(Parser* parser, ParamList* params) { if (parser->current_token.type == TOKEN_RPAREN) return true; do { @@ -221,10 +388,7 @@ static bool parse_param_list(Parser* parser, ParamList* params) { return false; } DeclType ptype = parse_type_name(parser->current_token.literal); - advance(parser); - consume(parser, TOKEN_COLON, "Expected ':' after parameter type"); - if (parser->current_token.type != TOKEN_IDENT) { - report_error(parser, "Expected parameter name"); + if (!advance_to_annotated_name(parser, k_type_name_gap_error)) { return false; } Param param; @@ -245,10 +409,7 @@ static bool parse_param_list(Parser* parser, ParamList* params) { static Expr* parse_typed_ident_expr(Parser* parser) { Token type_tok = parser->current_token; DeclType dtype = parse_type_name(type_tok.literal); - advance(parser); - consume(parser, TOKEN_COLON, "Expected ':' after type"); - if (parser->current_token.type != TOKEN_IDENT) { - report_error(parser, "Expected identifier name"); + if (!advance_to_annotated_name(parser, k_type_name_gap_error)) { return NULL; } char* name = parser->current_token.literal; @@ -501,7 +662,7 @@ static Expr* parse_call(Parser* parser) { call->as.call.args.count == 0 && call->as.call.kw_count == 0 && is_type_token(parser->current_token.type) && - parser->next_token.type == TOKEN_COLON; + (parser->next_token.type == TOKEN_IDENT || parser->next_token.type == TOKEN_COLON); bool is_extend_specifier = call->as.call.callee->type == EXPR_IDENT && @@ -752,17 +913,13 @@ static Stmt* parse_try(Parser* parser) { static Stmt* parse_func(Parser* parser) { Token tok = parser->current_token; consume(parser, TOKEN_FUNC, "Expected 'FUNC'"); - /* FUNC R: name( params ) { body } */ + /* FUNC R name( params ) { body } */ if (!is_type_token(parser->current_token.type)) { report_error(parser, "Expected return type after FUNC"); return NULL; } DeclType ret = parse_type_name(parser->current_token.literal); - advance(parser); - consume(parser, TOKEN_COLON, "Expected ':' after return type"); - - if (parser->current_token.type != TOKEN_IDENT) { - report_error(parser, "Expected function name"); + if (!advance_to_annotated_name(parser, k_type_name_gap_error)) { return NULL; } char* name = parser->current_token.literal; @@ -780,18 +937,19 @@ static Stmt* parse_func(Parser* parser) { static Stmt* parse_statement(Parser* parser) { skip_newlines(parser); - // Handle typed declarations where the type token may be a keyword like THR - if ((parser->current_token.type == TOKEN_IDENT || parser->current_token.type == TOKEN_THR || parser->current_token.type == TOKEN_FUNC) && parser->next_token.type == TOKEN_COLON) { + if (looks_like_func_definition(parser)) { + return parse_func(parser); + } + + // Handle typed declarations where the type token may be a keyword like THR. + if (starts_named_type_annotation(parser)) { Token type_tok = parser->current_token; - advance(parser); - consume(parser, TOKEN_COLON, "Expected ':' after type"); - if (parser->current_token.type != TOKEN_IDENT) { - report_error(parser, "Expected identifier name"); + DeclType dtype = parse_type_name(type_tok.literal); + if (!advance_to_annotated_name(parser, k_type_name_gap_error)) { return NULL; } char* name = parser->current_token.literal; advance(parser); - DeclType dtype = parse_type_name(type_tok.literal); // Support typed declaration with indexed-assignment target, e.g. `TNS: t[1-10] = ...` if (parser->current_token.type == TOKEN_LBRACKET || parser->current_token.type == TOKEN_LANGLE) { // construct base identifier expr and parse trailing indexers @@ -992,17 +1150,14 @@ static Stmt* parse_statement(Parser* parser) { break; } - if ((parser->current_token.type == TOKEN_IDENT || parser->current_token.type == TOKEN_THR || parser->current_token.type == TOKEN_FUNC) && parser->next_token.type == TOKEN_COLON) { + if (starts_named_type_annotation(parser)) { Token type_tok = parser->current_token; - advance(parser); - consume(parser, TOKEN_COLON, "Expected ':' after type"); - if (parser->current_token.type != TOKEN_IDENT) { - report_error(parser, "Expected identifier name"); + DeclType dtype = parse_type_name(type_tok.literal); + if (!advance_to_annotated_name(parser, k_type_name_gap_error)) { return NULL; } char* name = parser->current_token.literal; advance(parser); - DeclType dtype = parse_type_name(type_tok.literal); if (match(parser, TOKEN_EQUALS)) { Expr* expr = parse_expression(parser); if (!expr) return NULL; diff --git a/src/parser.h b/src/parser.h index 820dea0..02ea051 100644 --- a/src/parser.h +++ b/src/parser.h @@ -10,6 +10,7 @@ typedef struct { Token current_token; Token previous_token; Token next_token; + Token lookahead2_token; bool panic_mode; bool had_error; char* error_msg; diff --git a/tests/cases/failing/abs-type-bool.pre b/tests/cases/failing/abs-type-bool.pre index b30a0e5..699c6fa 100644 --- a/tests/cases/failing/abs-type-bool.pre +++ b/tests/cases/failing/abs-type-bool.pre @@ -1,2 +1,2 @@ -BOOL: b = TRUE +BOOL b = TRUE ABS(b) diff --git a/tests/cases/failing/abs-type-str.pre b/tests/cases/failing/abs-type-str.pre index c36863a..ad52aa2 100644 --- a/tests/cases/failing/abs-type-str.pre +++ b/tests/cases/failing/abs-type-str.pre @@ -1,2 +1,2 @@ -STR: s = 'not-a-number' +STR s = 'not-a-number' ABS(s) diff --git a/tests/cases/failing/alias-cycle.pre b/tests/cases/failing/alias-cycle.pre index 4000ead..009c7d4 100644 --- a/tests/cases/failing/alias-cycle.pre +++ b/tests/cases/failing/alias-cycle.pre @@ -1,4 +1,4 @@ -MAP: x = <"v" = 0d1> -MAP: a = @x +MAP x = <"v" = 0d1> +MAP a = @x -MAP: x = @a +MAP x = @a diff --git a/tests/cases/failing/alias-to-frozen.pre b/tests/cases/failing/alias-to-frozen.pre index 6560061..ed7b6ff 100644 --- a/tests/cases/failing/alias-to-frozen.pre +++ b/tests/cases/failing/alias-to-frozen.pre @@ -1,4 +1,4 @@ -INT: t = 0d1 +INT t = 0d1 FREEZE(t) -INT: p = @t +INT p = @t diff --git a/tests/cases/failing/assign-map-index-on-bool.pre b/tests/cases/failing/assign-map-index-on-bool.pre index 46a77a3..c600275 100644 --- a/tests/cases/failing/assign-map-index-on-bool.pre +++ b/tests/cases/failing/assign-map-index-on-bool.pre @@ -1,2 +1,2 @@ -BOOL: b = TRUE +BOOL b = TRUE ASSIGN(b<"k">, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-flt.pre b/tests/cases/failing/assign-map-index-on-flt.pre index 5bd4263..725372c 100644 --- a/tests/cases/failing/assign-map-index-on-flt.pre +++ b/tests/cases/failing/assign-map-index-on-flt.pre @@ -1,2 +1,2 @@ -FLT: f = 0d1.5 +FLT f = 0d1.5 ASSIGN(f<0d1>, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-func.pre b/tests/cases/failing/assign-map-index-on-func.pre index 0f34bc1..15c2df4 100644 --- a/tests/cases/failing/assign-map-index-on-func.pre +++ b/tests/cases/failing/assign-map-index-on-func.pre @@ -1,2 +1,2 @@ -FUNC: fn = GET_FIVE +FUNC fn = GET_FIVE ASSIGN(fn<"k">, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-int.pre b/tests/cases/failing/assign-map-index-on-int.pre index c6536a2..dcb0991 100644 --- a/tests/cases/failing/assign-map-index-on-int.pre +++ b/tests/cases/failing/assign-map-index-on-int.pre @@ -1,2 +1,2 @@ -INT: i = 0d1 +INT i = 0d1 ASSIGN(i<0d1>, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-str.pre b/tests/cases/failing/assign-map-index-on-str.pre index f316a8c..04e1552 100644 --- a/tests/cases/failing/assign-map-index-on-str.pre +++ b/tests/cases/failing/assign-map-index-on-str.pre @@ -1,2 +1,2 @@ -STR: s = "x" +STR s = "x" ASSIGN(s<"k">, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-thr.pre b/tests/cases/failing/assign-map-index-on-thr.pre index 274f076..790de98 100644 --- a/tests/cases/failing/assign-map-index-on-thr.pre +++ b/tests/cases/failing/assign-map-index-on-thr.pre @@ -1,2 +1,2 @@ -THR: t = ASYNC{} +THR t = ASYNC{} ASSIGN(t<"k">, 0d1) diff --git a/tests/cases/failing/assign-map-index-on-tns.pre b/tests/cases/failing/assign-map-index-on-tns.pre index 68c816c..da70a01 100644 --- a/tests/cases/failing/assign-map-index-on-tns.pre +++ b/tests/cases/failing/assign-map-index-on-tns.pre @@ -1,2 +1,2 @@ -TNS: vec = [0d1, 0d2] +TNS vec = [0d1, 0d2] ASSIGN(vec<"a">, 0d1) diff --git a/tests/cases/failing/assign-tns-index-on-bool.pre b/tests/cases/failing/assign-tns-index-on-bool.pre index e4f3a56..831f841 100644 --- a/tests/cases/failing/assign-tns-index-on-bool.pre +++ b/tests/cases/failing/assign-tns-index-on-bool.pre @@ -1,2 +1,2 @@ -BOOL: b = TRUE +BOOL b = TRUE ASSIGN(b[0d1], 0d1) diff --git a/tests/cases/failing/assign-tns-index-on-flt.pre b/tests/cases/failing/assign-tns-index-on-flt.pre index 3054806..96d4ff2 100644 --- a/tests/cases/failing/assign-tns-index-on-flt.pre +++ b/tests/cases/failing/assign-tns-index-on-flt.pre @@ -1,2 +1,2 @@ -FLT: f = 0d1.5 +FLT f = 0d1.5 ASSIGN(f[0d1], 0d1) diff --git a/tests/cases/failing/assign-tns-index-on-func.pre b/tests/cases/failing/assign-tns-index-on-func.pre index cc7a007..cffaa6e 100644 --- a/tests/cases/failing/assign-tns-index-on-func.pre +++ b/tests/cases/failing/assign-tns-index-on-func.pre @@ -1,2 +1,2 @@ -FUNC: fn = GET_FIVE +FUNC fn = GET_FIVE ASSIGN(fn[0d1], 0d1) diff --git a/tests/cases/failing/assign-tns-index-on-int.pre b/tests/cases/failing/assign-tns-index-on-int.pre index 9d30756..5dd6c49 100644 --- a/tests/cases/failing/assign-tns-index-on-int.pre +++ b/tests/cases/failing/assign-tns-index-on-int.pre @@ -1,2 +1,2 @@ -INT: i = 0d1 +INT i = 0d1 ASSIGN(i[0d1], 0d2) diff --git a/tests/cases/failing/assign-tns-index-on-map.pre b/tests/cases/failing/assign-tns-index-on-map.pre index f2a9f6c..75de3bb 100644 --- a/tests/cases/failing/assign-tns-index-on-map.pre +++ b/tests/cases/failing/assign-tns-index-on-map.pre @@ -1,2 +1,2 @@ -MAP: m = <"a" = 0d1> +MAP m = <"a" = 0d1> ASSIGN(m[0d1], 0d2) diff --git a/tests/cases/failing/assign-tns-index-on-str.pre b/tests/cases/failing/assign-tns-index-on-str.pre index 032db74..648e57e 100644 --- a/tests/cases/failing/assign-tns-index-on-str.pre +++ b/tests/cases/failing/assign-tns-index-on-str.pre @@ -1,2 +1,2 @@ -STR: s = "x" +STR s = "x" ASSIGN(s[0d1], 0d1) diff --git a/tests/cases/failing/assign-tns-index-on-thr.pre b/tests/cases/failing/assign-tns-index-on-thr.pre index 478c8ba..637850a 100644 --- a/tests/cases/failing/assign-tns-index-on-thr.pre +++ b/tests/cases/failing/assign-tns-index-on-thr.pre @@ -1,2 +1,2 @@ -THR: t = ASYNC{} +THR t = ASYNC{} ASSIGN(t[0d1], 0d1) diff --git a/tests/cases/failing/at-in-ident.pre b/tests/cases/failing/at-in-ident.pre index de980ae..02cf2a0 100644 --- a/tests/cases/failing/at-in-ident.pre +++ b/tests/cases/failing/at-in-ident.pre @@ -1 +1 @@ -BOOL: x@ = TRUE +BOOL x@ = TRUE diff --git a/tests/cases/failing/bytes-first-func.pre b/tests/cases/failing/bytes-first-func.pre index f8a7fa2..39e8770 100644 --- a/tests/cases/failing/bytes-first-func.pre +++ b/tests/cases/failing/bytes-first-func.pre @@ -1,2 +1,2 @@ -FUNC INT: ff(INT: x){ RETURN x } +FUNC INT ff(INT x){ RETURN x } BYTES(ff) diff --git a/tests/cases/failing/bytes-second-func.pre b/tests/cases/failing/bytes-second-func.pre index beff874..6469025 100644 --- a/tests/cases/failing/bytes-second-func.pre +++ b/tests/cases/failing/bytes-second-func.pre @@ -1,2 +1,2 @@ -FUNC INT: ff(INT: x){ RETURN x } +FUNC INT ff(INT x){ RETURN x } BYTES(0d1, endian = ff) diff --git a/tests/cases/failing/close-curly-bracket-in-ident.pre b/tests/cases/failing/close-curly-bracket-in-ident.pre index 9e1a957..12bd350 100644 --- a/tests/cases/failing/close-curly-bracket-in-ident.pre +++ b/tests/cases/failing/close-curly-bracket-in-ident.pre @@ -1 +1 @@ -BOOL: x} = TRUE +BOOL x} = TRUE diff --git a/tests/cases/failing/close-parentheses-in-ident.pre b/tests/cases/failing/close-parentheses-in-ident.pre index e6c917e..8a23e01 100644 --- a/tests/cases/failing/close-parentheses-in-ident.pre +++ b/tests/cases/failing/close-parentheses-in-ident.pre @@ -1 +1 @@ -BOOL: x) = TRUE +BOOL x) = TRUE diff --git a/tests/cases/failing/close-square-bracket-in-ident.pre b/tests/cases/failing/close-square-bracket-in-ident.pre index ac42964..0f625cb 100644 --- a/tests/cases/failing/close-square-bracket-in-ident.pre +++ b/tests/cases/failing/close-square-bracket-in-ident.pre @@ -1 +1 @@ -BOOL: x] = TRUE +BOOL x] = TRUE diff --git a/tests/cases/failing/comma-in-ident.pre b/tests/cases/failing/comma-in-ident.pre index e919f40..6a5c1fe 100644 --- a/tests/cases/failing/comma-in-ident.pre +++ b/tests/cases/failing/comma-in-ident.pre @@ -1 +1 @@ -BOOL: x, = TRUE +BOOL x, = TRUE diff --git a/tests/cases/failing/conv-pointer-writeback.pre b/tests/cases/failing/conv-pointer-writeback.pre index a86e668..62fff82 100644 --- a/tests/cases/failing/conv-pointer-writeback.pre +++ b/tests/cases/failing/conv-pointer-writeback.pre @@ -1,16 +1,16 @@ // CONV should write back to pointer operands when passed. -TNS: x1 = [0d1, 0d2, 0d3] -TNS: k1 = [0d1, 0d0, 0d1] +TNS x1 = [0d1, 0d2, 0d3] +TNS k1 = [0d1, 0d0, 0d1] CONV(@x1, k1) ASSERT(EQ(x1, [0d3, 0d4, 0d5])) -TNS: x2 = [0d1, 0d2, 0d3] -TNS: k2 = [0d1, 0d0, 0d1] +TNS x2 = [0d1, 0d2, 0d3] +TNS k2 = [0d1, 0d0, 0d1] CONV(x2, @k2) ASSERT(EQ(k2, [0d3, 0d4, 0d5])) -TNS: x3 = [0d1, 0d2, 0d3] -TNS: k3 = [0d1, 0d0, 0d1] +TNS x3 = [0d1, 0d2, 0d3] +TNS k3 = [0d1, 0d0, 0d1] CONV(@x3, @k3) ASSERT(EQ(x3, [0d3, 0d4, 0d5])) ASSERT(EQ(k3, [0d3, 0d4, 0d5])) diff --git a/tests/cases/failing/del-already-deleted-symbol.pre b/tests/cases/failing/del-already-deleted-symbol.pre index 7bed578..fa742cb 100644 --- a/tests/cases/failing/del-already-deleted-symbol.pre +++ b/tests/cases/failing/del-already-deleted-symbol.pre @@ -1,3 +1,3 @@ -BOOL: x = TRUE +BOOL x = TRUE DEL(x) DEL(x) diff --git a/tests/cases/failing/del-map-intermediate-not-map.pre b/tests/cases/failing/del-map-intermediate-not-map.pre index ff369a4..508ee62 100644 --- a/tests/cases/failing/del-map-intermediate-not-map.pre +++ b/tests/cases/failing/del-map-intermediate-not-map.pre @@ -1,2 +1,2 @@ -MAP: value = <"branch" = 0d1> +MAP value = <"branch" = 0d1> DEL(value<"branch", "leaf">) diff --git a/tests/cases/failing/del-map-target-not-map.pre b/tests/cases/failing/del-map-target-not-map.pre index 364d22b..1c21260 100644 --- a/tests/cases/failing/del-map-target-not-map.pre +++ b/tests/cases/failing/del-map-target-not-map.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 DEL(value<"key">) diff --git a/tests/cases/failing/del-never-assigned-symbol.pre b/tests/cases/failing/del-never-assigned-symbol.pre index 27a2a8c..d9bab64 100644 --- a/tests/cases/failing/del-never-assigned-symbol.pre +++ b/tests/cases/failing/del-never-assigned-symbol.pre @@ -1,2 +1,2 @@ -BOOL: x +BOOL x DEL(x) diff --git a/tests/cases/failing/del-type-mismatch-after-delete.pre b/tests/cases/failing/del-type-mismatch-after-delete.pre index 8986a74..0514b12 100644 --- a/tests/cases/failing/del-type-mismatch-after-delete.pre +++ b/tests/cases/failing/del-type-mismatch-after-delete.pre @@ -1,3 +1,3 @@ -INT: x = 0d1 +INT x = 0d1 DEL(x) -BOOL: x = TRUE +BOOL x = TRUE diff --git a/tests/cases/failing/deletefile-arity-two.pre b/tests/cases/failing/deletefile-arity-two.pre index e55f467..ae19790 100644 --- a/tests/cases/failing/deletefile-arity-two.pre +++ b/tests/cases/failing/deletefile-arity-two.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("temp.txt") +STR p = path.TEMPFILE("temp.txt") WRITEFILE("Prefix", p) ASSERT(EXISTFILE(p)) ASSERT(DELETEFILE(p, "Prefix")) \ No newline at end of file diff --git a/tests/cases/failing/equals-in-ident.pre b/tests/cases/failing/equals-in-ident.pre index 55d7986..5e7882f 100644 --- a/tests/cases/failing/equals-in-ident.pre +++ b/tests/cases/failing/equals-in-ident.pre @@ -1 +1 @@ -BOOL: x= = TRUE +BOOL x= = TRUE diff --git a/tests/cases/failing/export-arity-one.pre b/tests/cases/failing/export-arity-one.pre index 5bd2aa4..ca8ce5a 100644 --- a/tests/cases/failing/export-arity-one.pre +++ b/tests/cases/failing/export-arity-one.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value) \ No newline at end of file diff --git a/tests/cases/failing/export-arity-three.pre b/tests/cases/failing/export-arity-three.pre index 407f96e..6490926 100644 --- a/tests/cases/failing/export-arity-three.pre +++ b/tests/cases/failing/export-arity-three.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, helper, extra) \ No newline at end of file diff --git a/tests/cases/failing/export-declared-only-symbol.pre b/tests/cases/failing/export-declared-only-symbol.pre index 3546747..891d79b 100644 --- a/tests/cases/failing/export-declared-only-symbol.pre +++ b/tests/cases/failing/export-declared-only-symbol.pre @@ -1,9 +1,9 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) -INT: value +INT value EXPORT(value, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-deleted-symbol.pre b/tests/cases/failing/export-deleted-symbol.pre index fb0e0b3..c84219f 100644 --- a/tests/cases/failing/export-deleted-symbol.pre +++ b/tests/cases/failing/export-deleted-symbol.pre @@ -1,10 +1,10 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) -INT: value = 0d1 +INT value = 0d1 DEL(value) EXPORT(value, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-bool.pre b/tests/cases/failing/export-module-type-bool.pre index 9f18ae6..713360f 100644 --- a/tests/cases/failing/export-module-type-bool.pre +++ b/tests/cases/failing/export-module-type-bool.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, TRUE) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-flt.pre b/tests/cases/failing/export-module-type-flt.pre index 835d784..ed80c1a 100644 --- a/tests/cases/failing/export-module-type-flt.pre +++ b/tests/cases/failing/export-module-type-flt.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, 0d1.0) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-func.pre b/tests/cases/failing/export-module-type-func.pre index a5ed819..d612d3e 100644 --- a/tests/cases/failing/export-module-type-func.pre +++ b/tests/cases/failing/export-module-type-func.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, LAMBDA BOOL: (){}) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-int.pre b/tests/cases/failing/export-module-type-int.pre index c6b86f9..bce3521 100644 --- a/tests/cases/failing/export-module-type-int.pre +++ b/tests/cases/failing/export-module-type-int.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, 0d1) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-map.pre b/tests/cases/failing/export-module-type-map.pre index 2c23fc2..2d61785 100644 --- a/tests/cases/failing/export-module-type-map.pre +++ b/tests/cases/failing/export-module-type-map.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, <>) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-str.pre b/tests/cases/failing/export-module-type-str.pre index a7f260f..f1c8cf2 100644 --- a/tests/cases/failing/export-module-type-str.pre +++ b/tests/cases/failing/export-module-type-str.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, "helper") \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-thr.pre b/tests/cases/failing/export-module-type-thr.pre index d515d1b..ec93917 100644 --- a/tests/cases/failing/export-module-type-thr.pre +++ b/tests/cases/failing/export-module-type-thr.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, ASYNC{}) \ No newline at end of file diff --git a/tests/cases/failing/export-module-type-tns.pre b/tests/cases/failing/export-module-type-tns.pre index 9a3d2b1..a8de398 100644 --- a/tests/cases/failing/export-module-type-tns.pre +++ b/tests/cases/failing/export-module-type-tns.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, [0d1]) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-bool.pre b/tests/cases/failing/export-symbol-type-bool.pre index 7aa1b28..9505c3a 100644 --- a/tests/cases/failing/export-symbol-type-bool.pre +++ b/tests/cases/failing/export-symbol-type-bool.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(TRUE, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-flt.pre b/tests/cases/failing/export-symbol-type-flt.pre index b8f6c79..dde9d69 100644 --- a/tests/cases/failing/export-symbol-type-flt.pre +++ b/tests/cases/failing/export-symbol-type-flt.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(0d1.0, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-func.pre b/tests/cases/failing/export-symbol-type-func.pre index 76a7d6f..d34be31 100644 --- a/tests/cases/failing/export-symbol-type-func.pre +++ b/tests/cases/failing/export-symbol-type-func.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(LAMBDA BOOL: (){}, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-int.pre b/tests/cases/failing/export-symbol-type-int.pre index c90d19a..03bc234 100644 --- a/tests/cases/failing/export-symbol-type-int.pre +++ b/tests/cases/failing/export-symbol-type-int.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(0d1, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-map.pre b/tests/cases/failing/export-symbol-type-map.pre index 71cf7ea..81b74bb 100644 --- a/tests/cases/failing/export-symbol-type-map.pre +++ b/tests/cases/failing/export-symbol-type-map.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(<>, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-str.pre b/tests/cases/failing/export-symbol-type-str.pre index d696f8d..81df86d 100644 --- a/tests/cases/failing/export-symbol-type-str.pre +++ b/tests/cases/failing/export-symbol-type-str.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT("value", helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-thr.pre b/tests/cases/failing/export-symbol-type-thr.pre index 94f556c..588db21 100644 --- a/tests/cases/failing/export-symbol-type-thr.pre +++ b/tests/cases/failing/export-symbol-type-thr.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(ASYNC{}, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-symbol-type-tns.pre b/tests/cases/failing/export-symbol-type-tns.pre index a71baee..2403cb5 100644 --- a/tests/cases/failing/export-symbol-type-tns.pre +++ b/tests/cases/failing/export-symbol-type-tns.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT([0d1], helper) \ No newline at end of file diff --git a/tests/cases/failing/export-undeclared-symbol.pre b/tests/cases/failing/export-undeclared-symbol.pre index b4187ce..ec23150 100644 --- a/tests/cases/failing/export-undeclared-symbol.pre +++ b/tests/cases/failing/export-undeclared-symbol.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) EXPORT(value, helper) \ No newline at end of file diff --git a/tests/cases/failing/export-unimported-module.pre b/tests/cases/failing/export-unimported-module.pre index dfde911..cb2e7c7 100644 --- a/tests/cases/failing/export-unimported-module.pre +++ b/tests/cases/failing/export-unimported-module.pre @@ -1,2 +1,2 @@ -INT: value = 0d1 +INT value = 0d1 EXPORT(value, helper) \ No newline at end of file diff --git a/tests/cases/failing/extend-asmodule-not-qualified.pre b/tests/cases/failing/extend-asmodule-not-qualified.pre index 860dea1..d57bc40 100644 --- a/tests/cases/failing/extend-asmodule-not-qualified.pre +++ b/tests/cases/failing/extend-asmodule-not-qualified.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") IMPORT_PATH(helper_path, helper) diff --git a/tests/cases/failing/extend-missing-init-symbol.pre b/tests/cases/failing/extend-missing-init-symbol.pre index 3756d3e..c05a05f 100644 --- a/tests/cases/failing/extend-missing-init-symbol.pre +++ b/tests/cases/failing/extend-missing-init-symbol.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_missing_init_loader.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_missing_init_loader.pre") IMPORT_PATH(helper_path) \ No newline at end of file diff --git a/tests/cases/failing/extend-package-missing-init.pre b/tests/cases/failing/extend-package-missing-init.pre index f9cbc7b..3332217 100644 --- a/tests/cases/failing/extend-package-missing-init.pre +++ b/tests/cases/failing/extend-package-missing-init.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_missing_package_loader.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_missing_package_loader.pre") IMPORT_PATH(helper_path) \ No newline at end of file diff --git a/tests/cases/failing/extend-prex-rejected.pre b/tests/cases/failing/extend-prex-rejected.pre index 7603249..ae20d25 100644 --- a/tests/cases/failing/extend-prex-rejected.pre +++ b/tests/cases/failing/extend-prex-rejected.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_prex_loader.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_prex_loader.pre") IMPORT_PATH(helper_path) \ No newline at end of file diff --git a/tests/cases/failing/extend-restricted-not-global.pre b/tests/cases/failing/extend-restricted-not-global.pre index d539bdd..5da8d6b 100644 --- a/tests/cases/failing/extend-restricted-not-global.pre +++ b/tests/cases/failing/extend-restricted-not-global.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") IMPORT_PATH(helper_path, helper) diff --git a/tests/cases/failing/fill-tflip-pointer-writeback.pre b/tests/cases/failing/fill-tflip-pointer-writeback.pre index 447c994..1efff33 100644 --- a/tests/cases/failing/fill-tflip-pointer-writeback.pre +++ b/tests/cases/failing/fill-tflip-pointer-writeback.pre @@ -1,8 +1,8 @@ // FILL / TFLIP writeback expectations -TNS: dst1 = [0d0, 0d0, 0d0] +TNS dst1 = [0d0, 0d0, 0d0] FILL(@dst1, 0d7) ASSERT(EQ(dst1, [0d7, 0d7, 0d7])) -TNS: a1 = [[0d1, 0d2], [0d3, 0d4]] +TNS a1 = [[0d1, 0d2], [0d3, 0d4]] TFLIP(@a1) ASSERT(EQ(a1, [[0d1, 0d3], [0d2, 0d4]])) diff --git a/tests/cases/failing/flt-invalid-digit.pre b/tests/cases/failing/flt-invalid-digit.pre index eee4aaa..68abc46 100644 --- a/tests/cases/failing/flt-invalid-digit.pre +++ b/tests/cases/failing/flt-invalid-digit.pre @@ -1 +1 @@ -FLT: a = 0b2.0 +FLT a = 0b2.0 diff --git a/tests/cases/failing/flt-negative-nan.pre b/tests/cases/failing/flt-negative-nan.pre index c16ad08..924a741 100644 --- a/tests/cases/failing/flt-negative-nan.pre +++ b/tests/cases/failing/flt-negative-nan.pre @@ -1 +1 @@ -FLT: bad = -NaN +FLT bad = -NaN diff --git a/tests/cases/failing/flt-no-fraction.pre b/tests/cases/failing/flt-no-fraction.pre index 22bc75c..3d9b9fd 100644 --- a/tests/cases/failing/flt-no-fraction.pre +++ b/tests/cases/failing/flt-no-fraction.pre @@ -1 +1 @@ -FLT: a = 0d1. +FLT a = 0d1. diff --git a/tests/cases/failing/flt-no-integer.pre b/tests/cases/failing/flt-no-integer.pre index 7a2edb3..c6f9aab 100644 --- a/tests/cases/failing/flt-no-integer.pre +++ b/tests/cases/failing/flt-no-integer.pre @@ -1 +1 @@ -FLT: a = 0d.5 +FLT a = 0d.5 diff --git a/tests/cases/failing/flt-plus-sign.pre b/tests/cases/failing/flt-plus-sign.pre index ee5afb7..08c5c47 100644 --- a/tests/cases/failing/flt-plus-sign.pre +++ b/tests/cases/failing/flt-plus-sign.pre @@ -1 +1 @@ -FLT: a = +0d1.0 +FLT a = +0d1.0 diff --git a/tests/cases/failing/func-default-before-positional.pre b/tests/cases/failing/func-default-before-positional.pre index ab02dc0..a294c82 100644 --- a/tests/cases/failing/func-default-before-positional.pre +++ b/tests/cases/failing/func-default-before-positional.pre @@ -1,3 +1,3 @@ -FUNC INT: sample(INT: first = 0d1, INT: second){ +FUNC INT sample(INT first = 0d1, INT second){ RETURN(ADD(first, second)) } diff --git a/tests/cases/failing/func-missing-param-type.pre b/tests/cases/failing/func-missing-param-type.pre index fbf45d8..9d51adf 100644 --- a/tests/cases/failing/func-missing-param-type.pre +++ b/tests/cases/failing/func-missing-param-type.pre @@ -1,3 +1,3 @@ -FUNC INT: sample(value){ +FUNC INT sample(value){ RETURN(value) } \ No newline at end of file diff --git a/tests/cases/failing/func-missing-return-type.pre b/tests/cases/failing/func-missing-return-type.pre index 146423e..0705297 100644 --- a/tests/cases/failing/func-missing-return-type.pre +++ b/tests/cases/failing/func-missing-return-type.pre @@ -1,3 +1,3 @@ -FUNC sample(INT: value){ +FUNC sample(INT value){ RETURN(value) } \ No newline at end of file diff --git a/tests/cases/failing/func-name-conflicts-builtin.pre b/tests/cases/failing/func-name-conflicts-builtin.pre index 9e26e33..427643f 100644 --- a/tests/cases/failing/func-name-conflicts-builtin.pre +++ b/tests/cases/failing/func-name-conflicts-builtin.pre @@ -1,3 +1,3 @@ -FUNC INT: ASSERT(){ +FUNC INT ASSERT(){ RETURN(0d0) } \ No newline at end of file diff --git a/tests/cases/failing/func-name-conflicts-symbol.pre b/tests/cases/failing/func-name-conflicts-symbol.pre index 5ef9b0c..2a7294f 100644 --- a/tests/cases/failing/func-name-conflicts-symbol.pre +++ b/tests/cases/failing/func-name-conflicts-symbol.pre @@ -1,4 +1,4 @@ -INT: sample = 0d1 -FUNC INT: sample(){ +INT sample = 0d1 +FUNC INT sample(){ RETURN(0d0) } \ No newline at end of file diff --git a/tests/cases/failing/func-positional-after-keyword.pre b/tests/cases/failing/func-positional-after-keyword.pre index e24547e..e13212a 100644 --- a/tests/cases/failing/func-positional-after-keyword.pre +++ b/tests/cases/failing/func-positional-after-keyword.pre @@ -1,4 +1,4 @@ -FUNC INT: sample(INT: left, INT: right = 0d0){ +FUNC INT sample(INT left, INT right = 0d0){ RETURN(ADD(left, right)) } diff --git a/tests/cases/failing/hash-in-ident.pre b/tests/cases/failing/hash-in-ident.pre index 08595b7..143bad9 100644 --- a/tests/cases/failing/hash-in-ident.pre +++ b/tests/cases/failing/hash-in-ident.pre @@ -1 +1 @@ -BOOL: x# = TRUE +BOOL x# = TRUE diff --git a/tests/cases/failing/idiv-zero-int.pre b/tests/cases/failing/idiv-zero-int.pre index 526e25a..75bdece 100644 --- a/tests/cases/failing/idiv-zero-int.pre +++ b/tests/cases/failing/idiv-zero-int.pre @@ -1,3 +1,3 @@ -INT: a = 0d1 -INT: b = 0d0 +INT a = 0d1 +INT b = 0d0 IDIV(a, b) diff --git a/tests/cases/failing/import_path-alias-type-bool.pre b/tests/cases/failing/import_path-alias-type-bool.pre index 3df4102..a82b5bb 100644 --- a/tests/cases/failing/import_path-alias-type-bool.pre +++ b/tests/cases/failing/import_path-alias-type-bool.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, TRUE) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-flt.pre b/tests/cases/failing/import_path-alias-type-flt.pre index 503fe57..fb3384b 100644 --- a/tests/cases/failing/import_path-alias-type-flt.pre +++ b/tests/cases/failing/import_path-alias-type-flt.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, 0d1.0) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-func.pre b/tests/cases/failing/import_path-alias-type-func.pre index c0e4731..761032f 100644 --- a/tests/cases/failing/import_path-alias-type-func.pre +++ b/tests/cases/failing/import_path-alias-type-func.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, LAMBDA BOOL: (){}) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-int.pre b/tests/cases/failing/import_path-alias-type-int.pre index 7c7f623..359181b 100644 --- a/tests/cases/failing/import_path-alias-type-int.pre +++ b/tests/cases/failing/import_path-alias-type-int.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, 0d1) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-map.pre b/tests/cases/failing/import_path-alias-type-map.pre index e563932..8511b68 100644 --- a/tests/cases/failing/import_path-alias-type-map.pre +++ b/tests/cases/failing/import_path-alias-type-map.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, <>) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-str.pre b/tests/cases/failing/import_path-alias-type-str.pre index 3444593..27789b4 100644 --- a/tests/cases/failing/import_path-alias-type-str.pre +++ b/tests/cases/failing/import_path-alias-type-str.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, "helper") \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-thr.pre b/tests/cases/failing/import_path-alias-type-thr.pre index e8abaf7..84efc80 100644 --- a/tests/cases/failing/import_path-alias-type-thr.pre +++ b/tests/cases/failing/import_path-alias-type-thr.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, ASYNC{}) \ No newline at end of file diff --git a/tests/cases/failing/import_path-alias-type-tns.pre b/tests/cases/failing/import_path-alias-type-tns.pre index 2057c9f..bc0a5c6 100644 --- a/tests/cases/failing/import_path-alias-type-tns.pre +++ b/tests/cases/failing/import_path-alias-type-tns.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") IMPORT_PATH(helper_path, [0d1]) \ No newline at end of file diff --git a/tests/cases/failing/import_path-missing-file.pre b/tests/cases/failing/import_path-missing-file.pre index bb3ce5d..dc400ee 100644 --- a/tests/cases/failing/import_path-missing-file.pre +++ b/tests/cases/failing/import_path-missing-file.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: missing_path = JOIN(tests_dir, "/helpers/import_path_missing_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR missing_path = JOIN(tests_dir, "/helpers/import_path_missing_target.pre") IMPORT_PATH(missing_path) \ No newline at end of file diff --git a/tests/cases/failing/import_path-qualified-only.pre b/tests/cases/failing/import_path-qualified-only.pre index b590bf5..afa4f33 100644 --- a/tests/cases/failing/import_path-qualified-only.pre +++ b/tests/cases/failing/import_path-qualified-only.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_hidden_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_hidden_target.pre") IMPORT_PATH(helper_path) diff --git a/tests/cases/failing/int-invalid-digit.pre b/tests/cases/failing/int-invalid-digit.pre index ce7f728..0beb7de 100644 --- a/tests/cases/failing/int-invalid-digit.pre +++ b/tests/cases/failing/int-invalid-digit.pre @@ -1,3 +1,3 @@ -INT: a = 0b2 -INT: b = 0o8 -INT: c = 0xG +INT a = 0b2 +INT b = 0o8 +INT c = 0xG diff --git a/tests/cases/failing/int-missing-digits.pre b/tests/cases/failing/int-missing-digits.pre index 20fce0c..0bfc6f0 100644 --- a/tests/cases/failing/int-missing-digits.pre +++ b/tests/cases/failing/int-missing-digits.pre @@ -1 +1 @@ -INT: a = 0d +INT a = 0d diff --git a/tests/cases/failing/int-plus-sign.pre b/tests/cases/failing/int-plus-sign.pre index 36fa83f..41dde8b 100644 --- a/tests/cases/failing/int-plus-sign.pre +++ b/tests/cases/failing/int-plus-sign.pre @@ -1 +1 @@ -INT: a = +0d1 +INT a = +0d1 diff --git a/tests/cases/failing/int-r-bad-format.pre b/tests/cases/failing/int-r-bad-format.pre index 6f83c2b..1b2853e 100644 --- a/tests/cases/failing/int-r-bad-format.pre +++ b/tests/cases/failing/int-r-bad-format.pre @@ -1,2 +1,2 @@ -INT: a = 0r1 -INT: b = 0r1A123 +INT a = 0r1 +INT b = 0r1A123 diff --git a/tests/cases/failing/int-r-base-too-large.pre b/tests/cases/failing/int-r-base-too-large.pre index c7941f4..d7112e4 100644 --- a/tests/cases/failing/int-r-base-too-large.pre +++ b/tests/cases/failing/int-r-base-too-large.pre @@ -1 +1 @@ -INT: b = 0r651 +INT b = 0r651 diff --git a/tests/cases/failing/int-r-base-too-small.pre b/tests/cases/failing/int-r-base-too-small.pre index 11bcef2..7881636 100644 --- a/tests/cases/failing/int-r-base-too-small.pre +++ b/tests/cases/failing/int-r-base-too-small.pre @@ -1 +1 @@ -INT: a = 0r011 +INT a = 0r011 diff --git a/tests/cases/failing/int-r-missing-digits.pre b/tests/cases/failing/int-r-missing-digits.pre index 99bd7ee..51ded28 100644 --- a/tests/cases/failing/int-r-missing-digits.pre +++ b/tests/cases/failing/int-r-missing-digits.pre @@ -1 +1 @@ -INT: a = 0r10 +INT a = 0r10 diff --git a/tests/cases/failing/lambda-default-before-positional.pre b/tests/cases/failing/lambda-default-before-positional.pre index e84fca6..6143f15 100644 --- a/tests/cases/failing/lambda-default-before-positional.pre +++ b/tests/cases/failing/lambda-default-before-positional.pre @@ -1,3 +1,3 @@ -FUNC: sample = LAMBDA INT: (INT: first = 0d1, INT: second){ +FUNC sample = LAMBDA INT: (INT first = 0d1, INT second){ RETURN(ADD(first, second)) } \ No newline at end of file diff --git a/tests/cases/failing/lambda-missing-param-type.pre b/tests/cases/failing/lambda-missing-param-type.pre index db95a47..ca6e36d 100644 --- a/tests/cases/failing/lambda-missing-param-type.pre +++ b/tests/cases/failing/lambda-missing-param-type.pre @@ -1,3 +1,3 @@ -FUNC: sample = LAMBDA INT: (value){ +FUNC sample = LAMBDA INT: (value){ RETURN(value) } \ No newline at end of file diff --git a/tests/cases/failing/lambda-missing-return-type.pre b/tests/cases/failing/lambda-missing-return-type.pre index 5283b22..22c2f45 100644 --- a/tests/cases/failing/lambda-missing-return-type.pre +++ b/tests/cases/failing/lambda-missing-return-type.pre @@ -1,3 +1,3 @@ -FUNC: sample = LAMBDA (INT: value){ +FUNC sample = LAMBDA (INT value){ RETURN(value) } \ No newline at end of file diff --git a/tests/cases/failing/map-literal-bad-key-bool.pre b/tests/cases/failing/map-literal-bad-key-bool.pre index 1800db6..f3894b5 100644 --- a/tests/cases/failing/map-literal-bad-key-bool.pre +++ b/tests/cases/failing/map-literal-bad-key-bool.pre @@ -1 +1 @@ -MAP: bad = +MAP bad = diff --git a/tests/cases/failing/map-literal-bad-key-tns.pre b/tests/cases/failing/map-literal-bad-key-tns.pre index 96ce9aa..9f300f6 100644 --- a/tests/cases/failing/map-literal-bad-key-tns.pre +++ b/tests/cases/failing/map-literal-bad-key-tns.pre @@ -1 +1 @@ -MAP: bad = <[0d1] = 0d1> +MAP bad = <[0d1] = 0d1> diff --git a/tests/cases/failing/map-literal-missing-equals.pre b/tests/cases/failing/map-literal-missing-equals.pre index dd70b20..9f8f4dc 100644 --- a/tests/cases/failing/map-literal-missing-equals.pre +++ b/tests/cases/failing/map-literal-missing-equals.pre @@ -1 +1 @@ -MAP: bad = <"a" 0d1> +MAP bad = <"a" 0d1> diff --git a/tests/cases/failing/map-literal-self-bad-key.pre b/tests/cases/failing/map-literal-self-bad-key.pre index 90acefe..edd8717 100644 --- a/tests/cases/failing/map-literal-self-bad-key.pre +++ b/tests/cases/failing/map-literal-self-bad-key.pre @@ -1 +1 @@ -MAP: bad = <"value" = 0d1, "copy" = SELF> +MAP bad = <"value" = 0d1, "copy" = SELF> diff --git a/tests/cases/failing/map-literal-self-forward.pre b/tests/cases/failing/map-literal-self-forward.pre index d7f82f8..14b1379 100644 --- a/tests/cases/failing/map-literal-self-forward.pre +++ b/tests/cases/failing/map-literal-self-forward.pre @@ -1 +1 @@ -MAP: bad = <"copy" = SELF<"value">, "value" = 0d1> +MAP bad = <"copy" = SELF<"value">, "value" = 0d1> diff --git a/tests/cases/failing/map-literal-trailing-comma.pre b/tests/cases/failing/map-literal-trailing-comma.pre index 9e46297..981cc34 100644 --- a/tests/cases/failing/map-literal-trailing-comma.pre +++ b/tests/cases/failing/map-literal-trailing-comma.pre @@ -1 +1 @@ -MAP: bad = <"a" = 0d1,> +MAP bad = <"a" = 0d1,> diff --git a/tests/cases/failing/max-mixed-types.pre b/tests/cases/failing/max-mixed-types.pre index 5ec0097..b4572c4 100644 --- a/tests/cases/failing/max-mixed-types.pre +++ b/tests/cases/failing/max-mixed-types.pre @@ -1,2 +1,2 @@ ! Mixing INT and FLT in arguments must raise a runtime error per specification -INT: _ = MAX(0d1, 0d2.0) +INT _ = MAX(0d1, 0d2.0) diff --git a/tests/cases/failing/max-tns-mixed-element-type.pre b/tests/cases/failing/max-tns-mixed-element-type.pre index 7a9511f..3aa8f80 100644 --- a/tests/cases/failing/max-tns-mixed-element-type.pre +++ b/tests/cases/failing/max-tns-mixed-element-type.pre @@ -1,4 +1,4 @@ ! TNS arguments must share the same scalar element type per specification -TNS: a = [0d1] -TNS: b = ["x"] -INT: _ = MAX(a, b) +TNS a = [0d1] +TNS b = ["x"] +INT _ = MAX(a, b) diff --git a/tests/cases/failing/min-tns-mixed-element-type.pre b/tests/cases/failing/min-tns-mixed-element-type.pre index df8c2d3..785ece8 100644 --- a/tests/cases/failing/min-tns-mixed-element-type.pre +++ b/tests/cases/failing/min-tns-mixed-element-type.pre @@ -1,4 +1,4 @@ ! TNS arguments must share the same scalar element type per specification -TNS: a = [0d1] -TNS: b = ["x"] +TNS a = [0d1] +TNS b = ["x"] _ = MIN(a, b) diff --git a/tests/cases/failing/mops-pointer-writeback.pre b/tests/cases/failing/mops-pointer-writeback.pre index efa4083..be88512 100644 --- a/tests/cases/failing/mops-pointer-writeback.pre +++ b/tests/cases/failing/mops-pointer-writeback.pre @@ -1,15 +1,15 @@ // M* family (matrix/tensor ops) should write back to pointer operands. -TNS: A1 = [0d1, 0d2] -TNS: B1 = [0d3, 0d4] +TNS A1 = [0d1, 0d2] +TNS B1 = [0d3, 0d4] MADD(@A1, B1) ASSERT(EQ(A1, [0d4, 0d6])) -TNS: A2 = [0d1, 0d2] -TNS: B2 = [0d3, 0d4] +TNS A2 = [0d1, 0d2] +TNS B2 = [0d3, 0d4] MADD(A2, @B2) ASSERT(EQ(B2, [0d4, 0d6])) // MSUM / MPROD behavior: elementwise -> writeback -TNS: C1 = [0d2, 0d3] +TNS C1 = [0d2, 0d3] MSUM(@C1) ASSERT(EQ(C1, [0d5])) diff --git a/tests/cases/failing/msub-non-numeric-tns.pre b/tests/cases/failing/msub-non-numeric-tns.pre index fa602be..a739526 100644 --- a/tests/cases/failing/msub-non-numeric-tns.pre +++ b/tests/cases/failing/msub-non-numeric-tns.pre @@ -1,2 +1,2 @@ -TNS: inner = [0d1] +TNS inner = [0d1] MSUB([inner], [inner]) \ No newline at end of file diff --git a/tests/cases/failing/neg-type-bool.pre b/tests/cases/failing/neg-type-bool.pre index 7ddfe75..77b54c9 100644 --- a/tests/cases/failing/neg-type-bool.pre +++ b/tests/cases/failing/neg-type-bool.pre @@ -1,2 +1,2 @@ -BOOL: b = TRUE +BOOL b = TRUE NEG(b) diff --git a/tests/cases/failing/neg-type-str.pre b/tests/cases/failing/neg-type-str.pre index 586c1e0..a99332f 100644 --- a/tests/cases/failing/neg-type-str.pre +++ b/tests/cases/failing/neg-type-str.pre @@ -1,2 +1,2 @@ -STR: s = 'not-a-number' +STR s = 'not-a-number' NEG(s) diff --git a/tests/cases/failing/non-ascii.pre b/tests/cases/failing/non-ascii.pre index 10998cd..d7b1ca4 100644 --- a/tests/cases/failing/non-ascii.pre +++ b/tests/cases/failing/non-ascii.pre @@ -1 +1 @@ -STR: invalid = "Īñvàlïd" +STR invalid = "Īñvàlïd" diff --git a/tests/cases/failing/one-starts-ident.pre b/tests/cases/failing/one-starts-ident.pre index 200ef24..8bf92d2 100644 --- a/tests/cases/failing/one-starts-ident.pre +++ b/tests/cases/failing/one-starts-ident.pre @@ -1 +1 @@ -BOOL: 1x = TRUE +BOOL 1x = TRUE diff --git a/tests/cases/failing/op-flt-func.pre b/tests/cases/failing/op-flt-func.pre index 4142b8a..8775c2c 100644 --- a/tests/cases/failing/op-flt-func.pre +++ b/tests/cases/failing/op-flt-func.pre @@ -1,4 +1,4 @@ -FUNC INT: sample_func(){ +FUNC INT sample_func(){ RETURN(0d1) } diff --git a/tests/cases/failing/op-int-func.pre b/tests/cases/failing/op-int-func.pre index 2e837a4..b921ca3 100644 --- a/tests/cases/failing/op-int-func.pre +++ b/tests/cases/failing/op-int-func.pre @@ -1,4 +1,4 @@ -FUNC INT: sample_func(){ +FUNC INT sample_func(){ RETURN(0d1) } diff --git a/tests/cases/failing/op-str-func.pre b/tests/cases/failing/op-str-func.pre index 3e53845..a5d4982 100644 --- a/tests/cases/failing/op-str-func.pre +++ b/tests/cases/failing/op-str-func.pre @@ -1,4 +1,4 @@ -FUNC BOOL: str_func(){ +FUNC BOOL str_func(){ RETURN(TRUE) } diff --git a/tests/cases/failing/op-tns-bool.pre b/tests/cases/failing/op-tns-bool.pre index f5bc6eb..cbd76b5 100644 --- a/tests/cases/failing/op-tns-bool.pre +++ b/tests/cases/failing/op-tns-bool.pre @@ -1,2 +1,2 @@ -BOOL: sample_bool = TRUE +BOOL sample_bool = TRUE TNS(sample_bool) \ No newline at end of file diff --git a/tests/cases/failing/op-tns-func.pre b/tests/cases/failing/op-tns-func.pre index d54aff0..fae2431 100644 --- a/tests/cases/failing/op-tns-func.pre +++ b/tests/cases/failing/op-tns-func.pre @@ -1,4 +1,4 @@ -FUNC INT: sample_func(){ +FUNC INT sample_func(){ RETURN(0d1) } diff --git a/tests/cases/failing/op-tns-map.pre b/tests/cases/failing/op-tns-map.pre index 5c7b8bd..d666274 100644 --- a/tests/cases/failing/op-tns-map.pre +++ b/tests/cases/failing/op-tns-map.pre @@ -1,2 +1,2 @@ -MAP: fill_map = <"n" = 0d1> +MAP fill_map = <"n" = 0d1> TNS(fill_map) \ No newline at end of file diff --git a/tests/cases/failing/open-curly-bracket-in-ident.pre b/tests/cases/failing/open-curly-bracket-in-ident.pre index 00d131b..8d8c3aa 100644 --- a/tests/cases/failing/open-curly-bracket-in-ident.pre +++ b/tests/cases/failing/open-curly-bracket-in-ident.pre @@ -1 +1 @@ -BOOL: x{ = TRUE +BOOL x{ = TRUE diff --git a/tests/cases/failing/open-parentheses-in-ident.pre b/tests/cases/failing/open-parentheses-in-ident.pre index 9a59a76..f964f73 100644 --- a/tests/cases/failing/open-parentheses-in-ident.pre +++ b/tests/cases/failing/open-parentheses-in-ident.pre @@ -1 +1 @@ -BOOL: x( = TRUE +BOOL x( = TRUE diff --git a/tests/cases/failing/open-square-bracket-in-ident.pre b/tests/cases/failing/open-square-bracket-in-ident.pre index 80f6d17..767d45b 100644 --- a/tests/cases/failing/open-square-bracket-in-ident.pre +++ b/tests/cases/failing/open-square-bracket-in-ident.pre @@ -1 +1 @@ -BOOL: x[ = TRUE +BOOL x[ = TRUE diff --git a/tests/cases/failing/parallel-tensor-non-func.pre b/tests/cases/failing/parallel-tensor-non-func.pre index 4edb7c6..6c5fe23 100644 --- a/tests/cases/failing/parallel-tensor-non-func.pre +++ b/tests/cases/failing/parallel-tensor-non-func.pre @@ -1,3 +1,3 @@ -FUNC BOOL: worker(){} +FUNC BOOL worker(){} PARALLEL([worker, 0d1]) \ No newline at end of file diff --git a/tests/cases/failing/parallel-worker-failure.pre b/tests/cases/failing/parallel-worker-failure.pre index d381b8a..c522b0c 100644 --- a/tests/cases/failing/parallel-worker-failure.pre +++ b/tests/cases/failing/parallel-worker-failure.pre @@ -1,4 +1,4 @@ -FUNC BOOL: explode(){ +FUNC BOOL explode(){ THROW("boom") } diff --git a/tests/cases/failing/parallel-worker-no-args.pre b/tests/cases/failing/parallel-worker-no-args.pre index 9862366..f0ec70c 100644 --- a/tests/cases/failing/parallel-worker-no-args.pre +++ b/tests/cases/failing/parallel-worker-no-args.pre @@ -1,4 +1,4 @@ -FUNC BOOL: requires_arg(INT: value){ +FUNC BOOL requires_arg(INT value){ RETURN(TRUE) } diff --git a/tests/cases/failing/readfile-missing-file.pre b/tests/cases/failing/readfile-missing-file.pre index dcb8b4c..9b3a5ec 100644 --- a/tests/cases/failing/readfile-missing-file.pre +++ b/tests/cases/failing/readfile-missing-file.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: missing = path.TEMPFILE("prefix-readfile-missing.txt") +STR missing = path.TEMPFILE("prefix-readfile-missing.txt") TRY{ DELETEFILE(missing) } CATCH { } READFILE(missing) diff --git a/tests/cases/failing/readfile-unsupported-coding.pre b/tests/cases/failing/readfile-unsupported-coding.pre index c7ed9f5..6f57f7c 100644 --- a/tests/cases/failing/readfile-unsupported-coding.pre +++ b/tests/cases/failing/readfile-unsupported-coding.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = JOIN(path.script_dir, "/plain.txt") +STR p = JOIN(path.script_dir, "/plain.txt") READFILE(p, coding = "UTF-7") diff --git a/tests/cases/failing/restart-running.pre b/tests/cases/failing/restart-running.pre index ff77bdb..9b2d4b6 100644 --- a/tests/cases/failing/restart-running.pre +++ b/tests/cases/failing/restart-running.pre @@ -1,4 +1,4 @@ -THR: worker = ASYNC{ +THR worker = ASYNC{ FOR(i, 0d100000){} } diff --git a/tests/cases/failing/resume-not-paused.pre b/tests/cases/failing/resume-not-paused.pre index 8508ac8..5e6d781 100644 --- a/tests/cases/failing/resume-not-paused.pre +++ b/tests/cases/failing/resume-not-paused.pre @@ -1,4 +1,4 @@ -THR: worker = ASYNC{ +THR worker = ASYNC{ FOR(i, 0d100000){} } diff --git a/tests/cases/failing/scat-pointer-writeback.pre b/tests/cases/failing/scat-pointer-writeback.pre index 92b62b9..2c8bb8d 100644 --- a/tests/cases/failing/scat-pointer-writeback.pre +++ b/tests/cases/failing/scat-pointer-writeback.pre @@ -1,6 +1,6 @@ // SCAT should write back to destination pointer operands. -TNS: dst1 = [0d1, 0d2, 0d3] -TNS: src1 = [0d9] -TNS: ind1 = [[0d2, 0d2]] +TNS dst1 = [0d1, 0d2, 0d3] +TNS src1 = [0d9] +TNS ind1 = [[0d2, 0d2]] SCAT(@dst1, src1, ind1) ASSERT(EQ(dst1, [0d1, 0d9, 0d3])) diff --git a/tests/cases/failing/statement-with-caret.pre b/tests/cases/failing/statement-with-caret.pre index a286491..cbbae39 100644 --- a/tests/cases/failing/statement-with-caret.pre +++ b/tests/cases/failing/statement-with-caret.pre @@ -1 +1 @@ -BOOL: x ^ = TRUE +BOOL x ^ = TRUE diff --git a/tests/cases/failing/statement-with-delimiter.pre b/tests/cases/failing/statement-with-delimiter.pre index 60df22a..7556ec7 100644 --- a/tests/cases/failing/statement-with-delimiter.pre +++ b/tests/cases/failing/statement-with-delimiter.pre @@ -1,2 +1,2 @@ -BOOL: -x = TRUE +BOOL + x = TRUE diff --git a/tests/cases/failing/statement-with-semicolon.pre b/tests/cases/failing/statement-with-semicolon.pre index 2046fef..abe5bd5 100644 --- a/tests/cases/failing/statement-with-semicolon.pre +++ b/tests/cases/failing/statement-with-semicolon.pre @@ -1 +1 @@ -BOOL: ; x = TRUE +BOOL ; x = TRUE diff --git a/tests/cases/failing/statements-no-delimiter.pre b/tests/cases/failing/statements-no-delimiter.pre index 5f88e86..8d60b8c 100644 --- a/tests/cases/failing/statements-no-delimiter.pre +++ b/tests/cases/failing/statements-no-delimiter.pre @@ -1 +1 @@ -BOOL: x = TRUE BOOL: y = FALSE +BOOL x = TRUE BOOL y = FALSE diff --git a/tests/cases/failing/string-invalid-U-escape-uppercase.pre b/tests/cases/failing/string-invalid-U-escape-uppercase.pre index 5346648..a679196 100644 --- a/tests/cases/failing/string-invalid-U-escape-uppercase.pre +++ b/tests/cases/failing/string-invalid-U-escape-uppercase.pre @@ -1 +1 @@ -STR: bad = "\U0000G000" +STR bad = "\U0000G000" diff --git a/tests/cases/failing/string-invalid-U-short-escape.pre b/tests/cases/failing/string-invalid-U-short-escape.pre index ccd6271..c72f0ea 100644 --- a/tests/cases/failing/string-invalid-U-short-escape.pre +++ b/tests/cases/failing/string-invalid-U-short-escape.pre @@ -1 +1 @@ -STR: bad = "\U0000123" \ No newline at end of file +STR bad = "\U0000123" \ No newline at end of file diff --git a/tests/cases/failing/string-invalid-escape.pre b/tests/cases/failing/string-invalid-escape.pre index 556d5b8..50efaed 100644 --- a/tests/cases/failing/string-invalid-escape.pre +++ b/tests/cases/failing/string-invalid-escape.pre @@ -1 +1 @@ -STR: bad = "oops\q" +STR bad = "oops\q" diff --git a/tests/cases/failing/string-invalid-u-escape.pre b/tests/cases/failing/string-invalid-u-escape.pre index a94408d..b685f66 100644 --- a/tests/cases/failing/string-invalid-u-escape.pre +++ b/tests/cases/failing/string-invalid-u-escape.pre @@ -1 +1 @@ -STR: bad = "\u12G4" +STR bad = "\u12G4" diff --git a/tests/cases/failing/string-invalid-u-short.pre b/tests/cases/failing/string-invalid-u-short.pre index fa1ec0c..73563fb 100644 --- a/tests/cases/failing/string-invalid-u-short.pre +++ b/tests/cases/failing/string-invalid-u-short.pre @@ -1 +1 @@ -STR: bad = "\u123" \ No newline at end of file +STR bad = "\u123" \ No newline at end of file diff --git a/tests/cases/failing/string-invalid-x-escape.pre b/tests/cases/failing/string-invalid-x-escape.pre index 6b6e2c4..cb27d80 100644 --- a/tests/cases/failing/string-invalid-x-escape.pre +++ b/tests/cases/failing/string-invalid-x-escape.pre @@ -1 +1 @@ -STR: bad = "\xGG" +STR bad = "\xGG" diff --git a/tests/cases/failing/string-invalid-x-short.pre b/tests/cases/failing/string-invalid-x-short.pre index fb9a58e..b189226 100644 --- a/tests/cases/failing/string-invalid-x-short.pre +++ b/tests/cases/failing/string-invalid-x-short.pre @@ -1 +1 @@ -STR: bad = "\x4" \ No newline at end of file +STR bad = "\x4" \ No newline at end of file diff --git a/tests/cases/failing/string-mismatched-quote.pre b/tests/cases/failing/string-mismatched-quote.pre index 8f3dce8..1d8d3df 100644 --- a/tests/cases/failing/string-mismatched-quote.pre +++ b/tests/cases/failing/string-mismatched-quote.pre @@ -1 +1 @@ -STR: bad = "oops' +STR bad = "oops' diff --git a/tests/cases/failing/string-unterminated-double.pre b/tests/cases/failing/string-unterminated-double.pre index 9353a68..5591878 100644 --- a/tests/cases/failing/string-unterminated-double.pre +++ b/tests/cases/failing/string-unterminated-double.pre @@ -1 +1 @@ -STR: bad = "oops +STR bad = "oops diff --git a/tests/cases/failing/string-unterminated-single.pre b/tests/cases/failing/string-unterminated-single.pre index f83aac6..97d8eee 100644 --- a/tests/cases/failing/string-unterminated-single.pre +++ b/tests/cases/failing/string-unterminated-single.pre @@ -1 +1 @@ -STR: bad = 'oops +STR bad = 'oops diff --git a/tests/cases/failing/tconvert-pointer-writeback.pre b/tests/cases/failing/tconvert-pointer-writeback.pre index 9b01d02..b7fa06c 100644 --- a/tests/cases/failing/tconvert-pointer-writeback.pre +++ b/tests/cases/failing/tconvert-pointer-writeback.pre @@ -1,12 +1,12 @@ // These tests expect builtins like TINT/TFLT/TSTR to write back to pointer operands. -TNS: t1 = [0d1.5, 0d2.9] +TNS t1 = [0d1.5, 0d2.9] TINT(@t1) ASSERT(EQ(t1, [0d1, 0d2])) -TNS: t2 = [0d1, 0d2] +TNS t2 = [0d1, 0d2] TFLT(@t2) ASSERT(EQ(t2, [0d1.0, 0d2.0])) -TNS: t3 = [0d1, 0d2] +TNS t3 = [0d1, 0d2] TSTR(@t3) ASSERT(EQ(t3, ["0d1", "0d2"])) diff --git a/tests/cases/failing/tensor-elemwise-pointer-writeback.pre b/tests/cases/failing/tensor-elemwise-pointer-writeback.pre index 536d559..4d93a3a 100644 --- a/tests/cases/failing/tensor-elemwise-pointer-writeback.pre +++ b/tests/cases/failing/tensor-elemwise-pointer-writeback.pre @@ -1,16 +1,16 @@ // Elementwise tensor ops should write back to pointer operands when provided. -TNS: a1 = [0d1, 0d2] -TNS: b1 = [0d3, 0d4] +TNS a1 = [0d1, 0d2] +TNS b1 = [0d3, 0d4] TADD(@a1, b1) ASSERT(EQ(a1, [0d4, 0d6])) -TNS: a2 = [0d1, 0d2] -TNS: b2 = [0d3, 0d4] +TNS a2 = [0d1, 0d2] +TNS b2 = [0d3, 0d4] TADD(a2, @b2) ASSERT(EQ(b2, [0d4, 0d6])) // similar for TMUL -TNS: c1 = [0d2, 0d3] -TNS: d1 = [0d4, 0d5] +TNS c1 = [0d2, 0d3] +TNS d1 = [0d4, 0d5] TMUL(@c1, d1) ASSERT(EQ(c1, [0d8, 0d15])) diff --git a/tests/cases/failing/tflt-map.pre b/tests/cases/failing/tflt-map.pre index 7c6228f..679baf5 100644 --- a/tests/cases/failing/tflt-map.pre +++ b/tests/cases/failing/tflt-map.pre @@ -1,2 +1,2 @@ -MAP: bad = <> +MAP bad = <> TFLT([0d1, bad]) \ No newline at end of file diff --git a/tests/cases/failing/tilde-in-ident.pre b/tests/cases/failing/tilde-in-ident.pre index 91b31d9..8eaa8da 100644 --- a/tests/cases/failing/tilde-in-ident.pre +++ b/tests/cases/failing/tilde-in-ident.pre @@ -1 +1 @@ -BOOL: x~ = TRUE +BOOL x~ = TRUE diff --git a/tests/cases/failing/tint-map.pre b/tests/cases/failing/tint-map.pre index 0e5116f..3217eba 100644 --- a/tests/cases/failing/tint-map.pre +++ b/tests/cases/failing/tint-map.pre @@ -1,2 +1,2 @@ -MAP: bad = <> +MAP bad = <> TINT([0d1, bad]) \ No newline at end of file diff --git a/tests/cases/failing/tlen-too-large.pre b/tests/cases/failing/tlen-too-large.pre index 54a7860..04b9c0d 100644 --- a/tests/cases/failing/tlen-too-large.pre +++ b/tests/cases/failing/tlen-too-large.pre @@ -1,3 +1,3 @@ -TNS: tensor = [[0d1, 0d2], [0d3, 0d4]] +TNS tensor = [[0d1, 0d2], [0d3, 0d4]] TLEN(tensor, 0d3) \ No newline at end of file diff --git a/tests/cases/failing/tlen-zero-dim.pre b/tests/cases/failing/tlen-zero-dim.pre index 09be85b..119d8b7 100644 --- a/tests/cases/failing/tlen-zero-dim.pre +++ b/tests/cases/failing/tlen-zero-dim.pre @@ -1,3 +1,3 @@ -TNS: tensor = [[0d1, 0d2], [0d3, 0d4]] +TNS tensor = [[0d1, 0d2], [0d3, 0d4]] TLEN(tensor, 0d0) \ No newline at end of file diff --git a/tests/cases/failing/tns-empty-index.pre b/tests/cases/failing/tns-empty-index.pre index 6d44519..69f3fac 100644 --- a/tests/cases/failing/tns-empty-index.pre +++ b/tests/cases/failing/tns-empty-index.pre @@ -1,2 +1,2 @@ -TNS: vec = [0d1, 0d2] +TNS vec = [0d1, 0d2] vec[] diff --git a/tests/cases/failing/tns-empty.pre b/tests/cases/failing/tns-empty.pre index f82de9a..84ce75b 100644 --- a/tests/cases/failing/tns-empty.pre +++ b/tests/cases/failing/tns-empty.pre @@ -1 +1 @@ -TNS: empty = [] +TNS empty = [] diff --git a/tests/cases/failing/tns-mixed-nested-value.pre b/tests/cases/failing/tns-mixed-nested-value.pre index 8eaea8a..6b716e7 100644 --- a/tests/cases/failing/tns-mixed-nested-value.pre +++ b/tests/cases/failing/tns-mixed-nested-value.pre @@ -1,2 +1,2 @@ -TNS: row = [0d1, 0d2] -TNS: bad = [[0d1, 0d2], row] +TNS row = [0d1, 0d2] +TNS bad = [[0d1, 0d2], row] diff --git a/tests/cases/failing/tns-nested-empty.pre b/tests/cases/failing/tns-nested-empty.pre index f5eeb93..131697b 100644 --- a/tests/cases/failing/tns-nested-empty.pre +++ b/tests/cases/failing/tns-nested-empty.pre @@ -1 +1 @@ -TNS: bad = [[]] +TNS bad = [[]] diff --git a/tests/cases/failing/tns-ragged.pre b/tests/cases/failing/tns-ragged.pre index 4875d45..770c92a 100644 --- a/tests/cases/failing/tns-ragged.pre +++ b/tests/cases/failing/tns-ragged.pre @@ -1 +1 @@ -TNS: bad = [[0d1], [0d2, 0d3]] +TNS bad = [[0d1], [0d2, 0d3]] diff --git a/tests/cases/failing/tns-slice-dim-mismatch.pre b/tests/cases/failing/tns-slice-dim-mismatch.pre index 0d8eb21..020c2ba 100644 --- a/tests/cases/failing/tns-slice-dim-mismatch.pre +++ b/tests/cases/failing/tns-slice-dim-mismatch.pre @@ -1,2 +1,2 @@ -TNS: matrix = [[0d1, 0d2], [0d3, 0d4]] +TNS matrix = [[0d1, 0d2], [0d3, 0d4]] ASSIGN(matrix[*, 0d2], [[0d9], [0d10]]) diff --git a/tests/cases/failing/tns-slice-element-type-mismatch.pre b/tests/cases/failing/tns-slice-element-type-mismatch.pre index 6269095..c2562fe 100644 --- a/tests/cases/failing/tns-slice-element-type-mismatch.pre +++ b/tests/cases/failing/tns-slice-element-type-mismatch.pre @@ -1,2 +1,2 @@ -TNS: vec = [0d1, 0d2] +TNS vec = [0d1, 0d2] ASSIGN(vec[0d1-0d2], [0d1.5, 0d2.5]) diff --git a/tests/cases/failing/tns-slice-rhs-not-tns.pre b/tests/cases/failing/tns-slice-rhs-not-tns.pre index c8a8c59..652e45f 100644 --- a/tests/cases/failing/tns-slice-rhs-not-tns.pre +++ b/tests/cases/failing/tns-slice-rhs-not-tns.pre @@ -1,2 +1,2 @@ -TNS: vec = [0d1, 0d2] +TNS vec = [0d1, 0d2] ASSIGN(vec[0d1-0d2], 0d9) diff --git a/tests/cases/failing/tns-slice-shape-mismatch.pre b/tests/cases/failing/tns-slice-shape-mismatch.pre index 5f007cd..9609ea9 100644 --- a/tests/cases/failing/tns-slice-shape-mismatch.pre +++ b/tests/cases/failing/tns-slice-shape-mismatch.pre @@ -1,2 +1,2 @@ -TNS: matrix = [[0d1, 0d2], [0d3, 0d4]] +TNS matrix = [[0d1, 0d2], [0d3, 0d4]] ASSIGN(matrix[*, *], [[0d9, 0d10, 0d11], [0d12, 0d13, 0d14]]) diff --git a/tests/cases/failing/tstr-map.pre b/tests/cases/failing/tstr-map.pre index f4cfc5e..f0b83c3 100644 --- a/tests/cases/failing/tstr-map.pre +++ b/tests/cases/failing/tstr-map.pre @@ -1,2 +1,2 @@ -MAP: bad = <> +MAP bad = <> TSTR([TRUE, bad]) \ No newline at end of file diff --git a/tests/cases/failing/unexpected-block.pre b/tests/cases/failing/unexpected-block.pre index b457ee6..ed40f7d 100644 --- a/tests/cases/failing/unexpected-block.pre +++ b/tests/cases/failing/unexpected-block.pre @@ -1 +1 @@ -{ BOOL: x = TRUE } +{ BOOL x = TRUE } diff --git a/tests/cases/failing/unser-type-func.pre b/tests/cases/failing/unser-type-func.pre index 6620127..f0a8ac8 100644 --- a/tests/cases/failing/unser-type-func.pre +++ b/tests/cases/failing/unser-type-func.pre @@ -1,4 +1,4 @@ -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } diff --git a/tests/cases/failing/writefile-binary-badchars.pre b/tests/cases/failing/writefile-binary-badchars.pre index 49e0adf..68e9df0 100644 --- a/tests/cases/failing/writefile-binary-badchars.pre +++ b/tests/cases/failing/writefile-binary-badchars.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-bad-binary2.txt") +STR p = path.TEMPFILE("prefix-writefile-bad-binary2.txt") WRITEFILE("010a0101", p, coding = "binary") diff --git a/tests/cases/failing/writefile-binary-badlen.pre b/tests/cases/failing/writefile-binary-badlen.pre index 52a0e57..5c25218 100644 --- a/tests/cases/failing/writefile-binary-badlen.pre +++ b/tests/cases/failing/writefile-binary-badlen.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-bad-binary.txt") +STR p = path.TEMPFILE("prefix-writefile-bad-binary.txt") WRITEFILE("101", p, coding = "binary") diff --git a/tests/cases/failing/writefile-hex-badlen.pre b/tests/cases/failing/writefile-hex-badlen.pre index 99525ed..ea4026f 100644 --- a/tests/cases/failing/writefile-hex-badlen.pre +++ b/tests/cases/failing/writefile-hex-badlen.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-bad-hex.txt") +STR p = path.TEMPFILE("prefix-writefile-bad-hex.txt") WRITEFILE("abc", p, coding = "hex") diff --git a/tests/cases/failing/writefile-unsupported-coding.pre b/tests/cases/failing/writefile-unsupported-coding.pre index d0bb225..8b3fb44 100644 --- a/tests/cases/failing/writefile-unsupported-coding.pre +++ b/tests/cases/failing/writefile-unsupported-coding.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-unsupported.txt") +STR p = path.TEMPFILE("prefix-writefile-unsupported.txt") WRITEFILE("Prefix", p, coding = "UTF-7") diff --git a/tests/cases/failing/zero-starts-ident.pre b/tests/cases/failing/zero-starts-ident.pre index 44e200b..87b1a61 100644 --- a/tests/cases/failing/zero-starts-ident.pre +++ b/tests/cases/failing/zero-starts-ident.pre @@ -1 +1 @@ -BOOL: 0x = TRUE +BOOL 0x = TRUE diff --git a/tests/cases/passing/abs-flt.pre b/tests/cases/passing/abs-flt.pre index 8e4e94f..bab4eb4 100644 --- a/tests/cases/passing/abs-flt.pre +++ b/tests/cases/passing/abs-flt.pre @@ -1,8 +1,8 @@ -FLT: pos_oct = 0o1.4 -FLT: neg_oct = -0o1.4 -FLT: hex_val = 0x1.8 -FLT: zero = 0o0.0 -FLT: neg_zero = -0o0.0 +FLT pos_oct = 0o1.4 +FLT neg_oct = -0o1.4 +FLT hex_val = 0x1.8 +FLT zero = 0o0.0 +FLT neg_zero = -0o0.0 ASSERT(EQ(ABS(pos_oct), pos_oct)) ASSERT(EQ(ABS(neg_oct), 0o1.4)) diff --git a/tests/cases/passing/abs-int.pre b/tests/cases/passing/abs-int.pre index fb5722d..0f110d0 100644 --- a/tests/cases/passing/abs-int.pre +++ b/tests/cases/passing/abs-int.pre @@ -1,9 +1,9 @@ -INT: pos_dec = 0d5 -INT: neg_dec = -0d5 -INT: neg_hex = -0xA -INT: hex_val = 0xA -INT: bin_neg = -0b1010 -INT: zero = 0d0 +INT pos_dec = 0d5 +INT neg_dec = -0d5 +INT neg_hex = -0xA +INT hex_val = 0xA +INT bin_neg = -0b1010 +INT zero = 0d0 ASSERT(EQ(ABS(pos_dec), pos_dec)) ASSERT(EQ(ABS(neg_dec), 0d5)) diff --git a/tests/cases/passing/abs-pointer-writeback.pre b/tests/cases/passing/abs-pointer-writeback.pre index ab54e50..0aa382b 100644 --- a/tests/cases/passing/abs-pointer-writeback.pre +++ b/tests/cases/passing/abs-pointer-writeback.pre @@ -1,7 +1,7 @@ -INT: in1 = -0d5 +INT in1 = -0d5 ABS(@in1) ASSERT(EQ(in1, 0d5)) -FLT: fin1 = -0d5.5 +FLT fin1 = -0d5.5 ABS(@fin1) ASSERT(EQ(fin1, 0d5.5)) diff --git a/tests/cases/passing/add-pointer-writeback.pre b/tests/cases/passing/add-pointer-writeback.pre index 7869c93..0d196cb 100644 --- a/tests/cases/passing/add-pointer-writeback.pre +++ b/tests/cases/passing/add-pointer-writeback.pre @@ -1,31 +1,31 @@ -INT: a1 = 0d2 -INT: b1 = 0d3 +INT a1 = 0d2 +INT b1 = 0d3 ADD(@a1, b1) ASSERT(EQ(a1, 0d5)) -INT: a2 = 0d2 -INT: b2 = 0d3 +INT a2 = 0d2 +INT b2 = 0d3 ADD(a2, @b2) ASSERT(EQ(b2, 0d5)) -INT: a3 = 0d2 -INT: b3 = 0d3 +INT a3 = 0d2 +INT b3 = 0d3 ADD(@a3, @b3) ASSERT(EQ(a3, 0d5)) ASSERT(EQ(b3, 0d5)) -FLT: f1 = 0d1.5 -FLT: g1 = 0d2.25 +FLT f1 = 0d1.5 +FLT g1 = 0d2.25 ADD(@f1, g1) ASSERT(EQ(f1, 0d3.75)) -FLT: f2 = 0d1.5 -FLT: g2 = 0d2.25 +FLT f2 = 0d1.5 +FLT g2 = 0d2.25 ADD(f2, @g2) ASSERT(EQ(g2, 0d3.75)) -FLT: f3 = 0d1.5 -FLT: g3 = 0d2.25 +FLT f3 = 0d1.5 +FLT g3 = 0d2.25 ADD(@f3, @g3) ASSERT(EQ(f3, 0d3.75)) ASSERT(EQ(g3, 0d3.75)) diff --git a/tests/cases/passing/append-any-element.pre b/tests/cases/passing/append-any-element.pre index 0fe4ab4..f5f7050 100644 --- a/tests/cases/passing/append-any-element.pre +++ b/tests/cases/passing/append-any-element.pre @@ -1,5 +1,5 @@ -MAP: m = <"k" = 0d1> -TNS: nested = [0d5, 0d6] +MAP m = <"k" = 0d1> +TNS nested = [0d5, 0d6] ASSERT(EQ(APPEND(m, [0d1]), [0d1, m])) ASSERT(EQ(APPEND(nested, [0d1]), [0d1, nested])) diff --git a/tests/cases/passing/append-basic.pre b/tests/cases/passing/append-basic.pre index 326d1a6..9650fe8 100644 --- a/tests/cases/passing/append-basic.pre +++ b/tests/cases/passing/append-basic.pre @@ -1,5 +1,5 @@ -TNS: base = [0d1, 0d2] -TNS: out = APPEND(0d3, base) +TNS base = [0d1, 0d2] +TNS out = APPEND(0d3, base) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d1, 0d2, 0d3])) diff --git a/tests/cases/passing/append-pointer-writeback.pre b/tests/cases/passing/append-pointer-writeback.pre index 2ed69b2..1afc465 100644 --- a/tests/cases/passing/append-pointer-writeback.pre +++ b/tests/cases/passing/append-pointer-writeback.pre @@ -1,7 +1,7 @@ -TNS: t1 = [0d1, 0d2] +TNS t1 = [0d1, 0d2] APPEND(0d3, @t1) ASSERT(EQ(t1, [0d1, 0d2, 0d3])) -TNS: t2 = ["a", "b"] +TNS t2 = ["a", "b"] APPEND("c", @t2) ASSERT(EQ(t2, ["a", "b", "c"])) diff --git a/tests/cases/passing/append-source-unchanged.pre b/tests/cases/passing/append-source-unchanged.pre index 70eb129..75000ba 100644 --- a/tests/cases/passing/append-source-unchanged.pre +++ b/tests/cases/passing/append-source-unchanged.pre @@ -1,5 +1,5 @@ -TNS: src = [0d10, 0d20] -TNS: out = APPEND(0d30, src) +TNS src = [0d10, 0d20] +TNS out = APPEND(0d30, src) ASSERT(EQ(src, [0d10, 0d20])) ASSERT(EQ(out, [0d10, 0d20, 0d30])) diff --git a/tests/cases/passing/argv-elements-str.pre b/tests/cases/passing/argv-elements-str.pre index 86aaea3..6160e5f 100644 --- a/tests/cases/passing/argv-elements-str.pre +++ b/tests/cases/passing/argv-elements-str.pre @@ -1,4 +1,4 @@ -TNS: args = ARGV() +TNS args = ARGV() FOR(i, TLEN(args, 0d1)){ ASSERT(ISSTR(args[i])) diff --git a/tests/cases/passing/argv-order-program-arg-last.pre b/tests/cases/passing/argv-order-program-arg-last.pre index f157dcf..2808154 100644 --- a/tests/cases/passing/argv-order-program-arg-last.pre +++ b/tests/cases/passing/argv-order-program-arg-last.pre @@ -1,4 +1,4 @@ ! ARGV_LAST_ARG_SELF_FILE_MARKER -STR: source = REPLACE(READFILE(ARGV()[-0d1]), "\r", "") +STR source = REPLACE(READFILE(ARGV()[-0d1]), "\r", "") ASSERT(IN("! ARGV_LAST_ARG_SELF_FILE_MARKER", SPLIT(source, "\n"))) \ No newline at end of file diff --git a/tests/cases/passing/assign-map-index.pre b/tests/cases/passing/assign-map-index.pre index aaf9126..86366c4 100644 --- a/tests/cases/passing/assign-map-index.pre +++ b/tests/cases/passing/assign-map-index.pre @@ -1,3 +1,3 @@ -MAP: m = <"a" = 0d1> +MAP m = <"a" = 0d1> ASSERT(EQ(ASSIGN(m<"b">, 0d2), 0d2)) ASSERT(EQ(m<"b">, 0d2)) diff --git a/tests/cases/passing/assign-nested-map-auto-create.pre b/tests/cases/passing/assign-nested-map-auto-create.pre index d43c0ed..b58d49e 100644 --- a/tests/cases/passing/assign-nested-map-auto-create.pre +++ b/tests/cases/passing/assign-nested-map-auto-create.pre @@ -1,4 +1,4 @@ -MAP: m +MAP m ASSERT(EQ(ASSIGN(m<"a", "b">, 0d5), 0d5)) ASSERT(EQ(m<"a", "b">, 0d5)) diff --git a/tests/cases/passing/assign-tns-index.pre b/tests/cases/passing/assign-tns-index.pre index 2779dcc..6cb3557 100644 --- a/tests/cases/passing/assign-tns-index.pre +++ b/tests/cases/passing/assign-tns-index.pre @@ -1,3 +1,3 @@ -TNS: vec = [0d1, 0d2, 0d3] +TNS vec = [0d1, 0d2, 0d3] ASSERT(EQ(ASSIGN(vec[0d2], 0d9), 0d9)) ASSERT(EQ(vec[0d2], 0d9)) diff --git a/tests/cases/passing/assign.pre b/tests/cases/passing/assign.pre index a4974ee..045dc48 100644 --- a/tests/cases/passing/assign.pre +++ b/tests/cases/passing/assign.pre @@ -1,2 +1,2 @@ -ASSIGN(BOOL: x, TRUE) +ASSIGN(BOOL x, TRUE) ASSERT(EXIST(x)) diff --git a/tests/cases/passing/async-error-not-caught.pre b/tests/cases/passing/async-error-not-caught.pre index 6a313a4..dbffc6a 100644 --- a/tests/cases/passing/async-error-not-caught.pre +++ b/tests/cases/passing/async-error-not-caught.pre @@ -1,7 +1,7 @@ -BOOL: caught = FALSE +BOOL caught = FALSE TRY{ - THR: worker = ASYNC{ + THR worker = ASYNC{ FREEZE(not_declared) } } CATCH { @@ -12,9 +12,9 @@ REFUTE(caught) ! Also ensure awaiting the failed thread does not synchronously raise -BOOL: caught_await = FALSE +BOOL caught_await = FALSE -THR: worker2 = ASYNC{ +THR worker2 = ASYNC{ FREEZE(not_declared) } diff --git a/tests/cases/passing/await-expression-handle.pre b/tests/cases/passing/await-expression-handle.pre index fb5d524..cb1b554 100644 --- a/tests/cases/passing/await-expression-handle.pre +++ b/tests/cases/passing/await-expression-handle.pre @@ -1,5 +1,5 @@ -THR: worker = ASYNC{} -THR: awaited = AWAIT(worker) +THR worker = ASYNC{} +THR awaited = AWAIT(worker) ASSERT(EQ(TYPE(awaited), "THR")) ASSERT(EQ(awaited, worker)) diff --git a/tests/cases/passing/await-shared-mutation.pre b/tests/cases/passing/await-shared-mutation.pre index e8661a7..f147cee 100644 --- a/tests/cases/passing/await-shared-mutation.pre +++ b/tests/cases/passing/await-shared-mutation.pre @@ -1,4 +1,4 @@ -INT: shared = 0d0 +INT shared = 0d0 THR(worker){ FOR(i, 0d256){ @@ -6,7 +6,7 @@ THR(worker){ shared = 0d1 } -THR: awaited = AWAIT(worker) +THR awaited = AWAIT(worker) ASSERT(EQ(awaited, worker)) ASSERT(EQ(shared, 0d1)) diff --git a/tests/cases/passing/base-flt.pre b/tests/cases/passing/base-flt.pre index ad16ecb..40a3bd8 100644 --- a/tests/cases/passing/base-flt.pre +++ b/tests/cases/passing/base-flt.pre @@ -1,5 +1,5 @@ -FLT: flt_decimal = 0d1.5 -FLT: flt_binary = 0b1.1 +FLT flt_decimal = 0d1.5 +FLT flt_binary = 0b1.1 ASSERT(EQ(BASE(flt_decimal), 0d10)) ASSERT(EQ(BASE(flt_binary), 0d2)) diff --git a/tests/cases/passing/base-int.pre b/tests/cases/passing/base-int.pre index 87ea2e5..274703e 100644 --- a/tests/cases/passing/base-int.pre +++ b/tests/cases/passing/base-int.pre @@ -1,5 +1,5 @@ -INT: int_binary = 0b101010 -INT: int_hex = 0x2A +INT int_binary = 0b101010 +INT int_hex = 0x2A ASSERT(EQ(BASE(int_binary), 0d2)) ASSERT(EQ(BASE(int_hex), 0d16)) diff --git a/tests/cases/passing/bool.pre b/tests/cases/passing/bool.pre index f9e868d..9704471 100644 --- a/tests/cases/passing/bool.pre +++ b/tests/cases/passing/bool.pre @@ -1,5 +1,5 @@ -BOOL: truthy = TRUE -BOOL: falsy = FALSE +BOOL truthy = TRUE +BOOL falsy = FALSE ASSERT(truthy) REFUTE(falsy) \ No newline at end of file diff --git a/tests/cases/passing/break-nested.pre b/tests/cases/passing/break-nested.pre index 4b735bc..879d1d9 100644 --- a/tests/cases/passing/break-nested.pre +++ b/tests/cases/passing/break-nested.pre @@ -1,5 +1,5 @@ -INT: outer = 0d0 -INT: inner = 0d0 +INT outer = 0d0 +INT inner = 0d0 FOR(i, 0d3){ ADD(@outer, 0d1) FOR(j, 0d3){ diff --git a/tests/cases/passing/break.pre b/tests/cases/passing/break.pre index 269688e..5420f41 100644 --- a/tests/cases/passing/break.pre +++ b/tests/cases/passing/break.pre @@ -1,4 +1,4 @@ -INT: c = 0d0 +INT c = 0d0 WHILE(TRUE){ ADD(@c, 0d1) BREAK(0d1) diff --git a/tests/cases/passing/caret-before-comment.pre b/tests/cases/passing/caret-before-comment.pre index de5a2cc..68cf7d7 100644 --- a/tests/cases/passing/caret-before-comment.pre +++ b/tests/cases/passing/caret-before-comment.pre @@ -1,2 +1,2 @@ -BOOL: ^! comment +BOOL ^! comment x = TRUE diff --git a/tests/cases/passing/cdiv-flt.pre b/tests/cases/passing/cdiv-flt.pre index 16ea14e..5f12a97 100644 --- a/tests/cases/passing/cdiv-flt.pre +++ b/tests/cases/passing/cdiv-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x0.8 -FLT: wide_oct = 0o5.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x0.8 +FLT wide_oct = 0o5.0 ASSERT(EQ(CDIV(left_oct, right_hex), 0x3.0)) ASSERT(EQ(BASE(CDIV(left_oct, right_hex)), 0d16)) diff --git a/tests/cases/passing/cdiv-int.pre b/tests/cases/passing/cdiv-int.pre index 2268f77..e45b728 100644 --- a/tests/cases/passing/cdiv-int.pre +++ b/tests/cases/passing/cdiv-int.pre @@ -1,6 +1,6 @@ -INT: left_bin = 0b111 -INT: right_hex = 0x2 -INT: wide_dec = 0d9 +INT left_bin = 0b111 +INT right_hex = 0x2 +INT wide_dec = 0d9 ASSERT(EQ(CDIV(left_bin, right_hex), 0x4)) ASSERT(EQ(BASE(CDIV(left_bin, right_hex)), 0d16)) diff --git a/tests/cases/passing/cdiv-pointer-writeback.pre b/tests/cases/passing/cdiv-pointer-writeback.pre index 110cf76..d5908fa 100644 --- a/tests/cases/passing/cdiv-pointer-writeback.pre +++ b/tests/cases/passing/cdiv-pointer-writeback.pre @@ -1,31 +1,31 @@ -INT: a1 = 0d5 -INT: b1 = 0d2 +INT a1 = 0d5 +INT b1 = 0d2 CDIV(@a1, b1) ASSERT(EQ(a1, 0d3)) -INT: a2 = 0d5 -INT: b2 = 0d2 +INT a2 = 0d5 +INT b2 = 0d2 CDIV(a2, @b2) ASSERT(EQ(b2, 0d3)) -INT: a3 = 0d5 -INT: b3 = 0d2 +INT a3 = 0d5 +INT b3 = 0d2 CDIV(@a3, @b3) ASSERT(EQ(a3, 0d3)) ASSERT(EQ(b3, 0d3)) -FLT: f1 = 0d5.0 -FLT: g1 = 0d2.0 +FLT f1 = 0d5.0 +FLT g1 = 0d2.0 CDIV(@f1, g1) ASSERT(EQ(f1, 0d3.0)) -FLT: f2 = 0d5.0 -FLT: g2 = 0d2.0 +FLT f2 = 0d5.0 +FLT g2 = 0d2.0 CDIV(f2, @g2) ASSERT(EQ(g2, 0d3.0)) -FLT: f3 = 0d5.0 -FLT: g3 = 0d2.0 +FLT f3 = 0d5.0 +FLT g3 = 0d2.0 CDIV(@f3, @g3) ASSERT(EQ(f3, 0d3.0)) ASSERT(EQ(g3, 0d3.0)) diff --git a/tests/cases/passing/comment.pre b/tests/cases/passing/comment.pre index ba0ce88..7e28ae0 100644 --- a/tests/cases/passing/comment.pre +++ b/tests/cases/passing/comment.pre @@ -1 +1 @@ -BOOL: x = TRUE ! foo +BOOL x = TRUE ! foo diff --git a/tests/cases/passing/continue-for.pre b/tests/cases/passing/continue-for.pre index 48b068c..d649e49 100644 --- a/tests/cases/passing/continue-for.pre +++ b/tests/cases/passing/continue-for.pre @@ -1,4 +1,4 @@ -INT: total = 0d0 +INT total = 0d0 FOR(i, 0d4){ IF(EQ(i, 0d2)){ CONTINUE() diff --git a/tests/cases/passing/continue-while.pre b/tests/cases/passing/continue-while.pre index 606b3f2..30f9fae 100644 --- a/tests/cases/passing/continue-while.pre +++ b/tests/cases/passing/continue-while.pre @@ -1,5 +1,5 @@ -INT: c = 0d0 -INT: seen = 0d0 +INT c = 0d0 +INT seen = 0d0 WHILE(LT(c, 0d5)){ ADD(@c, 0d1) IF(LT(c, 0d5)){ diff --git a/tests/cases/passing/conv-extended-basic.pre b/tests/cases/passing/conv-extended-basic.pre index 814e218..faf7019 100644 --- a/tests/cases/passing/conv-extended-basic.pre +++ b/tests/cases/passing/conv-extended-basic.pre @@ -1,6 +1,6 @@ -TNS: x = [[[0d1], [0d2], [0d3]], [[0d4], [0d5], [0d6]]] -TNS: kernel = [[[[0d1, 0d2]]]] -TNS: out = CONV(x, kernel, stride_w = 0d1) +TNS x = [[[0d1], [0d2], [0d3]], [[0d4], [0d5], [0d6]]] +TNS kernel = [[[[0d1, 0d2]]]] +TNS out = CONV(x, kernel, stride_w = 0d1) ASSERT(EQ(SHAPE(out), [0d2, 0d3, 0d2])) ASSERT(EQ(out, [[[0d1, 0d2], [0d2, 0d4], [0d3, 0d6]], [[0d4, 0d8], [0d5, 0d10], [0d6, 0d12]]])) \ No newline at end of file diff --git a/tests/cases/passing/conv-extended-bias.pre b/tests/cases/passing/conv-extended-bias.pre index 334e496..ca9011e 100644 --- a/tests/cases/passing/conv-extended-bias.pre +++ b/tests/cases/passing/conv-extended-bias.pre @@ -1,6 +1,6 @@ -TNS: x = [[[0d3]]] -TNS: kernel = [[[[0d2, 0d3]]]] -TNS: out = CONV(x, kernel, bias = [0d10, 0d20]) +TNS x = [[[0d3]]] +TNS kernel = [[[[0d2, 0d3]]]] +TNS out = CONV(x, kernel, bias = [0d10, 0d20]) ASSERT(EQ(SHAPE(out), [0d1, 0d1, 0d2])) ASSERT(EQ(out, [[[0d16, 0d29]]])) \ No newline at end of file diff --git a/tests/cases/passing/conv-extended-flt-output-type.pre b/tests/cases/passing/conv-extended-flt-output-type.pre index 4440c89..8cf873a 100644 --- a/tests/cases/passing/conv-extended-flt-output-type.pre +++ b/tests/cases/passing/conv-extended-flt-output-type.pre @@ -1,6 +1,6 @@ -TNS: x = [[[0d2.0]]] -TNS: kernel = [[[[0d1.5]]]] -TNS: out = CONV(x, kernel, stride_w = 0d1) +TNS x = [[[0d2.0]]] +TNS kernel = [[[[0d1.5]]]] +TNS out = CONV(x, kernel, stride_w = 0d1) ASSERT(EQ(out, [[[0d3.0]]])) ASSERT(EQ(TYPE(out[0d1, 0d1, 0d1]), "FLT")) \ No newline at end of file diff --git a/tests/cases/passing/conv-legacy-1d-clamp.pre b/tests/cases/passing/conv-legacy-1d-clamp.pre index e72004e..a6b846b 100644 --- a/tests/cases/passing/conv-legacy-1d-clamp.pre +++ b/tests/cases/passing/conv-legacy-1d-clamp.pre @@ -1,6 +1,6 @@ -TNS: x = [0d1, 0d2, 0d3] -TNS: k = [0d1, 0d1, 0d1] -TNS: out = CONV(x, k) +TNS x = [0d1, 0d2, 0d3] +TNS k = [0d1, 0d1, 0d1] +TNS out = CONV(x, k) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(SHAPE(out), [0d3])) diff --git a/tests/cases/passing/conv-legacy-flt-output-type.pre b/tests/cases/passing/conv-legacy-flt-output-type.pre index 39109c0..dddcb0f 100644 --- a/tests/cases/passing/conv-legacy-flt-output-type.pre +++ b/tests/cases/passing/conv-legacy-flt-output-type.pre @@ -1,4 +1,4 @@ -TNS: out = CONV([0d2.0], [0d1.0]) +TNS out = CONV([0d2.0], [0d1.0]) ASSERT(EQ(out, [0d2.0])) ASSERT(EQ(TYPE(out[0d1]), "FLT")) \ No newline at end of file diff --git a/tests/cases/passing/conv-legacy-int-output-type.pre b/tests/cases/passing/conv-legacy-int-output-type.pre index c861386..32fb441 100644 --- a/tests/cases/passing/conv-legacy-int-output-type.pre +++ b/tests/cases/passing/conv-legacy-int-output-type.pre @@ -1,4 +1,4 @@ -TNS: out = CONV([0d7], [0d1]) +TNS out = CONV([0d7], [0d1]) ASSERT(EQ(out, [0d7])) ASSERT(EQ(TYPE(out[0d1]), "INT")) \ No newline at end of file diff --git a/tests/cases/passing/conv-legacy-rank2-shape.pre b/tests/cases/passing/conv-legacy-rank2-shape.pre index c8b86a4..da7d060 100644 --- a/tests/cases/passing/conv-legacy-rank2-shape.pre +++ b/tests/cases/passing/conv-legacy-rank2-shape.pre @@ -1,6 +1,6 @@ -TNS: x = [[0d1, 0d2], [0d3, 0d4]] -TNS: k = [[0d0, 0d0, 0d0], [0d0, 0d1, 0d0], [0d0, 0d0, 0d0]] -TNS: out = CONV(x, k) +TNS x = [[0d1, 0d2], [0d3, 0d4]] +TNS k = [[0d0, 0d0, 0d0], [0d0, 0d1, 0d0], [0d0, 0d0, 0d0]] +TNS out = CONV(x, k) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) ASSERT(EQ(out, x)) \ No newline at end of file diff --git a/tests/cases/passing/convert-flt.pre b/tests/cases/passing/convert-flt.pre index 02dfdaa..824f5ea 100644 --- a/tests/cases/passing/convert-flt.pre +++ b/tests/cases/passing/convert-flt.pre @@ -1,4 +1,4 @@ -FLT: flt_value = 0d1.5 +FLT flt_value = 0d1.5 ASSERT(EQ(CONVERT(flt_value, 0b10), 0b1.1)) ASSERT(EQ(BASE(CONVERT(flt_value, 0b10)), 0d2)) diff --git a/tests/cases/passing/convert-int.pre b/tests/cases/passing/convert-int.pre index 4edab76..e539cd8 100644 --- a/tests/cases/passing/convert-int.pre +++ b/tests/cases/passing/convert-int.pre @@ -1,4 +1,4 @@ -INT: int_value = 0d42 +INT int_value = 0d42 ASSERT(EQ(CONVERT(int_value, 0x10), 0x2A)) ASSERT(EQ(BASE(CONVERT(int_value, 0x10)), 0d16)) diff --git a/tests/cases/passing/copy-from-pointer.pre b/tests/cases/passing/copy-from-pointer.pre index 4da455a..e11a169 100644 --- a/tests/cases/passing/copy-from-pointer.pre +++ b/tests/cases/passing/copy-from-pointer.pre @@ -1,5 +1,5 @@ -MAP: source = <"plain" = 0d2, "nested" = <"value" = 0d3>> -MAP: copied = COPY(@source) +MAP source = <"plain" = 0d2, "nested" = <"value" = 0d3>> +MAP copied = COPY(@source) copied<"plain"> = 0d9 ASSERT(EQ(source<"plain">, 0d2)) diff --git a/tests/cases/passing/copy-func.pre b/tests/cases/passing/copy-func.pre index 6d402e9..3973b8d 100644 --- a/tests/cases/passing/copy-func.pre +++ b/tests/cases/passing/copy-func.pre @@ -1,8 +1,8 @@ -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } -FUNC: func_copy = COPY(identity) +FUNC func_copy = COPY(identity) ASSERT(EQ(func_copy, identity)) ASSERT(EQ(func_copy(0d7), 0d7)) \ No newline at end of file diff --git a/tests/cases/passing/copy-map.pre b/tests/cases/passing/copy-map.pre index 5078a74..dd46ff5 100644 --- a/tests/cases/passing/copy-map.pre +++ b/tests/cases/passing/copy-map.pre @@ -1,3 +1,3 @@ -MAP: map_value = <"n" = 0d3> +MAP map_value = <"n" = 0d3> ASSERT(EQ(COPY(map_value), map_value)) \ No newline at end of file diff --git a/tests/cases/passing/copy-thr.pre b/tests/cases/passing/copy-thr.pre index e460b63..d10662d 100644 --- a/tests/cases/passing/copy-thr.pre +++ b/tests/cases/passing/copy-thr.pre @@ -1,5 +1,5 @@ THR(worker){} -THR: thread_copy = COPY(worker) +THR thread_copy = COPY(worker) ASSERT(EQ(thread_copy, worker)) \ No newline at end of file diff --git a/tests/cases/passing/copy-tns.pre b/tests/cases/passing/copy-tns.pre index 5f756f9..5c502e2 100644 --- a/tests/cases/passing/copy-tns.pre +++ b/tests/cases/passing/copy-tns.pre @@ -1,3 +1,3 @@ -TNS: tensor = [0d1, 0d2] +TNS tensor = [0d1, 0d2] ASSERT(EQ(COPY(tensor), tensor)) \ No newline at end of file diff --git a/tests/cases/passing/deepcopy-from-pointer.pre b/tests/cases/passing/deepcopy-from-pointer.pre index 2ddec8c..6482bc6 100644 --- a/tests/cases/passing/deepcopy-from-pointer.pre +++ b/tests/cases/passing/deepcopy-from-pointer.pre @@ -1,5 +1,5 @@ -MAP: source = <"plain" = 0d2, "nested" = <"value" = 0d3>> -MAP: copied = DEEPCOPY(@source) +MAP source = <"plain" = 0d2, "nested" = <"value" = 0d3>> +MAP copied = DEEPCOPY(@source) copied<"plain"> = 0d9 copied<"nested", "value"> = 0d8 diff --git a/tests/cases/passing/deepcopy-func.pre b/tests/cases/passing/deepcopy-func.pre index e1b45da..2cc86e1 100644 --- a/tests/cases/passing/deepcopy-func.pre +++ b/tests/cases/passing/deepcopy-func.pre @@ -1,8 +1,8 @@ -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } -FUNC: func_copy = DEEPCOPY(identity) +FUNC func_copy = DEEPCOPY(identity) ASSERT(EQ(func_copy, identity)) ASSERT(EQ(func_copy(0d7), 0d7)) \ No newline at end of file diff --git a/tests/cases/passing/deepcopy-map.pre b/tests/cases/passing/deepcopy-map.pre index ebf1c0c..2d36c3c 100644 --- a/tests/cases/passing/deepcopy-map.pre +++ b/tests/cases/passing/deepcopy-map.pre @@ -1,3 +1,3 @@ -MAP: map_value = <"n" = 0d3> +MAP map_value = <"n" = 0d3> ASSERT(EQ(DEEPCOPY(map_value), map_value)) \ No newline at end of file diff --git a/tests/cases/passing/deepcopy-thr.pre b/tests/cases/passing/deepcopy-thr.pre index a11f3ee..e8bad33 100644 --- a/tests/cases/passing/deepcopy-thr.pre +++ b/tests/cases/passing/deepcopy-thr.pre @@ -1,5 +1,5 @@ THR(worker){} -THR: thread_copy = DEEPCOPY(worker) +THR thread_copy = DEEPCOPY(worker) ASSERT(EQ(thread_copy, worker)) \ No newline at end of file diff --git a/tests/cases/passing/deepcopy-tns.pre b/tests/cases/passing/deepcopy-tns.pre index 11111c0..f2b8909 100644 --- a/tests/cases/passing/deepcopy-tns.pre +++ b/tests/cases/passing/deepcopy-tns.pre @@ -1,3 +1,3 @@ -TNS: tensor = [0d1, 0d2] +TNS tensor = [0d1, 0d2] ASSERT(EQ(DEEPCOPY(tensor), tensor)) \ No newline at end of file diff --git a/tests/cases/passing/del-frozen.pre b/tests/cases/passing/del-frozen.pre index a68b5c1..305b6fc 100644 --- a/tests/cases/passing/del-frozen.pre +++ b/tests/cases/passing/del-frozen.pre @@ -1,7 +1,7 @@ -BOOL: frozen_symbol = TRUE +BOOL frozen_symbol = TRUE REFUTE(FREEZE(frozen_symbol)) -BOOL: frozen_delete_failed = FALSE +BOOL frozen_delete_failed = FALSE TRY{ DEL(frozen_symbol) } CATCH { @@ -14,10 +14,10 @@ REFUTE(THAW(frozen_symbol)) REFUTE(DEL(frozen_symbol)) REFUTE(EXIST(frozen_symbol)) -BOOL: permafrozen_symbol = TRUE +BOOL permafrozen_symbol = TRUE REFUTE(PERMAFREEZE(permafrozen_symbol)) -BOOL: permafrozen_delete_failed = FALSE +BOOL permafrozen_delete_failed = FALSE TRY{ DEL(permafrozen_symbol) } CATCH { diff --git a/tests/cases/passing/del-map.pre b/tests/cases/passing/del-map.pre index 3beafe9..2b93c7b 100644 --- a/tests/cases/passing/del-map.pre +++ b/tests/cases/passing/del-map.pre @@ -1,8 +1,8 @@ -MAP: top = <"keep" = 0d1, "drop" = 0d2> +MAP top = <"keep" = 0d1, "drop" = 0d2> REFUTE(DEL(top<"drop">)) ASSERT(EQ(top, <"keep" = 0d1>)) -BOOL: top_missing = FALSE +BOOL top_missing = FALSE TRY{ top<"drop"> } CATCH { @@ -10,14 +10,14 @@ TRY{ } ASSERT(top_missing) -MAP: nested = <"outer" = <"keep" = 0d1, "drop" = 0d2>> +MAP nested = <"outer" = <"keep" = 0d1, "drop" = 0d2>> REFUTE(DEL(nested<"outer", "drop">)) ASSERT(EQ(nested, <"outer" = <"keep" = 0d1>>)) -MAP: missing_intermediate = <"outer" = <"keep" = 0d1>> +MAP missing_intermediate = <"outer" = <"keep" = 0d1>> REFUTE(DEL(missing_intermediate<"absent", "drop">)) ASSERT(EQ(missing_intermediate, <"outer" = <"keep" = 0d1>>)) -MAP: missing_final = <"outer" = <"keep" = 0d1>> +MAP missing_final = <"outer" = <"keep" = 0d1>> REFUTE(DEL(missing_final<"outer", "drop">)) ASSERT(EQ(missing_final, <"outer" = <"keep" = 0d1>>)) diff --git a/tests/cases/passing/del-symbol.pre b/tests/cases/passing/del-symbol.pre index 7d931fb..5385b2c 100644 --- a/tests/cases/passing/del-symbol.pre +++ b/tests/cases/passing/del-symbol.pre @@ -1,9 +1,9 @@ -BOOL: symbol = TRUE +BOOL symbol = TRUE ASSERT(EXIST(symbol)) REFUTE(DEL(symbol)) REFUTE(EXIST(symbol)) -BOOL: deleted_read_failed = FALSE +BOOL deleted_read_failed = FALSE TRY{ symbol } CATCH { @@ -11,7 +11,7 @@ TRY{ } ASSERT(deleted_read_failed) -INT: count = 0d1 +INT count = 0d1 REFUTE(DEL(count)) count = 0d2 ASSERT(EQ(count, 0d2)) diff --git a/tests/cases/passing/deletefile.pre b/tests/cases/passing/deletefile.pre index c1c9d6f..0be0985 100644 --- a/tests/cases/passing/deletefile.pre +++ b/tests/cases/passing/deletefile.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("temp.txt") +STR p = path.TEMPFILE("temp.txt") WRITEFILE("Prefix", p) ASSERT(EXISTFILE(p)) ASSERT(DELETEFILE(p)) diff --git a/tests/cases/passing/div-flt.pre b/tests/cases/passing/div-flt.pre index c6979c2..07ea638 100644 --- a/tests/cases/passing/div-flt.pre +++ b/tests/cases/passing/div-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x0.8 -FLT: left_oct_one = 0o1.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x0.8 +FLT left_oct_one = 0o1.0 ASSERT(EQ(DIV(left_oct, right_hex), 0x3.0)) ASSERT(EQ(BASE(DIV(left_oct, right_hex)), 0d16)) diff --git a/tests/cases/passing/div-int.pre b/tests/cases/passing/div-int.pre index 66cbe08..b614a9f 100644 --- a/tests/cases/passing/div-int.pre +++ b/tests/cases/passing/div-int.pre @@ -1,5 +1,5 @@ -INT: left_dec = 0d2 -INT: wide_hex = 0x10 +INT left_dec = 0d2 +INT wide_hex = 0x10 ASSERT(EQ(DIV(0d6, left_dec), 0d3)) ASSERT(EQ(BASE(DIV(0d6, left_dec)), 0d10)) diff --git a/tests/cases/passing/div-pointer-writeback.pre b/tests/cases/passing/div-pointer-writeback.pre index 067bd38..76b1d83 100644 --- a/tests/cases/passing/div-pointer-writeback.pre +++ b/tests/cases/passing/div-pointer-writeback.pre @@ -1,9 +1,9 @@ -INT: a1 = 0d6 -INT: b1 = 0d3 +INT a1 = 0d6 +INT b1 = 0d3 DIV(@a1, b1) ASSERT(EQ(a1, 0d2)) -FLT: f1 = 0d3.0 -FLT: g1 = 0d1.5 +FLT f1 = 0d3.0 +FLT g1 = 0d1.5 DIV(@f1, g1) ASSERT(EQ(f1, 0d2.0)) diff --git a/tests/cases/passing/eq-structured.pre b/tests/cases/passing/eq-structured.pre index ff79845..5d4a47a 100644 --- a/tests/cases/passing/eq-structured.pre +++ b/tests/cases/passing/eq-structured.pre @@ -1,13 +1,13 @@ -TNS: tensor = [[0d1, 0d2], [0d3, 0d4]] -TNS: tensor_copy = tensor +TNS tensor = [[0d1, 0d2], [0d3, 0d4]] +TNS tensor_copy = tensor -MAP: map_value = <"alpha" = 0d1, "beta" = [0d2, 0d3]> -MAP: map_copy = map_value +MAP map_value = <"alpha" = 0d1, "beta" = [0d2, 0d3]> +MAP map_copy = map_value -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } -FUNC: identity_alias = identity +FUNC identity_alias = identity THR(worker){} diff --git a/tests/cases/passing/exist.pre b/tests/cases/passing/exist.pre index 1f8e751..6858d94 100644 --- a/tests/cases/passing/exist.pre +++ b/tests/cases/passing/exist.pre @@ -1,16 +1,16 @@ -BOOL: outer = TRUE -BOOL: declared_only +BOOL outer = TRUE +BOOL declared_only -FUNC BOOL: outer_visible(){ +FUNC BOOL outer_visible(){ RETURN(EXIST(outer)) } -FUNC BOOL: inner_visible(){ - BOOL: inner = TRUE +FUNC BOOL inner_visible(){ + BOOL inner = TRUE RETURN(EXIST(inner)) } -FUNC BOOL: missing_visible(){ +FUNC BOOL missing_visible(){ RETURN(EXIST(missing)) } diff --git a/tests/cases/passing/export-alias-shared-module.pre b/tests/cases/passing/export-alias-shared-module.pre index 794b263..6f92b8d 100644 --- a/tests/cases/passing/export-alias-shared-module.pre +++ b/tests/cases/passing/export-alias-shared-module.pre @@ -1,15 +1,15 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") IMPORT_PATH(helper_path) IMPORT_PATH(helper_path, again) -INT: via_name = 0d7 +INT via_name = 0d7 REFUTE(EXPORT(via_name, export_target)) ASSERT(EQ(again.via_name, 0d7)) -INT: via_alias = 0d8 +INT via_alias = 0d8 REFUTE(EXPORT(via_alias, again)) ASSERT(EQ(export_target.via_alias, 0d8)) \ No newline at end of file diff --git a/tests/cases/passing/export-copy-map.pre b/tests/cases/passing/export-copy-map.pre index 891ee86..de5b510 100644 --- a/tests/cases/passing/export-copy-map.pre +++ b/tests/cases/passing/export-copy-map.pre @@ -1,11 +1,11 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) -MAP: box = <"value" = 0d5> +MAP box = <"value" = 0d5> REFUTE(EXPORT(box, helper)) box<"value"> = 0d6 diff --git a/tests/cases/passing/export-copy-tensor.pre b/tests/cases/passing/export-copy-tensor.pre index f3efbdb..f31a1d4 100644 --- a/tests/cases/passing/export-copy-tensor.pre +++ b/tests/cases/passing/export-copy-tensor.pre @@ -1,11 +1,11 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) -TNS: tensor = [0d5, 0d6] +TNS tensor = [0d5, 0d6] REFUTE(EXPORT(tensor, helper)) tensor[0d1] = 0d8 diff --git a/tests/cases/passing/export-qualified-call.pre b/tests/cases/passing/export-qualified-call.pre index c6783ff..5f5cf68 100644 --- a/tests/cases/passing/export-qualified-call.pre +++ b/tests/cases/passing/export-qualified-call.pre @@ -1,6 +1,6 @@ IMPORT(path, helper) -FUNC STR: describe(){ +FUNC STR describe(){ RETURN("exported") } diff --git a/tests/cases/passing/export-return-false.pre b/tests/cases/passing/export-return-false.pre index 05ea49c..5a570ca 100644 --- a/tests/cases/passing/export-return-false.pre +++ b/tests/cases/passing/export-return-false.pre @@ -1,12 +1,12 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/export_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/export_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) -INT: value = 0d42 -BOOL: result = EXPORT(value, helper) +INT value = 0d42 +BOOL result = EXPORT(value, helper) ASSERT(EQ(TYPE(result), "BOOL")) REFUTE(result) diff --git a/tests/cases/passing/extend-alias-qualified-namespace.pre b/tests/cases/passing/extend-alias-qualified-namespace.pre index 4b80a64..da91939 100644 --- a/tests/cases/passing/extend-alias-qualified-namespace.pre +++ b/tests/cases/passing/extend-alias-qualified-namespace.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") REFUTE(IMPORT_PATH(helper_path, first)) REFUTE(IMPORT_PATH(helper_path, second)) diff --git a/tests/cases/passing/extend-asmodule-global.pre b/tests/cases/passing/extend-asmodule-global.pre index 65a9ddd..5a55e05 100644 --- a/tests/cases/passing/extend-asmodule-global.pre +++ b/tests/cases/passing/extend-asmodule-global.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") REFUTE(IMPORT_PATH(helper_path, helper)) ASSERT(EQ(TST_EXT_ASMODULE_ONLY(), "asmodule-global")) \ No newline at end of file diff --git a/tests/cases/passing/extend-event-handlers.ps1 b/tests/cases/passing/extend-event-handlers.ps1 index 00f5b30..2e46d29 100644 --- a/tests/cases/passing/extend-event-handlers.ps1 +++ b/tests/cases/passing/extend-event-handlers.ps1 @@ -9,7 +9,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $programPath -Encoding Ascii -Value @' -FUNC INT: ping(){ +FUNC INT ping(){ RETURN(0d1) } diff --git a/tests/cases/passing/extend-explicit-suffix-rejected.ps1 b/tests/cases/passing/extend-explicit-suffix-rejected.ps1 index 5f863aa..095ccb0 100644 --- a/tests/cases/passing/extend-explicit-suffix-rejected.ps1 +++ b/tests/cases/passing/extend-explicit-suffix-rejected.ps1 @@ -13,7 +13,7 @@ try { Copy-Item -Path $coreExtension -Destination $stagedExtension -Force Set-Content -Path $programPath -Encoding Ascii -Value @" -BOOL: loaded = EXTEND($extensionSpecifier) +BOOL loaded = EXTEND($extensionSpecifier) REFUTE(loaded) "@ diff --git a/tests/cases/passing/extend-idempotent.pre b/tests/cases/passing/extend-idempotent.pre index bf59e54..f393505 100644 --- a/tests/cases/passing/extend-idempotent.pre +++ b/tests/cases/passing/extend-idempotent.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_twice.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_twice.pre") REFUTE(IMPORT_PATH(helper_path, helper)) REFUTE(helper.first_result) diff --git a/tests/cases/passing/extend-package-init.pre b/tests/cases/passing/extend-package-init.pre index 5b5b062..23f448c 100644 --- a/tests/cases/passing/extend-package-init.pre +++ b/tests/cases/passing/extend-package-init.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_package_loader.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_package_loader.pre") REFUTE(IMPORT_PATH(helper_path, helper)) REFUTE(helper.extend_result) diff --git a/tests/cases/passing/extend-package-submodule.pre b/tests/cases/passing/extend-package-submodule.pre index e256d81..68fb01e 100644 --- a/tests/cases/passing/extend-package-submodule.pre +++ b/tests/cases/passing/extend-package-submodule.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_submodule_loader.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_submodule_loader.pre") REFUTE(IMPORT_PATH(helper_path, helper)) REFUTE(helper.extend_result) diff --git a/tests/cases/passing/extend-periodic-hook.ps1 b/tests/cases/passing/extend-periodic-hook.ps1 index 97cb820..ae82af7 100644 --- a/tests/cases/passing/extend-periodic-hook.ps1 +++ b/tests/cases/passing/extend-periodic-hook.ps1 @@ -9,7 +9,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $programPath -Encoding Ascii -Value @' -INT: total = 0d0 +INT total = 0d0 FOR(i, 0d40){ total = ADD(total, i) diff --git a/tests/cases/passing/extend-qualified-namespace.pre b/tests/cases/passing/extend-qualified-namespace.pre index c89573d..978f178 100644 --- a/tests/cases/passing/extend-qualified-namespace.pre +++ b/tests/cases/passing/extend-qualified-namespace.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") REFUTE(IMPORT_PATH(helper_path, helper)) ASSERT(EQ(helper.extend_core.TST_EXT_RESTRICTED(), "core-restricted")) \ No newline at end of file diff --git a/tests/cases/passing/extend-return-false.pre b/tests/cases/passing/extend-return-false.pre index 78ca548..19e375b 100644 --- a/tests/cases/passing/extend-return-false.pre +++ b/tests/cases/passing/extend-return-false.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/extend_core_once.pre") REFUTE(IMPORT_PATH(helper_path, helper)) ASSERT(EQ(TYPE(helper.extend_result), "BOOL")) diff --git a/tests/cases/passing/extend-search-cwd-before-roots.ps1 b/tests/cases/passing/extend-search-cwd-before-roots.ps1 index 7dee70b..2e81f14 100644 --- a/tests/cases/passing/extend-search-cwd-before-roots.ps1 +++ b/tests/cases/passing/extend-search-cwd-before-roots.ps1 @@ -28,7 +28,7 @@ try { Add-StagedProbe $libStdProbe Add-StagedProbe $libUsrProbe - $sourceText = 'BOOL:loaded=EXTEND(search_probe);REFUTE(loaded);PRINT(TST_SEARCH_PROBE_PATH())' + $sourceText = 'BOOL loaded=EXTEND(search_probe);REFUTE(loaded);PRINT(TST_SEARCH_PROBE_PATH())' $result = Invoke-PrefixWithArguments -Arguments @('-source', $sourceText) -WorkingDirectory $cwdDir Assert-PrefixSuccess $result Assert-NoErrorOutput $result diff --git a/tests/cases/passing/extend-search-ext-std-before-ext-usr.ps1 b/tests/cases/passing/extend-search-ext-std-before-ext-usr.ps1 index fd4630b..05e9abd 100644 --- a/tests/cases/passing/extend-search-ext-std-before-ext-usr.ps1 +++ b/tests/cases/passing/extend-search-ext-std-before-ext-usr.ps1 @@ -25,7 +25,7 @@ try { Add-StagedProbe $libUsrProbe Set-Content -Path $programPath -Encoding Ascii -Value @' -BOOL: loaded = EXTEND(search_probe) +BOOL loaded = EXTEND(search_probe) REFUTE(loaded) PRINT(TST_SEARCH_PROBE_PATH()) '@ diff --git a/tests/cases/passing/extend-search-lib-std-before-lib-usr.ps1 b/tests/cases/passing/extend-search-lib-std-before-lib-usr.ps1 index f3e596f..40c07c9 100644 --- a/tests/cases/passing/extend-search-lib-std-before-lib-usr.ps1 +++ b/tests/cases/passing/extend-search-lib-std-before-lib-usr.ps1 @@ -21,7 +21,7 @@ try { Add-StagedProbe $libUsrProbe Set-Content -Path $programPath -Encoding Ascii -Value @' -BOOL: loaded = EXTEND(search_probe) +BOOL loaded = EXTEND(search_probe) REFUTE(loaded) PRINT(TST_SEARCH_PROBE_PATH()) '@ diff --git a/tests/cases/passing/extend-search-program-dir-first.ps1 b/tests/cases/passing/extend-search-program-dir-first.ps1 index 943a9d4..d637ca3 100644 --- a/tests/cases/passing/extend-search-program-dir-first.ps1 +++ b/tests/cases/passing/extend-search-program-dir-first.ps1 @@ -34,7 +34,7 @@ try { Add-StagedProbe $libUsrProbe Set-Content -Path $programPath -Encoding Ascii -Value @' -BOOL: loaded = EXTEND(search_probe) +BOOL loaded = EXTEND(search_probe) REFUTE(loaded) PRINT(TST_SEARCH_PROBE_PATH()) '@ diff --git a/tests/cases/passing/fadd-pointer-writeback.pre b/tests/cases/passing/fadd-pointer-writeback.pre index 19ea687..3003231 100644 --- a/tests/cases/passing/fadd-pointer-writeback.pre +++ b/tests/cases/passing/fadd-pointer-writeback.pre @@ -1,15 +1,15 @@ -FLT: f1 = 0d10.5 -FLT: g1 = 0d5.25 +FLT f1 = 0d10.5 +FLT g1 = 0d5.25 FADD(@f1, g1) ASSERT(EQ(f1, 0d15.75)) -FLT: f2 = 0d10.5 -FLT: g2 = 0d5.25 +FLT f2 = 0d10.5 +FLT g2 = 0d5.25 FADD(f2, @g2) ASSERT(EQ(g2, 0d15.75)) -FLT: f3 = 0d10.5 -FLT: g3 = 0d5.25 +FLT f3 = 0d10.5 +FLT g3 = 0d5.25 FADD(@f3, @g3) ASSERT(EQ(f3, 0d15.75)) ASSERT(EQ(g3, 0d15.75)) diff --git a/tests/cases/passing/fadd.pre b/tests/cases/passing/fadd.pre index 98bef31..bd3c43b 100644 --- a/tests/cases/passing/fadd.pre +++ b/tests/cases/passing/fadd.pre @@ -1,3 +1,3 @@ ! Passing float arithmetic, checking coercion and correct logic -FLT: result_add = FADD(0d10.5, 0d5.25) +FLT result_add = FADD(0d10.5, 0d5.25) ASSERT(EQ(result_add, 0d15.75)) diff --git a/tests/cases/passing/fdiv-pointer-writeback.pre b/tests/cases/passing/fdiv-pointer-writeback.pre index 33102f2..eac662f 100644 --- a/tests/cases/passing/fdiv-pointer-writeback.pre +++ b/tests/cases/passing/fdiv-pointer-writeback.pre @@ -1,4 +1,4 @@ -FLT: f1 = 0d6.0 -FLT: g1 = 0d3.0 +FLT f1 = 0d6.0 +FLT g1 = 0d3.0 FDIV(@f1, g1) ASSERT(EQ(f1, 0d2.0)) diff --git a/tests/cases/passing/fdiv.pre b/tests/cases/passing/fdiv.pre index 2852f1a..b501c77 100644 --- a/tests/cases/passing/fdiv.pre +++ b/tests/cases/passing/fdiv.pre @@ -1,7 +1,7 @@ -INT: a = IADD(0d1, 0d1.0) -FLT: b = FDIV(0d1.0, 0d1.0) -FLT: x = 0d1.0 -FLT: y = 0d0.5 -FLT: result_div = FDIV(x, y) +INT a = IADD(0d1, 0d1.0) +FLT b = FDIV(0d1.0, 0d1.0) +FLT x = 0d1.0 +FLT y = 0d0.5 +FLT result_div = FDIV(x, y) ASSERT(EQ(result_div, 0d2.0)) -FLT: c = FPOW(-0d1.0, 0d0.5) +FLT c = FPOW(-0d1.0, 0d0.5) diff --git a/tests/cases/passing/fill-basic.pre b/tests/cases/passing/fill-basic.pre index ff0bbbf..ca37620 100644 --- a/tests/cases/passing/fill-basic.pre +++ b/tests/cases/passing/fill-basic.pre @@ -1,4 +1,4 @@ -TNS: src = [0d1, 0d2, 0d3] +TNS src = [0d1, 0d2, 0d3] ASSERT(EQ(TYPE(FILL(src, 0d9)), "TNS")) ASSERT(EQ(FILL(src, 0d9), [0d9, 0d9, 0d9])) \ No newline at end of file diff --git a/tests/cases/passing/fill-bool-elements.pre b/tests/cases/passing/fill-bool-elements.pre index 0990ad0..e542f65 100644 --- a/tests/cases/passing/fill-bool-elements.pre +++ b/tests/cases/passing/fill-bool-elements.pre @@ -1,3 +1,3 @@ -TNS: flags = [TRUE, FALSE, TRUE] +TNS flags = [TRUE, FALSE, TRUE] ASSERT(EQ(FILL(flags, FALSE), [FALSE, FALSE, FALSE])) \ No newline at end of file diff --git a/tests/cases/passing/fill-rank2-shape.pre b/tests/cases/passing/fill-rank2-shape.pre index 385232a..b1b7529 100644 --- a/tests/cases/passing/fill-rank2-shape.pre +++ b/tests/cases/passing/fill-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d1, 0d2], [0d3, 0d4]] -TNS: out = FILL(src, 0d0) +TNS src = [[0d1, 0d2], [0d3, 0d4]] +TNS out = FILL(src, 0d0) ASSERT(EQ(out, [[0d0, 0d0], [0d0, 0d0]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) \ No newline at end of file diff --git a/tests/cases/passing/fill-source-unchanged.pre b/tests/cases/passing/fill-source-unchanged.pre index b8ffc20..d7236e9 100644 --- a/tests/cases/passing/fill-source-unchanged.pre +++ b/tests/cases/passing/fill-source-unchanged.pre @@ -1,5 +1,5 @@ -TNS: src = [0d10, 0d20] -TNS: out = FILL(src, 0d99) +TNS src = [0d10, 0d20] +TNS out = FILL(src, 0d99) ASSERT(EQ(src, [0d10, 0d20])) ASSERT(EQ(out, [0d99, 0d99])) \ No newline at end of file diff --git a/tests/cases/passing/fill-string-elements.pre b/tests/cases/passing/fill-string-elements.pre index bb43da1..b610ee2 100644 --- a/tests/cases/passing/fill-string-elements.pre +++ b/tests/cases/passing/fill-string-elements.pre @@ -1,3 +1,3 @@ -TNS: words = ["alpha", "beta", "gamma"] +TNS words = ["alpha", "beta", "gamma"] ASSERT(EQ(FILL(words, "z"), ["z", "z", "z"])) \ No newline at end of file diff --git a/tests/cases/passing/flt.pre b/tests/cases/passing/flt.pre index e36fee7..fc48301 100644 --- a/tests/cases/passing/flt.pre +++ b/tests/cases/passing/flt.pre @@ -1,11 +1,11 @@ -FLT: a = 0d1.5 -FLT: b = -0d0.25 -FLT: c = 0b1.1 -FLT: d = 0xA.F -FLT: e = 0r16F.8 -FLT: f = INF -FLT: g = -INF -FLT: h = NaN +FLT a = 0d1.5 +FLT b = -0d0.25 +FLT c = 0b1.1 +FLT d = 0xA.F +FLT e = 0r16F.8 +FLT f = INF +FLT g = -INF +FLT h = NaN ASSERT(EQ(a, 0d1.5)) ASSERT(EQ(b, -0d0.25)) diff --git a/tests/cases/passing/fmul-pointer-writeback.pre b/tests/cases/passing/fmul-pointer-writeback.pre index a15c604..d98c5c5 100644 --- a/tests/cases/passing/fmul-pointer-writeback.pre +++ b/tests/cases/passing/fmul-pointer-writeback.pre @@ -1,15 +1,15 @@ -FLT: f1 = 0d2.5 -FLT: g1 = 0d4.0 +FLT f1 = 0d2.5 +FLT g1 = 0d4.0 FMUL(@f1, g1) ASSERT(EQ(f1, 0d10.0)) -FLT: f2 = 0d2.5 -FLT: g2 = 0d4.0 +FLT f2 = 0d2.5 +FLT g2 = 0d4.0 FMUL(f2, @g2) ASSERT(EQ(g2, 0d10.0)) -FLT: f3 = 0d2.5 -FLT: g3 = 0d4.0 +FLT f3 = 0d2.5 +FLT g3 = 0d4.0 FMUL(@f3, @g3) ASSERT(EQ(f3, 0d10.0)) ASSERT(EQ(g3, 0d10.0)) diff --git a/tests/cases/passing/fmul.pre b/tests/cases/passing/fmul.pre index 50e9cc4..54fdf27 100644 --- a/tests/cases/passing/fmul.pre +++ b/tests/cases/passing/fmul.pre @@ -1,3 +1,3 @@ ! Passing float arithmetic, checking coercion and correct logic -FLT: result_mul = FMUL(0d4.25, 0d2.0) +FLT result_mul = FMUL(0d4.25, 0d2.0) ASSERT(EQ(result_mul, 0d8.5)) diff --git a/tests/cases/passing/for-zero-and-restore-counter.pre b/tests/cases/passing/for-zero-and-restore-counter.pre index 850d363..6e9b518 100644 --- a/tests/cases/passing/for-zero-and-restore-counter.pre +++ b/tests/cases/passing/for-zero-and-restore-counter.pre @@ -1,3 +1,3 @@ -STR: i = "foo" +STR i = "foo" FOR(i, 0d10){} ASSERT(EQ(i, "foo")) \ No newline at end of file diff --git a/tests/cases/passing/for.pre b/tests/cases/passing/for.pre index 1ec7f7e..5682fcb 100644 --- a/tests/cases/passing/for.pre +++ b/tests/cases/passing/for.pre @@ -1,4 +1,4 @@ -INT: sum = 0d0 +INT sum = 0d0 FOR(i, 0d4){ ADD(@sum, i) } diff --git a/tests/cases/passing/fpow.pre b/tests/cases/passing/fpow.pre index 2d2397e..db9a114 100644 --- a/tests/cases/passing/fpow.pre +++ b/tests/cases/passing/fpow.pre @@ -1,3 +1,3 @@ ! Passing float arithmetic, checking coercion and correct logic -FLT: result_pow = FPOW(0d2.5, 0d2.0) +FLT result_pow = FPOW(0d2.5, 0d2.0) ASSERT(EQ(result_pow, 0d6.25)) diff --git a/tests/cases/passing/fprod-base.pre b/tests/cases/passing/fprod-base.pre index 226976c..3c31967 100644 --- a/tests/cases/passing/fprod-base.pre +++ b/tests/cases/passing/fprod-base.pre @@ -1,5 +1,5 @@ ! FPROD result uses the highest numeric base present among operands -FLT: result = FPROD(0d2, 0x3.0) +FLT result = FPROD(0d2, 0x3.0) ASSERT(EQ(result, 0x6.0)) ASSERT(EQ(BASE(result), 0d16)) \ No newline at end of file diff --git a/tests/cases/passing/fprod-inf.pre b/tests/cases/passing/fprod-inf.pre index 8052fcd..2215ff5 100644 --- a/tests/cases/passing/fprod-inf.pre +++ b/tests/cases/passing/fprod-inf.pre @@ -1,3 +1,3 @@ ! FPROD preserves INF under float arithmetic -FLT: result = FPROD(INF, 0d2.0) +FLT result = FPROD(INF, 0d2.0) ASSERT(EQ(result, INF)) \ No newline at end of file diff --git a/tests/cases/passing/fprod-mixed.pre b/tests/cases/passing/fprod-mixed.pre index a36b2f9..17da06b 100644 --- a/tests/cases/passing/fprod-mixed.pre +++ b/tests/cases/passing/fprod-mixed.pre @@ -1,3 +1,3 @@ ! FPROD coerces mixed numeric inputs to FLT before multiplying -FLT: result = FPROD(0d2, 0d3.5, 0d4) +FLT result = FPROD(0d2, 0d3.5, 0d4) ASSERT(EQ(result, 0d28.0)) \ No newline at end of file diff --git a/tests/cases/passing/fprod-single-int.pre b/tests/cases/passing/fprod-single-int.pre index 2b602fb..22daf6e 100644 --- a/tests/cases/passing/fprod-single-int.pre +++ b/tests/cases/passing/fprod-single-int.pre @@ -1,3 +1,3 @@ ! FPROD coerces a single INT argument to FLT -FLT: result = FPROD(0d3) +FLT result = FPROD(0d3) ASSERT(EQ(result, 0d3.0)) \ No newline at end of file diff --git a/tests/cases/passing/freeze.pre b/tests/cases/passing/freeze.pre index 7ac4ca5..34c2450 100644 --- a/tests/cases/passing/freeze.pre +++ b/tests/cases/passing/freeze.pre @@ -1,10 +1,10 @@ -BOOL: frozen_value = TRUE +BOOL frozen_value = TRUE REFUTE(FREEZE(frozen_value)) ASSERT(FROZEN(frozen_value)) REFUTE(PERMAFROZEN(frozen_value)) -BOOL: freeze_undefined_failed = FALSE +BOOL freeze_undefined_failed = FALSE TRY{ FREEZE(not_declared) } CATCH { @@ -12,7 +12,7 @@ TRY{ } ASSERT(freeze_undefined_failed) -BOOL: reassignment_failed = FALSE +BOOL reassignment_failed = FALSE TRY{ frozen_value = FALSE } CATCH { @@ -21,7 +21,7 @@ TRY{ ASSERT(reassignment_failed) ASSERT(EQ(frozen_value, TRUE)) -BOOL: deletion_failed = FALSE +BOOL deletion_failed = FALSE TRY{ DEL(frozen_value) } CATCH { diff --git a/tests/cases/passing/froot-neg.pre b/tests/cases/passing/froot-neg.pre index ade9f07..8d62a4a 100644 --- a/tests/cases/passing/froot-neg.pre +++ b/tests/cases/passing/froot-neg.pre @@ -1,3 +1,3 @@ ! FROOT negative example with odd exponent allowed -FLT: result = FROOT(-0d8.0, 0d3.0) +FLT result = FROOT(-0d8.0, 0d3.0) ASSERT(EQ(result, -0d2.0)) diff --git a/tests/cases/passing/froot.pre b/tests/cases/passing/froot.pre index bf61ec5..22598fc 100644 --- a/tests/cases/passing/froot.pre +++ b/tests/cases/passing/froot.pre @@ -1,6 +1,6 @@ -FLT: result_root_normal = FROOT(0d16.0, 0d2.0) +FLT result_root_normal = FROOT(0d16.0, 0d2.0) ASSERT(EQ(result_root_normal, 0d4.0)) ! FROOT positive example: cube root of 8.0 (merged from froot.pre) -FLT: result = FROOT(0d8.0, 0d3.0) +FLT result = FROOT(0d8.0, 0d3.0) ASSERT(EQ(result, 0d2.0)) diff --git a/tests/cases/passing/frozen.pre b/tests/cases/passing/frozen.pre index 3d2f600..ca921c9 100644 --- a/tests/cases/passing/frozen.pre +++ b/tests/cases/passing/frozen.pre @@ -1,4 +1,4 @@ -BOOL: normal_value = TRUE +BOOL normal_value = TRUE REFUTE(FROZEN(normal_value)) REFUTE(FREEZE(normal_value)) diff --git a/tests/cases/passing/fsub-pointer-writeback.pre b/tests/cases/passing/fsub-pointer-writeback.pre index 9dc47d0..2b38301 100644 --- a/tests/cases/passing/fsub-pointer-writeback.pre +++ b/tests/cases/passing/fsub-pointer-writeback.pre @@ -1,4 +1,4 @@ -FLT: f1 = 0d10.5 -FLT: g1 = 0d5.25 +FLT f1 = 0d10.5 +FLT g1 = 0d5.25 FSUB(@f1, g1) ASSERT(EQ(f1, 0d5.25)) diff --git a/tests/cases/passing/fsub.pre b/tests/cases/passing/fsub.pre index 6b62891..7030f20 100644 --- a/tests/cases/passing/fsub.pre +++ b/tests/cases/passing/fsub.pre @@ -1,3 +1,3 @@ ! Passing float arithmetic, checking coercion and correct logic -FLT: result_sub = FSUB(0d10.0, 0d2) +FLT result_sub = FSUB(0d10.0, 0d2) ASSERT(EQ(result_sub, 0d8.0)) diff --git a/tests/cases/passing/fsum-inf.pre b/tests/cases/passing/fsum-inf.pre index dca6a91..14f64e3 100644 --- a/tests/cases/passing/fsum-inf.pre +++ b/tests/cases/passing/fsum-inf.pre @@ -1,3 +1,3 @@ ! FSUM preserves INF under float arithmetic -FLT: result = FSUM(INF, 0d1.0) +FLT result = FSUM(INF, 0d1.0) ASSERT(EQ(result, INF)) diff --git a/tests/cases/passing/fsum.pre b/tests/cases/passing/fsum.pre index ec80d46..cab1d43 100644 --- a/tests/cases/passing/fsum.pre +++ b/tests/cases/passing/fsum.pre @@ -1,3 +1,3 @@ ! FSUM coerces mixed numeric inputs to FLT -FLT: result = FSUM(0d1, 0d2.5, 0d3) +FLT result = FSUM(0d1, 0d2.5, 0d3) ASSERT(EQ(result, 0d6.5)) diff --git a/tests/cases/passing/func-arguments.pre b/tests/cases/passing/func-arguments.pre index 33ce429..2c3b4b1 100644 --- a/tests/cases/passing/func-arguments.pre +++ b/tests/cases/passing/func-arguments.pre @@ -1,11 +1,11 @@ -INT: order_trace = 0d0 +INT order_trace = 0d0 -FUNC INT: mark(INT: step){ +FUNC INT mark(INT step){ order_trace = ADD(MUL(order_trace, 0d10), step) RETURN(step) } -FUNC INT: place(INT: first, INT: second = 0d0){ +FUNC INT place(INT first, INT second = 0d0){ RETURN(ADD(MUL(first, 0d10), second)) } @@ -13,8 +13,8 @@ order_trace = 0d0 ASSERT(EQ(place(mark(0d1), second = mark(0d2)), 0d12)) ASSERT(EQ(order_trace, 0d12)) -INT: outer_bonus = 0d1 -FUNC INT: add_bonus(INT: value, INT: bonus = outer_bonus){ +INT outer_bonus = 0d1 +FUNC INT add_bonus(INT value, INT bonus = outer_bonus){ RETURN(ADD(value, bonus)) } @@ -22,18 +22,18 @@ ASSERT(EQ(add_bonus(0d2), 0d3)) outer_bonus = 0d4 ASSERT(EQ(add_bonus(0d2), 0d6)) -FUNC INT: double_self(INT: value, INT: second = value){ +FUNC INT double_self(INT value, INT second = value){ RETURN(ADD(value, second)) } ASSERT(EQ(double_self(0d3), 0d6)) ASSERT(EQ(double_self(0d3, second = 0d1), 0d4)) -FUNC INT: accept_int(INT: value){ +FUNC INT accept_int(INT value){ RETURN(value) } -FUNC INT: coerce_int(~INT: value){ +FUNC INT coerce_int(~INT value){ RETURN(value) } diff --git a/tests/cases/passing/func-basics.pre b/tests/cases/passing/func-basics.pre index 435d707..c98fc5f 100644 --- a/tests/cases/passing/func-basics.pre +++ b/tests/cases/passing/func-basics.pre @@ -1,30 +1,30 @@ -FUNC INT: add(INT: left, INT: right){ +FUNC INT add(INT left, INT right){ RETURN(ADD(left, right)) } ASSERT(EQ(add(0d2, 0d3), 0d5)) -FUNC: add_alias = add +FUNC add_alias = add ASSERT(EQ(add_alias(0d4, 0d5), 0d9)) -FUNC BOOL: bool_default(){} -FUNC INT: int_default(){} -FUNC FLT: flt_default(){} -FUNC STR: str_default(){} +FUNC BOOL bool_default(){} +FUNC INT int_default(){} +FUNC FLT flt_default(){} +FUNC STR str_default(){} ASSERT(EQ(bool_default(), FALSE)) ASSERT(EQ(int_default(), 0d0)) ASSERT(EQ(flt_default(), 0d0.0)) ASSERT(EQ(str_default(), "")) -BOOL: func_truthy = FALSE +BOOL func_truthy = FALSE IF(add_alias){ func_truthy = TRUE } ASSERT(func_truthy) -INT: stop_flag = 0d0 -FUNC INT: early_return(){ +INT stop_flag = 0d0 +FUNC INT early_return(){ RETURN(0d7) stop_flag = 0d1 } diff --git a/tests/cases/passing/func-call-errors.pre b/tests/cases/passing/func-call-errors.pre index 58fb71c..c5ab10d 100644 --- a/tests/cases/passing/func-call-errors.pre +++ b/tests/cases/passing/func-call-errors.pre @@ -1,14 +1,14 @@ -INT: runtime_errors = 0d0 +INT runtime_errors = 0d0 -FUNC INT: accept_int(INT: value){ +FUNC INT accept_int(INT value){ RETURN(value) } -FUNC INT: coerce_int(~INT: value){ +FUNC INT coerce_int(~INT value){ RETURN(value) } -FUNC INT: keyword_only(INT: left, INT: right = 0d0){ +FUNC INT keyword_only(INT left, INT right = 0d0){ RETURN(ADD(left, right)) } diff --git a/tests/cases/passing/func-closures.pre b/tests/cases/passing/func-closures.pre index 6daa73f..215731a 100644 --- a/tests/cases/passing/func-closures.pre +++ b/tests/cases/passing/func-closures.pre @@ -1,10 +1,10 @@ -INT: captured = 0d2 +INT captured = 0d2 -FUNC INT: read_captured(){ +FUNC INT read_captured(){ RETURN(captured) } -FUNC: add_captured = LAMBDA INT: (INT: delta){ +FUNC add_captured = LAMBDA INT: (INT delta){ RETURN(ADD(captured, delta)) } @@ -14,26 +14,26 @@ captured = 0d5 ASSERT(EQ(read_captured(), 0d5)) ASSERT(EQ(add_captured(0d1), 0d6)) -FUNC: greeter = LAMBDA STR: (STR: name, STR: prefix = "Hi"){ +FUNC greeter = LAMBDA STR: (STR name, STR prefix = "Hi"){ RETURN(JOIN(" ", prefix, name)) } ASSERT(EQ(greeter("Prefix"), "Hi Prefix")) ASSERT(EQ(greeter("Prefix", prefix = "Hello"), "Hello Prefix")) -ASSERT(EQ((LAMBDA INT: (INT: x){ RETURN(ADD(x, 0d1)) })(0d2), 0d3)) +ASSERT(EQ((LAMBDA INT: (INT x){ RETURN(ADD(x, 0d1)) })(0d2), 0d3)) -FUNC INT: invoke(FUNC: callable, INT: arg){ +FUNC INT invoke(FUNC callable, INT arg){ RETURN(callable(arg)) } ASSERT(EQ(invoke(add_captured, 0d2), 0d7)) -FUNC FUNC: make_reader(INT: seed){ +FUNC FUNC make_reader(INT seed){ RETURN(LAMBDA INT: (){ RETURN(seed) }) } -FUNC: reader = make_reader(0d9) +FUNC reader = make_reader(0d9) ASSERT(EQ(reader(), 0d9)) diff --git a/tests/cases/passing/func-containers.pre b/tests/cases/passing/func-containers.pre index 79e3876..eac32e9 100644 --- a/tests/cases/passing/func-containers.pre +++ b/tests/cases/passing/func-containers.pre @@ -1,21 +1,21 @@ -TNS: func_slots = [LAMBDA INT: (INT: left, INT: right){ RETURN(ADD(left, right)) }] +TNS func_slots = [LAMBDA INT: (INT left, INT right){ RETURN(ADD(left, right)) }] ASSERT(EQ(func_slots[0d1](0d2, 0d3), 0d5)) -MAP: func_map = <"sum" = func_slots[0d1]> +MAP func_map = <"sum" = func_slots[0d1]> ASSERT(EQ(func_map<"sum">(0d3, 0d4), 0d7)) -MAP: method_map = < ^ +MAP method_map = < ^ "install" = LAMBDA FUNC: (){ ^ SELF<"tag"> = LAMBDA INT: (){ RETURN(0d7) } ^ RETURN(SELF<"tag">) ^ }, ^ "seed" = LAMBDA INT: (){ RETURN(0d1) } ^ > -MAP: method_copy = method_map -MAP: method_alias = @method_map +MAP method_copy = method_map +MAP method_alias = @method_map ASSERT(EQ(method_copy<"install">()(), 0d7)) -BOOL: copy_did_not_mutate_source = FALSE +BOOL copy_did_not_mutate_source = FALSE TRY{ method_map<"tag">() } CATCH(err){ diff --git a/tests/cases/passing/func-pop.pre b/tests/cases/passing/func-pop.pre index 41dae79..c3a81ed 100644 --- a/tests/cases/passing/func-pop.pre +++ b/tests/cases/passing/func-pop.pre @@ -1,11 +1,11 @@ -INT: pop_target = 0d8 +INT pop_target = 0d8 -FUNC INT: take_and_delete(){ +FUNC INT take_and_delete(){ POP(pop_target) } ASSERT(EQ(take_and_delete(), 0d8)) -BOOL: pop_deleted = FALSE +BOOL pop_deleted = FALSE TRY{ pop_target } CATCH(err){ diff --git a/tests/cases/passing/func-return-errors.pre b/tests/cases/passing/func-return-errors.pre index 9d868c7..582d391 100644 --- a/tests/cases/passing/func-return-errors.pre +++ b/tests/cases/passing/func-return-errors.pre @@ -1,6 +1,6 @@ -INT: runtime_errors = 0d0 +INT runtime_errors = 0d0 -FUNC INT: wrong_return(){ +FUNC INT wrong_return(){ RETURN("bad") } @@ -10,35 +10,35 @@ TRY{ runtime_errors = ADD(runtime_errors, 0d1) } -FUNC TNS: missing_tns_return(){} +FUNC TNS missing_tns_return(){} TRY{ missing_tns_return() } CATCH(err){ runtime_errors = ADD(runtime_errors, 0d1) } -FUNC MAP: missing_map_return(){} +FUNC MAP missing_map_return(){} TRY{ missing_map_return() } CATCH(err){ runtime_errors = ADD(runtime_errors, 0d1) } -FUNC FUNC: missing_func_return(){} +FUNC FUNC missing_func_return(){} TRY{ missing_func_return() } CATCH(err){ runtime_errors = ADD(runtime_errors, 0d1) } -FUNC THR: missing_thr_return(){} +FUNC THR missing_thr_return(){} TRY{ missing_thr_return() } CATCH(err){ runtime_errors = ADD(runtime_errors, 0d1) } -FUNC: missing_lambda_return = LAMBDA FUNC: (){} +FUNC missing_lambda_return = LAMBDA FUNC: (){} TRY{ missing_lambda_return() } CATCH(err){ diff --git a/tests/cases/passing/gcd-flt.pre b/tests/cases/passing/gcd-flt.pre index 76e405b..b564197 100644 --- a/tests/cases/passing/gcd-flt.pre +++ b/tests/cases/passing/gcd-flt.pre @@ -1,8 +1,8 @@ -FLT: left_dec = 0d54.0 -FLT: right_hex = 0x18.0 -FLT: zero_oct = 0o0.0 -FLT: co_prime_left_oct = 0o17.0 -FLT: co_prime_right_dec = 0d13.0 +FLT left_dec = 0d54.0 +FLT right_hex = 0x18.0 +FLT zero_oct = 0o0.0 +FLT co_prime_left_oct = 0o17.0 +FLT co_prime_right_dec = 0d13.0 ASSERT(EQ(GCD(left_dec, right_hex), 0x6.0)) ASSERT(EQ(GCD(right_hex, left_dec), 0x6.0)) diff --git a/tests/cases/passing/gcd-int.pre b/tests/cases/passing/gcd-int.pre index c438427..711e3d2 100644 --- a/tests/cases/passing/gcd-int.pre +++ b/tests/cases/passing/gcd-int.pre @@ -1,8 +1,8 @@ -INT: left_dec = 0d54 -INT: right_hex = 0x18 -INT: zero_bin = 0b0 -INT: co_prime_left_oct = 0o17 -INT: co_prime_right_dec = 0d13 +INT left_dec = 0d54 +INT right_hex = 0x18 +INT zero_bin = 0b0 +INT co_prime_left_oct = 0o17 +INT co_prime_right_dec = 0d13 ASSERT(EQ(GCD(left_dec, right_hex), 0x6)) ASSERT(EQ(GCD(right_hex, left_dec), 0x6)) diff --git a/tests/cases/passing/goto-backward.pre b/tests/cases/passing/goto-backward.pre index ff45e8b..028fa63 100644 --- a/tests/cases/passing/goto-backward.pre +++ b/tests/cases/passing/goto-backward.pre @@ -1,5 +1,5 @@ -INT: i = 0d0 -INT: hits = 0d0 +INT i = 0d0 +INT hits = 0d0 GOTOPOINT('loop') ADD(@hits, 0d1) IF(LT(i, 0d2)){ diff --git a/tests/cases/passing/goto-cross-block.pre b/tests/cases/passing/goto-cross-block.pre index 16af49f..9c689df 100644 --- a/tests/cases/passing/goto-cross-block.pre +++ b/tests/cases/passing/goto-cross-block.pre @@ -1,4 +1,4 @@ -INT: test = 0d0 +INT test = 0d0 IF(TRUE){ GOTO('target') ASSERT(FALSE) diff --git a/tests/cases/passing/goto-errors.pre b/tests/cases/passing/goto-errors.pre index 40d6b9c..2e83acb 100644 --- a/tests/cases/passing/goto-errors.pre +++ b/tests/cases/passing/goto-errors.pre @@ -1,4 +1,4 @@ -INT: errors_caught = 0d0 +INT errors_caught = 0d0 TRY { GOTOPOINT(TRUE) diff --git a/tests/cases/passing/goto-forward.pre b/tests/cases/passing/goto-forward.pre index 82a8007..0db9ca8 100644 --- a/tests/cases/passing/goto-forward.pre +++ b/tests/cases/passing/goto-forward.pre @@ -1,4 +1,4 @@ -INT: value = 0d0 +INT value = 0d0 GOTO(0d1) ASSERT(FALSE) GOTOPOINT(0d1) diff --git a/tests/cases/passing/iadd-pointer-writeback.pre b/tests/cases/passing/iadd-pointer-writeback.pre index ef41e5c..92acaf9 100644 --- a/tests/cases/passing/iadd-pointer-writeback.pre +++ b/tests/cases/passing/iadd-pointer-writeback.pre @@ -1,15 +1,15 @@ -INT: a1 = 0d10 -INT: b1 = 0d5 +INT a1 = 0d10 +INT b1 = 0d5 IADD(@a1, b1) ASSERT(EQ(a1, 0d15)) -INT: a2 = 0d10 -INT: b2 = 0d5 +INT a2 = 0d10 +INT b2 = 0d5 IADD(a2, @b2) ASSERT(EQ(b2, 0d15)) -INT: a3 = 0d10 -INT: b3 = 0d5 +INT a3 = 0d10 +INT b3 = 0d5 IADD(@a3, @b3) ASSERT(EQ(a3, 0d15)) ASSERT(EQ(b3, 0d15)) diff --git a/tests/cases/passing/iadd.pre b/tests/cases/passing/iadd.pre index f7617da..2b9eb9a 100644 --- a/tests/cases/passing/iadd.pre +++ b/tests/cases/passing/iadd.pre @@ -1,4 +1,4 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_add_1 = IADD(0d10, 0d5) -INT: result_add_2 = IADD(0d10.5, 0d5.2) ! Coerces to integers before/after? +INT result_add_1 = IADD(0d10, 0d5) +INT result_add_2 = IADD(0d10.5, 0d5.2) ! Coerces to integers before/after? ASSERT(EQ(result_add_1, 0d15)) diff --git a/tests/cases/passing/ident-includes-chars.pre b/tests/cases/passing/ident-includes-chars.pre index 6d1d10f..7cd5877 100644 --- a/tests/cases/passing/ident-includes-chars.pre +++ b/tests/cases/passing/ident-includes-chars.pre @@ -1,68 +1,68 @@ -BOOL: A = TRUE -BOOL: B = TRUE -BOOL: C = TRUE -BOOL: D = TRUE -BOOL: E = TRUE -BOOL: F = TRUE -BOOL: G = TRUE -BOOL: H = TRUE -BOOL: I = TRUE -BOOL: J = TRUE -BOOL: K = TRUE -BOOL: L = TRUE -BOOL: M = TRUE -BOOL: N = TRUE -BOOL: O = TRUE -BOOL: P = TRUE -BOOL: Q = TRUE -BOOL: R = TRUE -BOOL: S = TRUE -BOOL: T = TRUE -BOOL: U = TRUE -BOOL: V = TRUE -BOOL: W = TRUE -BOOL: X = TRUE -BOOL: Y = TRUE -BOOL: Z = TRUE -BOOL: a = TRUE -BOOL: b = TRUE -BOOL: c = TRUE -BOOL: d = TRUE -BOOL: e = TRUE -BOOL: f = TRUE -BOOL: g = TRUE -BOOL: h = TRUE -BOOL: i = TRUE -BOOL: j = TRUE -BOOL: k = TRUE -BOOL: l = TRUE -BOOL: m = TRUE -BOOL: n = TRUE -BOOL: o = TRUE -BOOL: p = TRUE -BOOL: q = TRUE -BOOL: r = TRUE -BOOL: s = TRUE -BOOL: t = TRUE -BOOL: u = TRUE -BOOL: v = TRUE -BOOL: w = TRUE -BOOL: x = TRUE -BOOL: y = TRUE -BOOL: z = TRUE -BOOL: 2 = TRUE -BOOL: 3 = TRUE -BOOL: 4 = TRUE -BOOL: 5 = TRUE -BOOL: 6 = TRUE -BOOL: 7 = TRUE -BOOL: 8 = TRUE -BOOL: 9 = TRUE -BOOL: / = TRUE -BOOL: $ = TRUE -BOOL: % = TRUE -BOOL: & = TRUE -BOOL: _ = TRUE -BOOL: + = TRUE -BOOL: | = TRUE -BOOL: ? = TRUE +BOOL A = TRUE +BOOL B = TRUE +BOOL C = TRUE +BOOL D = TRUE +BOOL E = TRUE +BOOL F = TRUE +BOOL G = TRUE +BOOL H = TRUE +BOOL I = TRUE +BOOL J = TRUE +BOOL K = TRUE +BOOL L = TRUE +BOOL M = TRUE +BOOL N = TRUE +BOOL O = TRUE +BOOL P = TRUE +BOOL Q = TRUE +BOOL R = TRUE +BOOL S = TRUE +BOOL T = TRUE +BOOL U = TRUE +BOOL V = TRUE +BOOL W = TRUE +BOOL X = TRUE +BOOL Y = TRUE +BOOL Z = TRUE +BOOL a = TRUE +BOOL b = TRUE +BOOL c = TRUE +BOOL d = TRUE +BOOL e = TRUE +BOOL f = TRUE +BOOL g = TRUE +BOOL h = TRUE +BOOL i = TRUE +BOOL j = TRUE +BOOL k = TRUE +BOOL l = TRUE +BOOL m = TRUE +BOOL n = TRUE +BOOL o = TRUE +BOOL p = TRUE +BOOL q = TRUE +BOOL r = TRUE +BOOL s = TRUE +BOOL t = TRUE +BOOL u = TRUE +BOOL v = TRUE +BOOL w = TRUE +BOOL x = TRUE +BOOL y = TRUE +BOOL z = TRUE +BOOL 2 = TRUE +BOOL 3 = TRUE +BOOL 4 = TRUE +BOOL 5 = TRUE +BOOL 6 = TRUE +BOOL 7 = TRUE +BOOL 8 = TRUE +BOOL 9 = TRUE +BOOL / = TRUE +BOOL $ = TRUE +BOOL % = TRUE +BOOL & = TRUE +BOOL _ = TRUE +BOOL + = TRUE +BOOL | = TRUE +BOOL ? = TRUE diff --git a/tests/cases/passing/idiv-pointer-writeback.pre b/tests/cases/passing/idiv-pointer-writeback.pre index 7e905b0..532e534 100644 --- a/tests/cases/passing/idiv-pointer-writeback.pre +++ b/tests/cases/passing/idiv-pointer-writeback.pre @@ -1,4 +1,4 @@ -INT: a1 = 0d20 -INT: b1 = 0d4 +INT a1 = 0d20 +INT b1 = 0d4 IDIV(@a1, b1) ASSERT(EQ(a1, 0d5)) diff --git a/tests/cases/passing/idiv.pre b/tests/cases/passing/idiv.pre index 7e284ac..a4e3dc3 100644 --- a/tests/cases/passing/idiv.pre +++ b/tests/cases/passing/idiv.pre @@ -1,3 +1,3 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_div = IDIV(0d20, 0d4) +INT result_div = IDIV(0d20, 0d4) ASSERT(EQ(result_div, 0d5)) diff --git a/tests/cases/passing/import-cached-alias.ps1 b/tests/cases/passing/import-cached-alias.ps1 index 5ed918f..e565825 100644 --- a/tests/cases/passing/import-cached-alias.ps1 +++ b/tests/cases/passing/import-cached-alias.ps1 @@ -11,7 +11,7 @@ try { $modulePath = Join-Path $tempDir "$moduleName.pre" Set-Content -Path $modulePath -Encoding Ascii -Value @" -STR: marker = "$markerLiteral" +STR marker = "$markerLiteral" IF(EXISTFILE(marker)){ WRITEFILE("reloaded", marker) @@ -19,7 +19,7 @@ IF(EXISTFILE(marker)){ WRITEFILE("loaded", marker) } -FUNC STR: marker_text(){ +FUNC STR marker_text(){ RETURN(READFILE(marker)) } "@ diff --git a/tests/cases/passing/import-isolated-top-level.ps1 b/tests/cases/passing/import-isolated-top-level.ps1 index 203f94a..cf08082 100644 --- a/tests/cases/passing/import-isolated-top-level.ps1 +++ b/tests/cases/passing/import-isolated-top-level.ps1 @@ -9,15 +9,15 @@ try { $modulePath = Join-Path $tempDir "$moduleName.pre" Set-Content -Path $modulePath -Encoding Ascii -Value @' -INT: shared = 0d7 +INT shared = 0d7 -FUNC INT: read_shared(){ +FUNC INT read_shared(){ RETURN(shared) } '@ Set-Content -Path $programPath -Encoding Ascii -Value @" -INT: shared = 0d11 +INT shared = 0d11 IMPORT($moduleName, helper) diff --git a/tests/cases/passing/import-local-before-stdlib.ps1 b/tests/cases/passing/import-local-before-stdlib.ps1 index 3ff7d0b..b0b48f8 100644 --- a/tests/cases/passing/import-local-before-stdlib.ps1 +++ b/tests/cases/passing/import-local-before-stdlib.ps1 @@ -11,13 +11,13 @@ try { $localModulePath = Join-Path $tempDir "$moduleName.pre" Set-Content -Path $localModulePath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("local") } '@ Set-Content -Path $stdlibPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("stdlib") } '@ diff --git a/tests/cases/passing/import-no-companion-prex.ps1 b/tests/cases/passing/import-no-companion-prex.ps1 index e8ea87e..87e03b0 100644 --- a/tests/cases/passing/import-no-companion-prex.ps1 +++ b/tests/cases/passing/import-no-companion-prex.ps1 @@ -10,7 +10,7 @@ try { $pointerPath = Join-Path $tempDir "$moduleName.prex" Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("source") } '@ diff --git a/tests/cases/passing/import-package-init.ps1 b/tests/cases/passing/import-package-init.ps1 index 78206c3..197e640 100644 --- a/tests/cases/passing/import-package-init.ps1 +++ b/tests/cases/passing/import-package-init.ps1 @@ -12,7 +12,7 @@ try { New-Item -ItemType Directory -Path $packageDir | Out-Null Set-Content -Path $initPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("package") } '@ diff --git a/tests/cases/passing/import-package-missing-init-errors.ps1 b/tests/cases/passing/import-package-missing-init-errors.ps1 index 5bf8709..e74183e 100644 --- a/tests/cases/passing/import-package-missing-init-errors.ps1 +++ b/tests/cases/passing/import-package-missing-init-errors.ps1 @@ -12,7 +12,7 @@ try { New-Item -ItemType Directory -Path $packageDir | Out-Null Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("module") } '@ diff --git a/tests/cases/passing/import-package-precedence.ps1 b/tests/cases/passing/import-package-precedence.ps1 index 102f192..c643985 100644 --- a/tests/cases/passing/import-package-precedence.ps1 +++ b/tests/cases/passing/import-package-precedence.ps1 @@ -13,13 +13,13 @@ try { New-Item -ItemType Directory -Path $packageDir | Out-Null Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("module") } '@ Set-Content -Path $initPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("package") } '@ diff --git a/tests/cases/passing/import-qualified-only.ps1 b/tests/cases/passing/import-qualified-only.ps1 index f833979..1f20262 100644 --- a/tests/cases/passing/import-qualified-only.ps1 +++ b/tests/cases/passing/import-qualified-only.ps1 @@ -9,7 +9,7 @@ try { $modulePath = Join-Path $tempDir "$moduleName.pre" Set-Content -Path $modulePath -Encoding Ascii -Value @' -INT: hidden = 0d7 +INT hidden = 0d7 '@ Set-Content -Path $programPath -Encoding Ascii -Value @" diff --git a/tests/cases/passing/import-stdlib-before-userlib.ps1 b/tests/cases/passing/import-stdlib-before-userlib.ps1 index bb0dbef..64c1a1e 100644 --- a/tests/cases/passing/import-stdlib-before-userlib.ps1 +++ b/tests/cases/passing/import-stdlib-before-userlib.ps1 @@ -11,13 +11,13 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $stdlibPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("stdlib") } '@ Set-Content -Path $userlibPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("userlib") } '@ diff --git a/tests/cases/passing/import_path-alias-qualified-namespace.pre b/tests/cases/passing/import_path-alias-qualified-namespace.pre index 1b8d17c..c0d91e3 100644 --- a/tests/cases/passing/import_path-alias-qualified-namespace.pre +++ b/tests/cases/passing/import_path-alias-qualified-namespace.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") REFUTE(IMPORT_PATH(helper_path, helper)) ASSERT(EQ(helper.identify(), "basic")) \ No newline at end of file diff --git a/tests/cases/passing/import_path-cached-alias.pre b/tests/cases/passing/import_path-cached-alias.pre index 8a35f2f..f5302d6 100644 --- a/tests/cases/passing/import_path-cached-alias.pre +++ b/tests/cases/passing/import_path-cached-alias.pre @@ -1,8 +1,8 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_cache_target.pre") -STR: marker_path = path.TEMPFILE("prefix-import-path-cache-target.txt") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_cache_target.pre") +STR marker_path = path.TEMPFILE("prefix-import-path-cache-target.txt") IF(EXISTFILE(marker_path)){ ASSERT(DELETEFILE(marker_path)) @@ -11,8 +11,8 @@ IF(EXISTFILE(marker_path)){ REFUTE(IMPORT_PATH(helper_path)) REFUTE(IMPORT_PATH(helper_path, again)) -STR: default_view = import_path_cache_target.marker_text() -STR: alias_view = again.marker_text() +STR default_view = import_path_cache_target.marker_text() +STR alias_view = again.marker_text() ASSERT(DELETEFILE(marker_path)) ASSERT(EQ(default_view, "loaded")) diff --git a/tests/cases/passing/import_path-default-basename.pre b/tests/cases/passing/import_path-default-basename.pre index 86055a2..e34c023 100644 --- a/tests/cases/passing/import_path-default-basename.pre +++ b/tests/cases/passing/import_path-default-basename.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") REFUTE(IMPORT_PATH(helper_path)) ASSERT(EQ(import_path_basic_target.identify(), "basic")) \ No newline at end of file diff --git a/tests/cases/passing/import_path-equivalent-path-cache.ps1 b/tests/cases/passing/import_path-equivalent-path-cache.ps1 index 8cbe4bc..21873be 100644 --- a/tests/cases/passing/import_path-equivalent-path-cache.ps1 +++ b/tests/cases/passing/import_path-equivalent-path-cache.ps1 @@ -15,7 +15,7 @@ try { $extensionlessLiteral = $extensionlessPath.Replace('\', '\\') Set-Content -Path $modulePath -Encoding Ascii -Value @" -STR: marker = "$markerLiteral" +STR marker = "$markerLiteral" IF(EXISTFILE(marker)){ WRITEFILE("reloaded", marker) @@ -23,7 +23,7 @@ IF(EXISTFILE(marker)){ WRITEFILE("loaded", marker) } -FUNC STR: marker_text(){ +FUNC STR marker_text(){ RETURN(READFILE(marker)) } "@ diff --git a/tests/cases/passing/import_path-isolated-top-level.pre b/tests/cases/passing/import_path-isolated-top-level.pre index 09ecada..d864671 100644 --- a/tests/cases/passing/import_path-isolated-top-level.pre +++ b/tests/cases/passing/import_path-isolated-top-level.pre @@ -1,9 +1,9 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_isolated_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_isolated_target.pre") -INT: shared = 0d11 +INT shared = 0d11 REFUTE(IMPORT_PATH(helper_path, helper)) ASSERT(EQ(helper.read_shared(), 0d7)) diff --git a/tests/cases/passing/import_path-no-companion-prex.pre b/tests/cases/passing/import_path-no-companion-prex.pre index a788c6c..8be6bb4 100644 --- a/tests/cases/passing/import_path-no-companion-prex.pre +++ b/tests/cases/passing/import_path-no-companion-prex.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_prex_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_prex_target.pre") REFUTE(IMPORT_PATH(helper_path)) ASSERT(EQ(import_path_prex_target.identify(), "source")) \ No newline at end of file diff --git a/tests/cases/passing/import_path-package-init.ps1 b/tests/cases/passing/import_path-package-init.ps1 index 78af43e..003c7eb 100644 --- a/tests/cases/passing/import_path-package-init.ps1 +++ b/tests/cases/passing/import_path-package-init.ps1 @@ -12,7 +12,7 @@ try { New-Item -ItemType Directory -Path $packageDir | Out-Null Set-Content -Path $initPath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("package") } '@ diff --git a/tests/cases/passing/import_path-package-missing-init-errors.ps1 b/tests/cases/passing/import_path-package-missing-init-errors.ps1 index 4195263..125db58 100644 --- a/tests/cases/passing/import_path-package-missing-init-errors.ps1 +++ b/tests/cases/passing/import_path-package-missing-init-errors.ps1 @@ -12,7 +12,7 @@ try { New-Item -ItemType Directory -Path $packageDir | Out-Null Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("module") } '@ diff --git a/tests/cases/passing/import_path-return-false.pre b/tests/cases/passing/import_path-return-false.pre index e4da408..f4964dc 100644 --- a/tests/cases/passing/import_path-return-false.pre +++ b/tests/cases/passing/import_path-return-false.pre @@ -1,7 +1,7 @@ IMPORT(path) -STR: tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) -STR: helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") +STR tests_dir = path.BASEPATH(path.BASEPATH(path.script_dir)) +STR helper_path = JOIN(tests_dir, "/helpers/import_path_basic_target.pre") ASSERT(EQ(TYPE(IMPORT_PATH(helper_path)), "BOOL")) ASSERT(NOT(IMPORT_PATH(helper_path))) \ No newline at end of file diff --git a/tests/cases/passing/imul-pointer-writeback.pre b/tests/cases/passing/imul-pointer-writeback.pre index 082fa22..3f62082 100644 --- a/tests/cases/passing/imul-pointer-writeback.pre +++ b/tests/cases/passing/imul-pointer-writeback.pre @@ -1,15 +1,15 @@ -INT: a1 = 0d4 -INT: b1 = 0d3 +INT a1 = 0d4 +INT b1 = 0d3 IMUL(@a1, b1) ASSERT(EQ(a1, 0d12)) -INT: a2 = 0d4 -INT: b2 = 0d3 +INT a2 = 0d4 +INT b2 = 0d3 IMUL(a2, @b2) ASSERT(EQ(b2, 0d12)) -INT: a3 = 0d4 -INT: b3 = 0d3 +INT a3 = 0d4 +INT b3 = 0d3 IMUL(@a3, @b3) ASSERT(EQ(a3, 0d12)) ASSERT(EQ(b3, 0d12)) diff --git a/tests/cases/passing/imul.pre b/tests/cases/passing/imul.pre index a6ce527..e66bffa 100644 --- a/tests/cases/passing/imul.pre +++ b/tests/cases/passing/imul.pre @@ -1,3 +1,3 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_mul = IMUL(0d4, 0d5) +INT result_mul = IMUL(0d4, 0d5) ASSERT(EQ(result_mul, 0d20)) diff --git a/tests/cases/passing/in-rank2.pre b/tests/cases/passing/in-rank2.pre index 6acec65..58da5af 100644 --- a/tests/cases/passing/in-rank2.pre +++ b/tests/cases/passing/in-rank2.pre @@ -1,4 +1,4 @@ -TNS: grid = [[0d1, 0d2], [0d3, 0d4]] +TNS grid = [[0d1, 0d2], [0d3, 0d4]] ASSERT(IN(0d4, grid)) REFUTE(IN(0d9, grid)) diff --git a/tests/cases/passing/input-empty-line.ps1 b/tests/cases/passing/input-empty-line.ps1 index b09cf91..0cd48e2 100644 --- a/tests/cases/passing/input-empty-line.ps1 +++ b/tests/cases/passing/input-empty-line.ps1 @@ -7,7 +7,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $programPath -Encoding Ascii -Value @' -STR: line = INPUT() +STR line = INPUT() ASSERT(ISSTR(line)) ASSERT(EQ(line, "")) '@ diff --git a/tests/cases/passing/input-prompt-output.ps1 b/tests/cases/passing/input-prompt-output.ps1 index 732f397..4222cb1 100644 --- a/tests/cases/passing/input-prompt-output.ps1 +++ b/tests/cases/passing/input-prompt-output.ps1 @@ -7,7 +7,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $programPath -Encoding Ascii -Value @' -STR: line = INPUT("PROMPT>") +STR line = INPUT("PROMPT>") ASSERT(EQ(line, "alpha")) PRINT("DONE=", line) '@ diff --git a/tests/cases/passing/input-return-type.ps1 b/tests/cases/passing/input-return-type.ps1 index 5a1f3a1..bc92337 100644 --- a/tests/cases/passing/input-return-type.ps1 +++ b/tests/cases/passing/input-return-type.ps1 @@ -7,7 +7,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $programPath -Encoding Ascii -Value @' -STR: line = INPUT() +STR line = INPUT() ASSERT(ISSTR(line)) ASSERT(EQ(line, "Alpha beta 42")) '@ diff --git a/tests/cases/passing/int-literals-extended.pre b/tests/cases/passing/int-literals-extended.pre index c3e6051..635743f 100644 --- a/tests/cases/passing/int-literals-extended.pre +++ b/tests/cases/passing/int-literals-extended.pre @@ -1,10 +1,10 @@ -INT: a = 0d123 -INT: b = -0d42 -INT: c = 0x1A3 -INT: d = 0b1010 -INT: e = 0o755 -INT: g = 0r16FF -INT: h = -0r16FF +INT a = 0d123 +INT b = -0d42 +INT c = 0x1A3 +INT d = 0b1010 +INT e = 0o755 +INT g = 0r16FF +INT h = -0r16FF ASSERT(EQ(a, 0d123)) ASSERT(EQ(b, -0d42)) diff --git a/tests/cases/passing/int.pre b/tests/cases/passing/int.pre index d9b0792..7b41630 100644 --- a/tests/cases/passing/int.pre +++ b/tests/cases/passing/int.pre @@ -1,8 +1,8 @@ -INT: b = 0b1 -INT: o = 0o7 -INT: d = 0d9 -INT: h = 0xF -INT: t = 0tV -INT: c = 0cz -INT: s = 0s_ -INT: r = 0r15E +INT b = 0b1 +INT o = 0o7 +INT d = 0d9 +INT h = 0xF +INT t = 0tV +INT c = 0cz +INT s = 0s_ +INT r = 0r15E diff --git a/tests/cases/passing/inv-pointer-writeback.pre b/tests/cases/passing/inv-pointer-writeback.pre index 78b3594..9e6ab4c 100644 --- a/tests/cases/passing/inv-pointer-writeback.pre +++ b/tests/cases/passing/inv-pointer-writeback.pre @@ -1,4 +1,4 @@ -MAP: src = <"left" = "x", "right" = "y"> +MAP src = <"left" = "x", "right" = "y"> INV(@src) diff --git a/tests/cases/passing/inv-return-type.pre b/tests/cases/passing/inv-return-type.pre index 568330b..b2d4098 100644 --- a/tests/cases/passing/inv-return-type.pre +++ b/tests/cases/passing/inv-return-type.pre @@ -1,3 +1,3 @@ ASSERT(EQ(TYPE(INV(<"one" = 0d1>)), "MAP")) -MAP: m = <"a" = "x"> +MAP m = <"a" = "x"> ASSERT(EQ(TYPE(INV(m)), "MAP")) diff --git a/tests/cases/passing/inv-source-unchanged.pre b/tests/cases/passing/inv-source-unchanged.pre index ba2ae8c..d82ed31 100644 --- a/tests/cases/passing/inv-source-unchanged.pre +++ b/tests/cases/passing/inv-source-unchanged.pre @@ -1,4 +1,4 @@ -MAP: src = <"left" = "x", "right" = "y"> +MAP src = <"left" = "x", "right" = "y"> INV(src) diff --git a/tests/cases/passing/ipow.pre b/tests/cases/passing/ipow.pre index 1fe6999..d2e632e 100644 --- a/tests/cases/passing/ipow.pre +++ b/tests/cases/passing/ipow.pre @@ -1,3 +1,3 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_pow = IPOW(0d2, 0d3) +INT result_pow = IPOW(0d2, 0d3) ASSERT(EQ(result_pow, 0d8)) diff --git a/tests/cases/passing/iprod.pre b/tests/cases/passing/iprod.pre index 6516071..fa57f2d 100644 --- a/tests/cases/passing/iprod.pre +++ b/tests/cases/passing/iprod.pre @@ -1,3 +1,3 @@ ! IPROD coerces inputs to INT before multiplying -INT: result = IPROD(0d2.9, 0d3.1) +INT result = IPROD(0d2.9, 0d3.1) ASSERT(EQ(result, 0d6)) diff --git a/tests/cases/passing/iroot.pre b/tests/cases/passing/iroot.pre index 7bd1769..de481bc 100644 --- a/tests/cases/passing/iroot.pre +++ b/tests/cases/passing/iroot.pre @@ -1,3 +1,3 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_root = IROOT(0d16, 0d2) +INT result_root = IROOT(0d16, 0d2) ASSERT(EQ(result_root, 0d4)) diff --git a/tests/cases/passing/isbool.pre b/tests/cases/passing/isbool.pre index e551ec6..22eb2a4 100644 --- a/tests/cases/passing/isbool.pre +++ b/tests/cases/passing/isbool.pre @@ -1,12 +1,12 @@ -BOOL: sample_bool_true = TRUE -BOOL: sample_bool_false = FALSE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +BOOL sample_bool_false = FALSE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isflt.pre b/tests/cases/passing/isflt.pre index 2b2344a..053a61c 100644 --- a/tests/cases/passing/isflt.pre +++ b/tests/cases/passing/isflt.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool_true = TRUE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isfunc.pre b/tests/cases/passing/isfunc.pre index 439b688..cc933e5 100644 --- a/tests/cases/passing/isfunc.pre +++ b/tests/cases/passing/isfunc.pre @@ -1,12 +1,12 @@ -BOOL: sample_bool_true = TRUE -BOOL: sample_bool_false = FALSE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +BOOL sample_bool_false = FALSE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isint.pre b/tests/cases/passing/isint.pre index fdef395..14f9216 100644 --- a/tests/cases/passing/isint.pre +++ b/tests/cases/passing/isint.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool_true = TRUE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/ismap.pre b/tests/cases/passing/ismap.pre index 54aa03a..2d9d702 100644 --- a/tests/cases/passing/ismap.pre +++ b/tests/cases/passing/ismap.pre @@ -1,12 +1,12 @@ -BOOL: sample_bool_true = TRUE -BOOL: sample_bool_false = FALSE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +BOOL sample_bool_false = FALSE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isstr.pre b/tests/cases/passing/isstr.pre index f9a7769..334e141 100644 --- a/tests/cases/passing/isstr.pre +++ b/tests/cases/passing/isstr.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool_true = TRUE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isthr.pre b/tests/cases/passing/isthr.pre index d13cba9..b7b6584 100644 --- a/tests/cases/passing/isthr.pre +++ b/tests/cases/passing/isthr.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool_true = TRUE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/istns.pre b/tests/cases/passing/istns.pre index 2081fb2..cbd3895 100644 --- a/tests/cases/passing/istns.pre +++ b/tests/cases/passing/istns.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool_true = TRUE -INT: sample_int = -0d7 -FLT: sample_flt = 0d3.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool_true = TRUE +INT sample_int = -0d7 +FLT sample_flt = 0d3.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(INT: value){ +FUNC INT sample_func(INT value){ RETURN(value) } diff --git a/tests/cases/passing/isub-int.pre b/tests/cases/passing/isub-int.pre index 3eb5750..f94233d 100644 --- a/tests/cases/passing/isub-int.pre +++ b/tests/cases/passing/isub-int.pre @@ -1,3 +1,3 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_sub = ISUB(0d10, 0d2.0) +INT result_sub = ISUB(0d10, 0d2.0) ASSERT(EQ(result_sub, 0d8)) diff --git a/tests/cases/passing/isub-pointer-writeback.pre b/tests/cases/passing/isub-pointer-writeback.pre index 1df44df..4dbbbb7 100644 --- a/tests/cases/passing/isub-pointer-writeback.pre +++ b/tests/cases/passing/isub-pointer-writeback.pre @@ -1,4 +1,4 @@ -INT: a1 = 0d10 -INT: b1 = 0d5 +INT a1 = 0d10 +INT b1 = 0d5 ISUB(@a1, b1) ASSERT(EQ(a1, 0d5)) diff --git a/tests/cases/passing/isum-trunc.pre b/tests/cases/passing/isum-trunc.pre index 2dc9993..9f8bd64 100644 --- a/tests/cases/passing/isum-trunc.pre +++ b/tests/cases/passing/isum-trunc.pre @@ -1,3 +1,3 @@ ! ISUM truncates floating-point inputs toward zero -INT: result = ISUM(0d1.9, 0d2.1, -0d0.9) +INT result = ISUM(0d1.9, 0d2.1, -0d0.9) ASSERT(EQ(result, 0d3)) diff --git a/tests/cases/passing/join-pointer-writeback.pre b/tests/cases/passing/join-pointer-writeback.pre index 58ab76c..a0096e0 100644 --- a/tests/cases/passing/join-pointer-writeback.pre +++ b/tests/cases/passing/join-pointer-writeback.pre @@ -1,36 +1,36 @@ -STR: s1 = "foo" -STR: s2 = "bar" +STR s1 = "foo" +STR s2 = "bar" JOIN(@s1, s2) ASSERT(EQ(s1, "foobar")) ASSERT(EQ(s2, "bar")) -STR: s1 = "foo" -STR: s2 = "bar" +STR s1 = "foo" +STR s2 = "bar" JOIN(s1, @s2) ASSERT(EQ(s1, "foo")) ASSERT(EQ(s2, "foobar")) -STR: s1 = "foo" -STR: s2 = "bar" +STR s1 = "foo" +STR s2 = "bar" JOIN(@s1, @s2) ASSERT(EQ(s1, "foobar")) ASSERT(EQ(s2, "foobar")) ! integer join mode (joins integer binary spellings) -INT: i1 = 0b1010 -INT: i2 = 0b101 +INT i1 = 0b1010 +INT i2 = 0b101 JOIN(@i1, i2) ASSERT(EQ(i1, 0b1010101)) ASSERT(EQ(i2, 0b101)) -INT: i1 = 0b1010 -INT: i2 = 0b101 +INT i1 = 0b1010 +INT i2 = 0b101 JOIN(i1, @i2) ASSERT(EQ(i1, 0b1010)) ASSERT(EQ(i2, 0b1010101)) -INT: i1 = 0b1010 -INT: i2 = 0b101 +INT i1 = 0b1010 +INT i2 = 0b101 JOIN(@i1, @i2) ASSERT(EQ(i1, 0b1010101)) ASSERT(EQ(i2, 0b1010101)) diff --git a/tests/cases/passing/keyin-basic.pre b/tests/cases/passing/keyin-basic.pre index a4135f5..a82a0a0 100644 --- a/tests/cases/passing/keyin-basic.pre +++ b/tests/cases/passing/keyin-basic.pre @@ -1,4 +1,4 @@ -MAP: m = <"a" = 0d1, "b" = 0d2> +MAP m = <"a" = 0d1, "b" = 0d2> ASSERT(KEYIN("a", m)) ASSERT(NOT(KEYIN("missing", m))) diff --git a/tests/cases/passing/keyin-key-types.pre b/tests/cases/passing/keyin-key-types.pre index 6cae637..c2b9e14 100644 --- a/tests/cases/passing/keyin-key-types.pre +++ b/tests/cases/passing/keyin-key-types.pre @@ -1,4 +1,4 @@ -MAP: m = <0d1 = "int", 0d2.5 = "flt", "three" = "str"> +MAP m = <0d1 = "int", 0d2.5 = "flt", "three" = "str"> ASSERT(KEYIN(0d1, m)) ASSERT(KEYIN(0d2.5, m)) diff --git a/tests/cases/passing/keys-insertion-order.pre b/tests/cases/passing/keys-insertion-order.pre index 255b9ff..334472e 100644 --- a/tests/cases/passing/keys-insertion-order.pre +++ b/tests/cases/passing/keys-insertion-order.pre @@ -1,3 +1,3 @@ -MAP: m = <"alpha" = 0d1, "beta" = 0d2, "gamma" = 0d3> +MAP m = <"alpha" = 0d1, "beta" = 0d2, "gamma" = 0d3> ASSERT(EQ(KEYS(m), ["alpha", "beta", "gamma"])) diff --git a/tests/cases/passing/keys-mixed-key-types.pre b/tests/cases/passing/keys-mixed-key-types.pre index 72af5e0..0702a0e 100644 --- a/tests/cases/passing/keys-mixed-key-types.pre +++ b/tests/cases/passing/keys-mixed-key-types.pre @@ -1,3 +1,3 @@ -MAP: m = <0d1 = "one", 0d2.5 = "two_point_five", "three" = "three"> +MAP m = <0d1 = "one", 0d2.5 = "two_point_five", "three" = "three"> ASSERT(EQ(KEYS(m), [0d1, 0d2.5, "three"])) diff --git a/tests/cases/passing/keys-result-is-1d.pre b/tests/cases/passing/keys-result-is-1d.pre index 0fc426a..4461d03 100644 --- a/tests/cases/passing/keys-result-is-1d.pre +++ b/tests/cases/passing/keys-result-is-1d.pre @@ -1,5 +1,5 @@ -MAP: m = <"x" = 0d1, "y" = 0d2> +MAP m = <"x" = 0d1, "y" = 0d2> -TNS: k = KEYS(m) +TNS k = KEYS(m) ASSERT(EQ(TYPE(k), "TNS")) ASSERT(EQ(SHAPE(k), [0d2])) diff --git a/tests/cases/passing/later-assign-no-type.pre b/tests/cases/passing/later-assign-no-type.pre index 0297b28..f6dd0f0 100644 --- a/tests/cases/passing/later-assign-no-type.pre +++ b/tests/cases/passing/later-assign-no-type.pre @@ -1,2 +1,2 @@ -ASSIGN(BOOL: x, TRUE) +ASSIGN(BOOL x, TRUE) ASSIGN(x, FALSE) diff --git a/tests/cases/passing/later-decl-no-type.pre b/tests/cases/passing/later-decl-no-type.pre index 2ce9b34..ac996f5 100644 --- a/tests/cases/passing/later-decl-no-type.pre +++ b/tests/cases/passing/later-decl-no-type.pre @@ -1,2 +1,2 @@ -BOOL: x = TRUE +BOOL x = TRUE x = FALSE diff --git a/tests/cases/passing/lcm-flt.pre b/tests/cases/passing/lcm-flt.pre index 72ea3e8..2f10623 100644 --- a/tests/cases/passing/lcm-flt.pre +++ b/tests/cases/passing/lcm-flt.pre @@ -1,8 +1,8 @@ -FLT: left_oct = 0o25.0 -FLT: right_hex = 0x6.0 -FLT: zero_bin = 0b0.0 -FLT: co_prime_left_oct = 0o10.0 -FLT: co_prime_right_dec = 0d9.0 +FLT left_oct = 0o25.0 +FLT right_hex = 0x6.0 +FLT zero_bin = 0b0.0 +FLT co_prime_left_oct = 0o10.0 +FLT co_prime_right_dec = 0d9.0 ASSERT(EQ(LCM(left_oct, right_hex), 0x2A.0)) ASSERT(EQ(LCM(right_hex, left_oct), 0x2A.0)) diff --git a/tests/cases/passing/lcm-int.pre b/tests/cases/passing/lcm-int.pre index ede8138..33f47f0 100644 --- a/tests/cases/passing/lcm-int.pre +++ b/tests/cases/passing/lcm-int.pre @@ -1,8 +1,8 @@ -INT: left_oct = 0o25 -INT: right_hex = 0x6 -INT: zero_bin = 0b0 -INT: co_prime_left_oct = 0o10 -INT: co_prime_right_dec = 0d9 +INT left_oct = 0o25 +INT right_hex = 0x6 +INT zero_bin = 0b0 +INT co_prime_left_oct = 0o10 +INT co_prime_right_dec = 0d9 ASSERT(EQ(LCM(left_oct, right_hex), 0x2A)) ASSERT(EQ(LCM(right_hex, left_oct), 0x2A)) diff --git a/tests/cases/passing/madd-basic.pre b/tests/cases/passing/madd-basic.pre index 3813fd6..2e16c05 100644 --- a/tests/cases/passing/madd-basic.pre +++ b/tests/cases/passing/madd-basic.pre @@ -1,4 +1,4 @@ -TNS: out = MADD([0d1, 0d2, 0d3], [0d4, 0d5, 0d6]) +TNS out = MADD([0d1, 0d2, 0d3], [0d4, 0d5, 0d6]) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d5, 0d7, 0d9])) diff --git a/tests/cases/passing/madd-rank2-shape.pre b/tests/cases/passing/madd-rank2-shape.pre index b778834..8cd1540 100644 --- a/tests/cases/passing/madd-rank2-shape.pre +++ b/tests/cases/passing/madd-rank2-shape.pre @@ -1,6 +1,6 @@ -TNS: a = [[0d1, 0d2], [0d3, 0d4]] -TNS: b = [[0d10, 0d20], [0d30, 0d40]] -TNS: out = MADD(a, b) +TNS a = [[0d1, 0d2], [0d3, 0d4]] +TNS b = [[0d10, 0d20], [0d30, 0d40]] +TNS out = MADD(a, b) ASSERT(EQ(out, [[0d11, 0d22], [0d33, 0d44]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/main-imported-function.ps1 b/tests/cases/passing/main-imported-function.ps1 index 3c77376..a567839 100644 --- a/tests/cases/passing/main-imported-function.ps1 +++ b/tests/cases/passing/main-imported-function.ps1 @@ -13,7 +13,7 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC BOOL: imported_main(){ +FUNC BOOL imported_main(){ RETURN(MAIN()) } '@ diff --git a/tests/cases/passing/main-imported-top-level.ps1 b/tests/cases/passing/main-imported-top-level.ps1 index 7b4456a..7dd37dd 100644 --- a/tests/cases/passing/main-imported-top-level.ps1 +++ b/tests/cases/passing/main-imported-top-level.ps1 @@ -13,9 +13,9 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $modulePath -Encoding Ascii -Value @' -BOOL: top_result = MAIN() +BOOL top_result = MAIN() -FUNC BOOL: read_top_result(){ +FUNC BOOL read_top_result(){ RETURN(top_result) } '@ diff --git a/tests/cases/passing/main-in-condition.pre b/tests/cases/passing/main-in-condition.pre index f24dd80..015e40e 100644 --- a/tests/cases/passing/main-in-condition.pre +++ b/tests/cases/passing/main-in-condition.pre @@ -1,4 +1,4 @@ -BOOL: branch_taken = FALSE +BOOL branch_taken = FALSE IF(MAIN()){ branch_taken = TRUE diff --git a/tests/cases/passing/main-primary-function.pre b/tests/cases/passing/main-primary-function.pre index 10de07c..8660202 100644 --- a/tests/cases/passing/main-primary-function.pre +++ b/tests/cases/passing/main-primary-function.pre @@ -1,4 +1,4 @@ -FUNC BOOL: from_primary_function(){ +FUNC BOOL from_primary_function(){ RETURN(MAIN()) } diff --git a/tests/cases/passing/main-source-location.ps1 b/tests/cases/passing/main-source-location.ps1 index e7be916..f3ed668 100644 --- a/tests/cases/passing/main-source-location.ps1 +++ b/tests/cases/passing/main-source-location.ps1 @@ -13,15 +13,15 @@ try { $programPath = Join-Path $tempDir 'program.pre' Set-Content -Path $modulePath -Encoding Ascii -Value @' -FUNC BOOL: imported_main(){ +FUNC BOOL imported_main(){ RETURN(MAIN()) } -FUNC BOOL: call_callback(FUNC: callback){ +FUNC BOOL call_callback(FUNC callback){ RETURN(callback()) } -FUNC BOOL: call_imported_main(){ +FUNC BOOL call_imported_main(){ RETURN(imported_main()) } '@ @@ -31,7 +31,7 @@ FUNC BOOL: call_imported_main(){ Set-Content -Path $programPath -Encoding Ascii -Value @" IMPORT_PATH("$moduleLiteral", helper) -FUNC BOOL: local_main(){ +FUNC BOOL local_main(){ RETURN(MAIN()) } diff --git a/tests/cases/passing/map-literals-empty-ordered.pre b/tests/cases/passing/map-literals-empty-ordered.pre index f12b01b..b95b006 100644 --- a/tests/cases/passing/map-literals-empty-ordered.pre +++ b/tests/cases/passing/map-literals-empty-ordered.pre @@ -1,10 +1,10 @@ -FUNC INT: GET_FIVE(){ +FUNC INT GET_FIVE(){ RETURN(0d5) } -MAP: empty = <> -MAP: ordered = <"alpha" = 0d1, "beta" = 0d2, "gamma" = 0d3> -MAP: duplicate = <"x" = 0d1, "y" = 0d2, "x" = 0d3> +MAP empty = <> +MAP ordered = <"alpha" = 0d1, "beta" = 0d2, "gamma" = 0d3> +MAP duplicate = <"x" = 0d1, "y" = 0d2, "x" = 0d3> ASSERT(EQ(empty, <>)) diff --git a/tests/cases/passing/map-literals-mixed-keys-nested.pre b/tests/cases/passing/map-literals-mixed-keys-nested.pre index 0211a54..5dc0eb0 100644 --- a/tests/cases/passing/map-literals-mixed-keys-nested.pre +++ b/tests/cases/passing/map-literals-mixed-keys-nested.pre @@ -1,5 +1,5 @@ -MAP: mixed_keys = <0d1 = "int", 0d2.5 = "flt", "three" = "str", ADD(0d2, 0d2) = "expr"> -MAP: nested = <"outer" = <"inner" = 0d9>, "empty_inner" = <>> +MAP mixed_keys = <0d1 = "int", 0d2.5 = "flt", "three" = "str", ADD(0d2, 0d2) = "expr"> +MAP nested = <"outer" = <"inner" = 0d9>, "empty_inner" = <>> ASSERT(EQ(mixed_keys<0d1>, "int")) ASSERT(EQ(mixed_keys<0d2.5>, "flt")) diff --git a/tests/cases/passing/map-literals-mixed-values.pre b/tests/cases/passing/map-literals-mixed-values.pre index d859235..bcf10b6 100644 --- a/tests/cases/passing/map-literals-mixed-values.pre +++ b/tests/cases/passing/map-literals-mixed-values.pre @@ -1,9 +1,9 @@ -FUNC INT: GET_FIVE(){ +FUNC INT GET_FIVE(){ RETURN(0d5) } THR(worker){} -MAP: mixed_values = <"bool" = TRUE, "int" = 0d2, "flt" = 0d3.5, "str" = "four", "tns" = [0d1, 0d2], "map" = <"n" = 0d5>, "func" = GET_FIVE, "thr" = worker> +MAP mixed_values = <"bool" = TRUE, "int" = 0d2, "flt" = 0d3.5, "str" = "four", "tns" = [0d1, 0d2], "map" = <"n" = 0d5>, "func" = GET_FIVE, "thr" = worker> ASSERT(EQ(mixed_values<"bool">, TRUE)) ASSERT(EQ(mixed_values<"int">, 0d2)) diff --git a/tests/cases/passing/map-literals-self.pre b/tests/cases/passing/map-literals-self.pre index 54eaeba..3b5f927 100644 --- a/tests/cases/passing/map-literals-self.pre +++ b/tests/cases/passing/map-literals-self.pre @@ -1,6 +1,6 @@ -MAP: self_alias = <"value" = 0d1, "self" = SELF> -MAP: self_lookup = <"value" = 0d7, "copy" = SELF<"value">, "nested" = <"n" = 0d9>, "copy_nested" = SELF<"nested", "n">> -MAP: inner_self = <"inner" = <"value" = 0d4, "self" = SELF, "copy" = SELF<"value">>> +MAP self_alias = <"value" = 0d1, "self" = SELF> +MAP self_lookup = <"value" = 0d7, "copy" = SELF<"value">, "nested" = <"n" = 0d9>, "copy_nested" = SELF<"nested", "n">> +MAP inner_self = <"inner" = <"value" = 0d4, "self" = SELF, "copy" = SELF<"value">>> ASSERT(EQ(self_alias<"self", "value">, 0d1)) self_alias<"value"> = 0d2 diff --git a/tests/cases/passing/match-basic.pre b/tests/cases/passing/match-basic.pre index dab988c..16dd35e 100644 --- a/tests/cases/passing/match-basic.pre +++ b/tests/cases/passing/match-basic.pre @@ -1,4 +1,4 @@ -MAP: candidate = <"alpha" = 0d1, "beta" = "dog"> +MAP candidate = <"alpha" = 0d1, "beta" = "dog"> ASSERT(MATCH(candidate, <>)) ASSERT(MATCH(candidate, <"alpha" = 0d99>)) diff --git a/tests/cases/passing/match-recurse.pre b/tests/cases/passing/match-recurse.pre index 04fa17d..4349e41 100644 --- a/tests/cases/passing/match-recurse.pre +++ b/tests/cases/passing/match-recurse.pre @@ -1,11 +1,11 @@ -MAP: missing_candidate = <"outer" = <"present" = 0d1>> -MAP: missing_template = <"outer" = <"missing" = 0d1>> +MAP missing_candidate = <"outer" = <"present" = 0d1>> +MAP missing_template = <"outer" = <"missing" = 0d1>> -MAP: type_candidate = <"outer" = <"value" = 0d1>> -MAP: type_template = <"outer" = <"value" = "x">> +MAP type_candidate = <"outer" = <"value" = 0d1>> +MAP type_template = <"outer" = <"value" = "x">> -MAP: shape_candidate = <"outer" = <"tensor" = [[0d1, 0d2], [0d3, 0d4]]>> -MAP: shape_template = <"outer" = <"tensor" = [0d9, 0d8, 0d7, 0d6]>> +MAP shape_candidate = <"outer" = <"tensor" = [[0d1, 0d2], [0d3, 0d4]]>> +MAP shape_template = <"outer" = <"tensor" = [0d9, 0d8, 0d7, 0d6]>> ASSERT(MATCH(missing_candidate, missing_template)) REFUTE(MATCH(missing_candidate, missing_template, recurse = 0d1)) diff --git a/tests/cases/passing/match-shape.pre b/tests/cases/passing/match-shape.pre index 32cd89b..909ccf8 100644 --- a/tests/cases/passing/match-shape.pre +++ b/tests/cases/passing/match-shape.pre @@ -1,4 +1,4 @@ -MAP: candidate = <"tensor" = [[0d1, 0d2], [0d3, 0d4]], "scalar" = 0d1> +MAP candidate = <"tensor" = [[0d1, 0d2], [0d3, 0d4]], "scalar" = 0d1> ASSERT(MATCH(candidate, <"tensor" = [0d9, 0d8, 0d7, 0d6]>)) ASSERT(MATCH(candidate, <"tensor" = [[0d9, 0d8], [0d7, 0d6]]>, shape = 0d1)) diff --git a/tests/cases/passing/match-typing.pre b/tests/cases/passing/match-typing.pre index 0bbef98..9063ec5 100644 --- a/tests/cases/passing/match-typing.pre +++ b/tests/cases/passing/match-typing.pre @@ -1,4 +1,4 @@ -MAP: candidate = <"value" = 0d1, "other" = "text"> +MAP candidate = <"value" = 0d1, "other" = "text"> ASSERT(MATCH(candidate, <"value" = "1">)) ASSERT(MATCH(candidate, <"value" = 0d99>, typing = 0d1)) diff --git a/tests/cases/passing/max-flt.pre b/tests/cases/passing/max-flt.pre index 746ebc2..fe8f077 100644 --- a/tests/cases/passing/max-flt.pre +++ b/tests/cases/passing/max-flt.pre @@ -1,3 +1,3 @@ ! MAX with multiple FLT arguments -FLT: result = MAX(0d1.5, -0d2.25, 0d3.0) +FLT result = MAX(0d1.5, -0d2.25, 0d3.0) ASSERT(EQ(result, 0d3.0)) diff --git a/tests/cases/passing/max-int.pre b/tests/cases/passing/max-int.pre index 6481f19..22c9e8d 100644 --- a/tests/cases/passing/max-int.pre +++ b/tests/cases/passing/max-int.pre @@ -1,3 +1,3 @@ ! MAX with multiple INT arguments -INT: result = MAX(0d1, -0d2, 0d3) +INT result = MAX(0d1, -0d2, 0d3) ASSERT(EQ(result, 0d3)) diff --git a/tests/cases/passing/max-str.pre b/tests/cases/passing/max-str.pre index e0302c9..6f9cebd 100644 --- a/tests/cases/passing/max-str.pre +++ b/tests/cases/passing/max-str.pre @@ -1,3 +1,3 @@ ! MAX returns the longest string -STR: result = MAX("a", "", "prefix", "bb") +STR result = MAX("a", "", "prefix", "bb") ASSERT(EQ(result, "prefix")) diff --git a/tests/cases/passing/max-tns.pre b/tests/cases/passing/max-tns.pre index 96bc2e9..544253f 100644 --- a/tests/cases/passing/max-tns.pre +++ b/tests/cases/passing/max-tns.pre @@ -1,5 +1,5 @@ ! MAX flattens tensors and returns the maximum scalar element -TNS: a = [[0d1, 0d2], [-0d3, 0d0]] -TNS: b = [0d0, 0d4] -INT: result = MAX(a, b) +TNS a = [[0d1, 0d2], [-0d3, 0d0]] +TNS b = [0d0, 0d4] +INT result = MAX(a, b) ASSERT(EQ(result, 0d4)) diff --git a/tests/cases/passing/mdiv-rank2.pre b/tests/cases/passing/mdiv-rank2.pre index aae6b50..1a812a8 100644 --- a/tests/cases/passing/mdiv-rank2.pre +++ b/tests/cases/passing/mdiv-rank2.pre @@ -1,4 +1,4 @@ -TNS: out = MDIV([[0d9, 0d8], [0d6, 0d4]], [[0d3, 0d2], [0d3, 0d2]]) +TNS out = MDIV([[0d9, 0d8], [0d6, 0d4]], [[0d3, 0d2], [0d3, 0d2]]) ASSERT(EQ(out, [[0d3, 0d4], [0d2, 0d2]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/min-flt.pre b/tests/cases/passing/min-flt.pre index 16e54d7..b67f062 100644 --- a/tests/cases/passing/min-flt.pre +++ b/tests/cases/passing/min-flt.pre @@ -1,3 +1,3 @@ ! MIN with multiple FLT arguments -FLT: result = MIN(0d1.5, -0d2.25, 0d3.0) +FLT result = MIN(0d1.5, -0d2.25, 0d3.0) ASSERT(EQ(result, -0d2.25)) diff --git a/tests/cases/passing/min-int.pre b/tests/cases/passing/min-int.pre index c3f88ee..30a8a04 100644 --- a/tests/cases/passing/min-int.pre +++ b/tests/cases/passing/min-int.pre @@ -1,3 +1,3 @@ ! MIN with multiple INT arguments -INT: result = MIN(0d1, -0d2, 0d3) +INT result = MIN(0d1, -0d2, 0d3) ASSERT(EQ(result, -0d2)) diff --git a/tests/cases/passing/min-str.pre b/tests/cases/passing/min-str.pre index acd0f78..2840ef5 100644 --- a/tests/cases/passing/min-str.pre +++ b/tests/cases/passing/min-str.pre @@ -1,3 +1,3 @@ ! MIN returns the shortest string -STR: result = MIN("a", "", "prefix", "bb") +STR result = MIN("a", "", "prefix", "bb") ASSERT(EQ(result, "")) diff --git a/tests/cases/passing/min-tns.pre b/tests/cases/passing/min-tns.pre index 8b028e6..ffe1132 100644 --- a/tests/cases/passing/min-tns.pre +++ b/tests/cases/passing/min-tns.pre @@ -1,4 +1,4 @@ ! MIN flattens tensors and returns the minimum scalar element (string length for STR) -TNS: a = [["aa", "b"], ["ccc", "dd"]] -STR: result = MIN(a) +TNS a = [["aa", "b"], ["ccc", "dd"]] +STR result = MIN(a) ASSERT(EQ(result, "b")) diff --git a/tests/cases/passing/mmul-rank2-shape.pre b/tests/cases/passing/mmul-rank2-shape.pre index dfd5eef..92f85dd 100644 --- a/tests/cases/passing/mmul-rank2-shape.pre +++ b/tests/cases/passing/mmul-rank2-shape.pre @@ -1,6 +1,6 @@ -TNS: a = [[0d1, 0d2], [0d3, 0d4]] -TNS: b = [[0d5, 0d6], [0d7, 0d8]] -TNS: out = MMUL(a, b) +TNS a = [[0d1, 0d2], [0d3, 0d4]] +TNS b = [[0d5, 0d6], [0d7, 0d8]] +TNS out = MMUL(a, b) ASSERT(EQ(out, [[0d5, 0d12], [0d21, 0d32]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/mod-flt.pre b/tests/cases/passing/mod-flt.pre index 92abdd9..f79504a 100644 --- a/tests/cases/passing/mod-flt.pre +++ b/tests/cases/passing/mod-flt.pre @@ -1,7 +1,7 @@ -FLT: left_oct = 0o7.0 -FLT: right_hex = 0x2.0 -FLT: wide_oct = 0o5.0 -FLT: right_hex_frac = 0x1.8 +FLT left_oct = 0o7.0 +FLT right_hex = 0x2.0 +FLT wide_oct = 0o5.0 +FLT right_hex_frac = 0x1.8 ASSERT(EQ(MOD(left_oct, right_hex), 0x1.0)) ASSERT(EQ(BASE(MOD(left_oct, right_hex)), 0d16)) diff --git a/tests/cases/passing/mod-int.pre b/tests/cases/passing/mod-int.pre index ad7447a..354ea4b 100644 --- a/tests/cases/passing/mod-int.pre +++ b/tests/cases/passing/mod-int.pre @@ -1,6 +1,6 @@ -INT: left_dec = 0d7 -INT: right_bin = 0b10 -INT: wide_hex = 0x10 +INT left_dec = 0d7 +INT right_bin = 0b10 +INT wide_hex = 0x10 ASSERT(EQ(MOD(left_dec, right_bin), 0d1)) ASSERT(EQ(BASE(MOD(left_dec, right_bin)), 0d10)) diff --git a/tests/cases/passing/mod-pointer-writeback.pre b/tests/cases/passing/mod-pointer-writeback.pre index 83badf8..2c82f71 100644 --- a/tests/cases/passing/mod-pointer-writeback.pre +++ b/tests/cases/passing/mod-pointer-writeback.pre @@ -1,31 +1,31 @@ -INT: a1 = 0d5 -INT: b1 = 0d2 +INT a1 = 0d5 +INT b1 = 0d2 MOD(@a1, b1) ASSERT(EQ(a1, 0d1)) -INT: a2 = 0d5 -INT: b2 = 0d2 +INT a2 = 0d5 +INT b2 = 0d2 MOD(a2, @b2) ASSERT(EQ(b2, 0d2)) -INT: a3 = 0d5 -INT: b3 = 0d2 +INT a3 = 0d5 +INT b3 = 0d2 MOD(@a3, @b3) ASSERT(EQ(a3, 0d1)) ASSERT(EQ(b3, 0d1)) -FLT: f1 = 0d5.5 -FLT: g1 = 0d2.0 +FLT f1 = 0d5.5 +FLT g1 = 0d2.0 MOD(@f1, g1) ASSERT(EQ(f1, 0d1.5)) -FLT: f2 = 0d5.5 -FLT: g2 = 0d2.0 +FLT f2 = 0d5.5 +FLT g2 = 0d2.0 MOD(f2, @g2) ASSERT(EQ(g2, 0d2.0)) -FLT: f3 = 0d5.5 -FLT: g3 = 0d2.0 +FLT f3 = 0d5.5 +FLT g3 = 0d2.0 MOD(@f3, @g3) ASSERT(EQ(f3, 0d1.5)) ASSERT(EQ(g3, 0d1.5)) diff --git a/tests/cases/passing/mprod-single.pre b/tests/cases/passing/mprod-single.pre index 1065cb7..51ef778 100644 --- a/tests/cases/passing/mprod-single.pre +++ b/tests/cases/passing/mprod-single.pre @@ -1,3 +1,3 @@ -TNS: x = [[0d2, 0d3], [0d4, 0d5]] +TNS x = [[0d2, 0d3], [0d4, 0d5]] ASSERT(EQ(MPROD(x), x)) diff --git a/tests/cases/passing/msub-basic.pre b/tests/cases/passing/msub-basic.pre index 7efc283..622893c 100644 --- a/tests/cases/passing/msub-basic.pre +++ b/tests/cases/passing/msub-basic.pre @@ -1,4 +1,4 @@ -TNS: out = MSUB([0d9, 0d7, 0d5], [0d4, 0d5, 0d6]) +TNS out = MSUB([0d9, 0d7, 0d5], [0d4, 0d5, 0d6]) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d5, 0d2, -0d1])) \ No newline at end of file diff --git a/tests/cases/passing/msub-rank2-shape.pre b/tests/cases/passing/msub-rank2-shape.pre index 72f2938..950738d 100644 --- a/tests/cases/passing/msub-rank2-shape.pre +++ b/tests/cases/passing/msub-rank2-shape.pre @@ -1,6 +1,6 @@ -TNS: a = [[0d9, 0d8], [0d7, 0d6]] -TNS: b = [[0d1, 0d2], [0d3, 0d4]] -TNS: out = MSUB(a, b) +TNS a = [[0d9, 0d8], [0d7, 0d6]] +TNS b = [[0d1, 0d2], [0d3, 0d4]] +TNS out = MSUB(a, b) ASSERT(EQ(out, [[0d8, 0d6], [0d4, 0d2]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) \ No newline at end of file diff --git a/tests/cases/passing/msum-single.pre b/tests/cases/passing/msum-single.pre index 1ea86d8..1349ba1 100644 --- a/tests/cases/passing/msum-single.pre +++ b/tests/cases/passing/msum-single.pre @@ -1,3 +1,3 @@ -TNS: x = [[0d1, 0d2], [0d3, 0d4]] +TNS x = [[0d1, 0d2], [0d3, 0d4]] ASSERT(EQ(MSUM(x), x)) diff --git a/tests/cases/passing/mul-flt.pre b/tests/cases/passing/mul-flt.pre index e3585c5..a1c7a4b 100644 --- a/tests/cases/passing/mul-flt.pre +++ b/tests/cases/passing/mul-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x0.8 -FLT: left_oct_one = 0o1.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x0.8 +FLT left_oct_one = 0o1.0 ASSERT(EQ(MUL(left_oct, right_hex), 0x0.C)) ASSERT(EQ(BASE(MUL(left_oct, right_hex)), 0d16)) diff --git a/tests/cases/passing/mul-int.pre b/tests/cases/passing/mul-int.pre index f189bbd..baadb39 100644 --- a/tests/cases/passing/mul-int.pre +++ b/tests/cases/passing/mul-int.pre @@ -1,6 +1,6 @@ -INT: left_dec = 0d2 -INT: right_bin = 0b11 -INT: wide_hex = 0x10 +INT left_dec = 0d2 +INT right_bin = 0b11 +INT wide_hex = 0x10 ASSERT(EQ(MUL(left_dec, right_bin), 0d6)) ASSERT(EQ(BASE(MUL(left_dec, right_bin)), 0d10)) diff --git a/tests/cases/passing/mul-pointer-writeback.pre b/tests/cases/passing/mul-pointer-writeback.pre index 94b686c..2dfd1cd 100644 --- a/tests/cases/passing/mul-pointer-writeback.pre +++ b/tests/cases/passing/mul-pointer-writeback.pre @@ -1,31 +1,31 @@ -INT: a1 = 0d2 -INT: b1 = 0d3 +INT a1 = 0d2 +INT b1 = 0d3 MUL(@a1, b1) ASSERT(EQ(a1, 0d6)) -INT: a2 = 0d2 -INT: b2 = 0d3 +INT a2 = 0d2 +INT b2 = 0d3 MUL(a2, @b2) ASSERT(EQ(b2, 0d6)) -INT: a3 = 0d2 -INT: b3 = 0d3 +INT a3 = 0d2 +INT b3 = 0d3 MUL(@a3, @b3) ASSERT(EQ(a3, 0d6)) ASSERT(EQ(b3, 0d6)) -FLT: f1 = 0d1.5 -FLT: g1 = 0d2.0 +FLT f1 = 0d1.5 +FLT g1 = 0d2.0 MUL(@f1, g1) ASSERT(EQ(f1, 0d3.0)) -FLT: f2 = 0d1.5 -FLT: g2 = 0d2.0 +FLT f2 = 0d1.5 +FLT g2 = 0d2.0 MUL(f2, @g2) ASSERT(EQ(g2, 0d3.0)) -FLT: f3 = 0d1.5 -FLT: g3 = 0d2.0 +FLT f3 = 0d1.5 +FLT g3 = 0d2.0 MUL(@f3, @g3) ASSERT(EQ(f3, 0d3.0)) ASSERT(EQ(g3, 0d3.0)) diff --git a/tests/cases/passing/multi-assign-type.pre b/tests/cases/passing/multi-assign-type.pre index 912b8d8..fae3543 100644 --- a/tests/cases/passing/multi-assign-type.pre +++ b/tests/cases/passing/multi-assign-type.pre @@ -1,2 +1,2 @@ -ASSIGN(BOOL: x, TRUE) -ASSIGN(BOOL: x, FALSE) +ASSIGN(BOOL x, TRUE) +ASSIGN(BOOL x, FALSE) diff --git a/tests/cases/passing/multi-decl-type.pre b/tests/cases/passing/multi-decl-type.pre index 8691f7f..0ac58d2 100644 --- a/tests/cases/passing/multi-decl-type.pre +++ b/tests/cases/passing/multi-decl-type.pre @@ -1,2 +1,2 @@ -BOOL: x = TRUE -BOOL: x = FALSE +BOOL x = TRUE +BOOL x = FALSE diff --git a/tests/cases/passing/neg-flt.pre b/tests/cases/passing/neg-flt.pre index e6c995e..fa9b66c 100644 --- a/tests/cases/passing/neg-flt.pre +++ b/tests/cases/passing/neg-flt.pre @@ -1,7 +1,7 @@ -FLT: pos_oct = 0o1.4 -FLT: neg_literal = -0o1.4 -FLT: hex_val = 0x1.8 -FLT: zero = 0o0.0 +FLT pos_oct = 0o1.4 +FLT neg_literal = -0o1.4 +FLT hex_val = 0x1.8 +FLT zero = 0o0.0 ASSERT(EQ(NEG(pos_oct), -0o1.4)) ASSERT(EQ(NEG(neg_literal), 0o1.4)) diff --git a/tests/cases/passing/neg-int.pre b/tests/cases/passing/neg-int.pre index 4903991..f234cad 100644 --- a/tests/cases/passing/neg-int.pre +++ b/tests/cases/passing/neg-int.pre @@ -1,8 +1,8 @@ -INT: pos_dec = 0d3 -INT: neg_literal = -0d3 -INT: hex_val = 0xA -INT: bin_val = 0b1010 -INT: zero = 0d0 +INT pos_dec = 0d3 +INT neg_literal = -0d3 +INT hex_val = 0xA +INT bin_val = 0b1010 +INT zero = 0d0 ASSERT(EQ(NEG(pos_dec), -0d3)) ASSERT(EQ(NEG(neg_literal), 0d3)) diff --git a/tests/cases/passing/neg-pointer-writeback.pre b/tests/cases/passing/neg-pointer-writeback.pre index c631ed5..eb771b4 100644 --- a/tests/cases/passing/neg-pointer-writeback.pre +++ b/tests/cases/passing/neg-pointer-writeback.pre @@ -1,7 +1,7 @@ -INT: in1 = 0d5 +INT in1 = 0d5 NEG(@in1) ASSERT(EQ(in1, -0d5)) -FLT: fin1 = 0d5.5 +FLT fin1 = 0d5.5 NEG(@fin1) ASSERT(EQ(fin1, -0d5.5)) diff --git a/tests/cases/passing/neq-structured.pre b/tests/cases/passing/neq-structured.pre index 355f11a..90016ac 100644 --- a/tests/cases/passing/neq-structured.pre +++ b/tests/cases/passing/neq-structured.pre @@ -1,13 +1,13 @@ -TNS: tensor = [[0d1, 0d2], [0d3, 0d4]] -TNS: different_tensor = [[0d1, 0d2], [0d3, 0d5]] +TNS tensor = [[0d1, 0d2], [0d3, 0d4]] +TNS different_tensor = [[0d1, 0d2], [0d3, 0d5]] -MAP: map_value = <"alpha" = 0d1, "beta" = [0d2, 0d3]> -MAP: different_map = <"alpha" = 0d1, "beta" = [0d2, 0d4]> +MAP map_value = <"alpha" = 0d1, "beta" = [0d2, 0d3]> +MAP different_map = <"alpha" = 0d1, "beta" = [0d2, 0d4]> -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } -FUNC: identity_alias = identity +FUNC identity_alias = identity THR(worker){} THR(other){} diff --git a/tests/cases/passing/op-arithmetic-coerce-flt-pass.pre b/tests/cases/passing/op-arithmetic-coerce-flt-pass.pre index ffb5c79..883678e 100644 --- a/tests/cases/passing/op-arithmetic-coerce-flt-pass.pre +++ b/tests/cases/passing/op-arithmetic-coerce-flt-pass.pre @@ -1,15 +1,15 @@ ! Passing float arithmetic, checking coercion and correct logic -FLT: result_add = FADD(0d10.5, 0d5.25) +FLT result_add = FADD(0d10.5, 0d5.25) ASSERT(EQ(result_add, 0d15.75)) -FLT: result_sub = FSUB(0d10.0, 0d2) +FLT result_sub = FSUB(0d10.0, 0d2) ASSERT(EQ(result_sub, 0d8.0)) -FLT: result_mul = FMUL(0d4.25, 0d2.0) +FLT result_mul = FMUL(0d4.25, 0d2.0) ASSERT(EQ(result_mul, 0d8.5)) -FLT: result_pow = FPOW(0d2.5, 0d2.0) +FLT result_pow = FPOW(0d2.5, 0d2.0) ASSERT(EQ(result_pow, 0d6.25)) -FLT: result_root_normal = FROOT(0d16.0, 0d2.0) +FLT result_root_normal = FROOT(0d16.0, 0d2.0) ASSERT(EQ(result_root_normal, 0d4.0)) \ No newline at end of file diff --git a/tests/cases/passing/op-arithmetic-coerce-int-pass.pre b/tests/cases/passing/op-arithmetic-coerce-int-pass.pre index 70756df..c9b4ce4 100644 --- a/tests/cases/passing/op-arithmetic-coerce-int-pass.pre +++ b/tests/cases/passing/op-arithmetic-coerce-int-pass.pre @@ -1,19 +1,19 @@ ! Passing integer arithmetic, checking coercion and correct logic -INT: result_add_1 = IADD(0d10, 0d5) -INT: result_add_2 = IADD(0d10.5, 0d5.2) ! Coerces to integers before/after? +INT result_add_1 = IADD(0d10, 0d5) +INT result_add_2 = IADD(0d10.5, 0d5.2) ! Coerces to integers before/after? ASSERT(EQ(result_add_1, 0d15)) -INT: result_sub = ISUB(0d10, 0d2.0) +INT result_sub = ISUB(0d10, 0d2.0) ASSERT(EQ(result_sub, 0d8)) -INT: result_mul = IMUL(0d4, 0d5) +INT result_mul = IMUL(0d4, 0d5) ASSERT(EQ(result_mul, 0d20)) -INT: result_div = IDIV(0d20, 0d4) +INT result_div = IDIV(0d20, 0d4) ASSERT(EQ(result_div, 0d5)) -INT: result_pow = IPOW(0d2, 0d3) +INT result_pow = IPOW(0d2, 0d3) ASSERT(EQ(result_pow, 0d8)) -INT: result_root = IROOT(0d16, 0d2) +INT result_root = IROOT(0d16, 0d2) ASSERT(EQ(result_root, 0d4)) diff --git a/tests/cases/passing/op-arithmetic-flt.pre b/tests/cases/passing/op-arithmetic-flt.pre index 2a92bea..1a77de9 100644 --- a/tests/cases/passing/op-arithmetic-flt.pre +++ b/tests/cases/passing/op-arithmetic-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x0.8 -FLT: left_oct_one = 0o1.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x0.8 +FLT left_oct_one = 0o1.0 ASSERT(EQ(ADD(left_oct_one, right_hex), 0x1.8)) ASSERT(EQ(BASE(ADD(left_oct_one, right_hex)), 0d16)) diff --git a/tests/cases/passing/op-arithmetic-int.pre b/tests/cases/passing/op-arithmetic-int.pre index 25680f8..5a2f850 100644 --- a/tests/cases/passing/op-arithmetic-int.pre +++ b/tests/cases/passing/op-arithmetic-int.pre @@ -1,6 +1,6 @@ -INT: left_dec = 0d2 -INT: right_bin = 0b11 -INT: wide_hex = 0x10 +INT left_dec = 0d2 +INT right_bin = 0b11 +INT wide_hex = 0x10 ASSERT(EQ(ADD(left_dec, right_bin), 0d5)) ASSERT(EQ(BASE(ADD(left_dec, right_bin)), 0d10)) diff --git a/tests/cases/passing/op-bool-from-func.pre b/tests/cases/passing/op-bool-from-func.pre index 710ecd5..59357a6 100644 --- a/tests/cases/passing/op-bool-from-func.pre +++ b/tests/cases/passing/op-bool-from-func.pre @@ -1,4 +1,4 @@ -FUNC BOOL: sample_func(){ +FUNC BOOL sample_func(){ RETURN(TRUE) } diff --git a/tests/cases/passing/op-bool-from-thr.pre b/tests/cases/passing/op-bool-from-thr.pre index a12e409..9e77e36 100644 --- a/tests/cases/passing/op-bool-from-thr.pre +++ b/tests/cases/passing/op-bool-from-thr.pre @@ -1,4 +1,4 @@ -BOOL: thr_release = FALSE +BOOL thr_release = FALSE THR(worker){ WHILE(NOT(thr_release)){ } diff --git a/tests/cases/passing/op-tns-from-shape-map.pre b/tests/cases/passing/op-tns-from-shape-map.pre index 19cc636..38b86d9 100644 --- a/tests/cases/passing/op-tns-from-shape-map.pre +++ b/tests/cases/passing/op-tns-from-shape-map.pre @@ -1,3 +1,3 @@ -MAP: fill_map = <"n" = 0d1> -TNS: filled_map = TNS([0d2], fill_map) +MAP fill_map = <"n" = 0d1> +TNS filled_map = TNS([0d2], fill_map) ASSERT(EQ(filled_map, [fill_map, fill_map])) diff --git a/tests/cases/passing/op-tns-from-shape-scalar.pre b/tests/cases/passing/op-tns-from-shape-scalar.pre index 258f161..f9a756b 100644 --- a/tests/cases/passing/op-tns-from-shape-scalar.pre +++ b/tests/cases/passing/op-tns-from-shape-scalar.pre @@ -1,2 +1,2 @@ -TNS: filled_scalar = TNS([0d2, 0d1], 0d7) +TNS filled_scalar = TNS([0d2, 0d1], 0d7) ASSERT(EQ(filled_scalar, [[0d7], [0d7]])) diff --git a/tests/cases/passing/op-tns-from-str.pre b/tests/cases/passing/op-tns-from-str.pre index 2fe35ac..cbcd57b 100644 --- a/tests/cases/passing/op-tns-from-str.pre +++ b/tests/cases/passing/op-tns-from-str.pre @@ -1,2 +1,2 @@ -TNS: from_string = TNS("abc") +TNS from_string = TNS("abc") ASSERT(EQ(from_string, ["a", "b", "c"])) \ No newline at end of file diff --git a/tests/cases/passing/parallel-tensor-func-values.pre b/tests/cases/passing/parallel-tensor-func-values.pre index ce36376..5f6cd70 100644 --- a/tests/cases/passing/parallel-tensor-func-values.pre +++ b/tests/cases/passing/parallel-tensor-func-values.pre @@ -1,16 +1,16 @@ -TNS: seen = [FALSE, FALSE] +TNS seen = [FALSE, FALSE] -FUNC: first = LAMBDA BOOL: (){ +FUNC first = LAMBDA BOOL: (){ FOR(i, 0d500){} seen[0d1] = TRUE } -FUNC: second = LAMBDA BOOL: (){ +FUNC second = LAMBDA BOOL: (){ FOR(i, 0d500){} seen[0d2] = TRUE } -TNS: workers = [first, second] +TNS workers = [first, second] ASSERT(EQ(PARALLEL(workers), FALSE)) ASSERT(EQ(seen, [TRUE, TRUE])) \ No newline at end of file diff --git a/tests/cases/passing/parallel-tensor-literal.pre b/tests/cases/passing/parallel-tensor-literal.pre index 5cd05e5..fccaeca 100644 --- a/tests/cases/passing/parallel-tensor-literal.pre +++ b/tests/cases/passing/parallel-tensor-literal.pre @@ -1,11 +1,11 @@ -TNS: seen = [FALSE, FALSE] +TNS seen = [FALSE, FALSE] -FUNC BOOL: first(){ +FUNC BOOL first(){ FOR(i, 0d500){} seen[0d1] = TRUE } -FUNC BOOL: second(){ +FUNC BOOL second(){ FOR(i, 0d500){} seen[0d2] = TRUE } diff --git a/tests/cases/passing/parallel-variadic.pre b/tests/cases/passing/parallel-variadic.pre index 629d00f..2cf74ca 100644 --- a/tests/cases/passing/parallel-variadic.pre +++ b/tests/cases/passing/parallel-variadic.pre @@ -1,18 +1,18 @@ -TNS: seen = [FALSE, FALSE, FALSE] +TNS seen = [FALSE, FALSE, FALSE] -FUNC BOOL: first(){ +FUNC BOOL first(){ FOR(i, 0d500){ } seen[0d1] = TRUE } -FUNC BOOL: second(){ +FUNC BOOL second(){ FOR(i, 0d500){ } seen[0d2] = TRUE } -FUNC BOOL: third(){ +FUNC BOOL third(){ FOR(i, 0d500){ } seen[0d3] = TRUE diff --git a/tests/cases/passing/parfor-break-nested.pre b/tests/cases/passing/parfor-break-nested.pre index 41fa4ae..46174ce 100644 --- a/tests/cases/passing/parfor-break-nested.pre +++ b/tests/cases/passing/parfor-break-nested.pre @@ -1,4 +1,4 @@ -INT: outer = 0d0 +INT outer = 0d0 FOR(j, 0d3){ ADD(@outer, 0d1) diff --git a/tests/cases/passing/parfor-break.pre b/tests/cases/passing/parfor-break.pre index 689b548..141b2fb 100644 --- a/tests/cases/passing/parfor-break.pre +++ b/tests/cases/passing/parfor-break.pre @@ -1,5 +1,5 @@ -INT: outer = 0d0 -INT: after = 0d0 +INT outer = 0d0 +INT after = 0d0 FOR(j, 0d3){ ADD(@outer, 0d1) diff --git a/tests/cases/passing/parfor-continue.pre b/tests/cases/passing/parfor-continue.pre index 8cd59d6..84c5736 100644 --- a/tests/cases/passing/parfor-continue.pre +++ b/tests/cases/passing/parfor-continue.pre @@ -1,4 +1,4 @@ -TNS: seen = [0d0, 0d0, 0d0, 0d0] +TNS seen = [0d0, 0d0, 0d0, 0d0] PARFOR(i, 0d4){ IF(EQ(i, 0d2)){ CONTINUE() diff --git a/tests/cases/passing/parfor-error-join.pre b/tests/cases/passing/parfor-error-join.pre index f818374..7374ca8 100644 --- a/tests/cases/passing/parfor-error-join.pre +++ b/tests/cases/passing/parfor-error-join.pre @@ -1,5 +1,5 @@ -TNS: seen = [0d0, 0d0, 0d0] -BOOL: caught = FALSE +TNS seen = [0d0, 0d0, 0d0] +BOOL caught = FALSE TRY{ PARFOR(i, 0d3){ diff --git a/tests/cases/passing/parfor-merge-symbol.pre b/tests/cases/passing/parfor-merge-symbol.pre index 51a00a8..ad563a8 100644 --- a/tests/cases/passing/parfor-merge-symbol.pre +++ b/tests/cases/passing/parfor-merge-symbol.pre @@ -1,6 +1,6 @@ PARFOR(i, 0d3){ IF(EQ(i, 0d2)){ - INT: merged = 0d7 + INT merged = 0d7 } } ASSERT(EXIST(merged)) diff --git a/tests/cases/passing/parfor-target-once.pre b/tests/cases/passing/parfor-target-once.pre index 965f431..1de96cb 100644 --- a/tests/cases/passing/parfor-target-once.pre +++ b/tests/cases/passing/parfor-target-once.pre @@ -1,11 +1,11 @@ -INT: target_calls = 0d0 +INT target_calls = 0d0 -FUNC INT: get_target(){ +FUNC INT get_target(){ ADD(@target_calls, 0d1) RETURN(0d3) } -TNS: seen = [0d0, 0d0, 0d0] +TNS seen = [0d0, 0d0, 0d0] PARFOR(i, get_target()){ seen[i] = i } diff --git a/tests/cases/passing/parfor-zero-and-restore-counter.pre b/tests/cases/passing/parfor-zero-and-restore-counter.pre index 414c998..ae61f9e 100644 --- a/tests/cases/passing/parfor-zero-and-restore-counter.pre +++ b/tests/cases/passing/parfor-zero-and-restore-counter.pre @@ -1,5 +1,5 @@ -BOOL: i = TRUE -INT: runs = 0d0 +BOOL i = TRUE +INT runs = 0d0 PARFOR(i, 0d5){ ADD(@runs, 0d1) } diff --git a/tests/cases/passing/parfor.pre b/tests/cases/passing/parfor.pre index 5b063e0..c22b673 100644 --- a/tests/cases/passing/parfor.pre +++ b/tests/cases/passing/parfor.pre @@ -1,4 +1,4 @@ -TNS: seen = [0d0, 0d0, 0d0, 0d0] +TNS seen = [0d0, 0d0, 0d0, 0d0] PARFOR(i, 0d4){ seen[i] = i } diff --git a/tests/cases/passing/pause-async-deferred-arg.pre b/tests/cases/passing/pause-async-deferred-arg.pre index 07163c9..6f2e4d8 100644 --- a/tests/cases/passing/pause-async-deferred-arg.pre +++ b/tests/cases/passing/pause-async-deferred-arg.pre @@ -1,6 +1,6 @@ -BOOL: released = FALSE +BOOL released = FALSE -THR: paused = PAUSE(ASYNC{ +THR paused = PAUSE(ASYNC{ WHILE(NOT(released)){} }, seconds = 0d0.05) diff --git a/tests/cases/passing/pause-async-handle-autoresume.pre b/tests/cases/passing/pause-async-handle-autoresume.pre index 84182e8..52f30d5 100644 --- a/tests/cases/passing/pause-async-handle-autoresume.pre +++ b/tests/cases/passing/pause-async-handle-autoresume.pre @@ -1,10 +1,10 @@ -BOOL: released = FALSE +BOOL released = FALSE -THR: worker = ASYNC{ +THR worker = ASYNC{ WHILE(NOT(released)){} } -THR: paused = PAUSE(worker, seconds = 0d0.05) +THR paused = PAUSE(worker, seconds = 0d0.05) ASSERT(EQ(TYPE(paused), "THR")) ASSERT(EQ(paused, worker)) diff --git a/tests/cases/passing/pause-explicit-negative-duration.pre b/tests/cases/passing/pause-explicit-negative-duration.pre index ba852a4..65f4fb8 100644 --- a/tests/cases/passing/pause-explicit-negative-duration.pre +++ b/tests/cases/passing/pause-explicit-negative-duration.pre @@ -1,10 +1,10 @@ -BOOL: released = FALSE +BOOL released = FALSE THR(worker){ WHILE(NOT(released)){} } -THR: paused = PAUSE(worker, seconds = -0d1.0) +THR paused = PAUSE(worker, seconds = -0d1.0) ASSERT(EQ(paused, worker)) ASSERT(PAUSED(worker)) diff --git a/tests/cases/passing/pause-thread-handle.pre b/tests/cases/passing/pause-thread-handle.pre index b30944e..9a3fd8f 100644 --- a/tests/cases/passing/pause-thread-handle.pre +++ b/tests/cases/passing/pause-thread-handle.pre @@ -1,4 +1,4 @@ -BOOL: released = FALSE +BOOL released = FALSE THR(worker){ WHILE(NOT(released)){} @@ -6,7 +6,7 @@ THR(worker){ ASSERT(BOOL(worker)) -THR: paused = PAUSE(worker) +THR paused = PAUSE(worker) ASSERT(EQ(TYPE(paused), "THR")) ASSERT(EQ(paused, worker)) diff --git a/tests/cases/passing/permafreeze.pre b/tests/cases/passing/permafreeze.pre index dbc20d3..1fc7d32 100644 --- a/tests/cases/passing/permafreeze.pre +++ b/tests/cases/passing/permafreeze.pre @@ -1,10 +1,10 @@ -BOOL: locked_value = TRUE +BOOL locked_value = TRUE REFUTE(PERMAFREEZE(locked_value)) ASSERT(FROZEN(locked_value)) ASSERT(PERMAFROZEN(locked_value)) -BOOL: permafreeze_undefined_failed = FALSE +BOOL permafreeze_undefined_failed = FALSE TRY{ PERMAFREEZE(not_declared) } CATCH { @@ -12,7 +12,7 @@ TRY{ } ASSERT(permafreeze_undefined_failed) -BOOL: reassignment_failed = FALSE +BOOL reassignment_failed = FALSE TRY{ locked_value = FALSE } CATCH { @@ -21,7 +21,7 @@ TRY{ ASSERT(reassignment_failed) ASSERT(EQ(locked_value, TRUE)) -BOOL: deletion_failed = FALSE +BOOL deletion_failed = FALSE TRY{ DEL(locked_value) } CATCH { @@ -30,7 +30,7 @@ TRY{ ASSERT(deletion_failed) ASSERT(EXIST(locked_value)) -BOOL: thaw_failed = FALSE +BOOL thaw_failed = FALSE TRY{ THAW(locked_value) } CATCH { diff --git a/tests/cases/passing/permafrozen.pre b/tests/cases/passing/permafrozen.pre index 02ddf6f..1934dde 100644 --- a/tests/cases/passing/permafrozen.pre +++ b/tests/cases/passing/permafrozen.pre @@ -1,4 +1,4 @@ -BOOL: normal_value = TRUE +BOOL normal_value = TRUE REFUTE(PERMAFROZEN(normal_value)) REFUTE(PERMAFREEZE(normal_value)) diff --git a/tests/cases/passing/pow-flt.pre b/tests/cases/passing/pow-flt.pre index ba615b4..8bbae70 100644 --- a/tests/cases/passing/pow-flt.pre +++ b/tests/cases/passing/pow-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x2.0 -FLT: wide_oct = 0o2.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x2.0 +FLT wide_oct = 0o2.0 ASSERT(EQ(POW(left_oct, right_hex), 0x2.4)) ASSERT(EQ(BASE(POW(left_oct, right_hex)), 0d16)) diff --git a/tests/cases/passing/pow-int.pre b/tests/cases/passing/pow-int.pre index b8e28a5..3d84815 100644 --- a/tests/cases/passing/pow-int.pre +++ b/tests/cases/passing/pow-int.pre @@ -1,6 +1,6 @@ -INT: two = 0d2 -INT: three = 0b11 -INT: four_hex = 0x4 +INT two = 0d2 +INT three = 0b11 +INT four_hex = 0x4 ASSERT(EQ(POW(two, three), 0d8)) ASSERT(EQ(BASE(POW(two, three)), 0d10)) diff --git a/tests/cases/passing/pow-pointer-writeback.pre b/tests/cases/passing/pow-pointer-writeback.pre index f26cb6c..e84b10e 100644 --- a/tests/cases/passing/pow-pointer-writeback.pre +++ b/tests/cases/passing/pow-pointer-writeback.pre @@ -1,31 +1,31 @@ -INT: a1 = 0d2 -INT: b1 = 0d3 +INT a1 = 0d2 +INT b1 = 0d3 POW(@a1, b1) ASSERT(EQ(a1, 0d8)) -INT: a2 = 0d2 -INT: b2 = 0d3 +INT a2 = 0d2 +INT b2 = 0d3 POW(a2, @b2) ASSERT(EQ(b2, 0d3)) -INT: a3 = 0d2 -INT: b3 = 0d3 +INT a3 = 0d2 +INT b3 = 0d3 POW(@a3, @b3) ASSERT(EQ(a3, 0d8)) ASSERT(EQ(b3, 0d3)) -FLT: f1 = 0d1.5 -FLT: g1 = 0d2.0 +FLT f1 = 0d1.5 +FLT g1 = 0d2.0 POW(@f1, g1) ASSERT(EQ(f1, 0d2.25)) -FLT: f2 = 0d1.5 -FLT: g2 = 0d2.0 +FLT f2 = 0d1.5 +FLT g2 = 0d2.0 POW(f2, @g2) ASSERT(EQ(g2, 0d2.0)) -FLT: f3 = 0d1.5 -FLT: g3 = 0d2.0 +FLT f3 = 0d1.5 +FLT g3 = 0d2.0 POW(@f3, @g3) ASSERT(EQ(f3, 0d2.25)) ASSERT(EQ(g3, 0d2.0)) diff --git a/tests/cases/passing/prod-flt.pre b/tests/cases/passing/prod-flt.pre index 09c474c..98c6548 100644 --- a/tests/cases/passing/prod-flt.pre +++ b/tests/cases/passing/prod-flt.pre @@ -1,3 +1,3 @@ ! PROD with two FLT arguments -FLT: result = PROD(0d1.5, 0d2.0) +FLT result = PROD(0d1.5, 0d2.0) ASSERT(EQ(result, 0d3.0)) diff --git a/tests/cases/passing/prod-int.pre b/tests/cases/passing/prod-int.pre index 3a00f6a..da3082e 100644 --- a/tests/cases/passing/prod-int.pre +++ b/tests/cases/passing/prod-int.pre @@ -1,3 +1,3 @@ ! PROD with three INT arguments -INT: result = PROD(0d2, 0d3, 0d1) +INT result = PROD(0d2, 0d3, 0d1) ASSERT(EQ(result, 0d6)) diff --git a/tests/cases/passing/readfile-ansi.pre b/tests/cases/passing/readfile-ansi.pre index f584dd3..c8c1f93 100644 --- a/tests/cases/passing/readfile-ansi.pre +++ b/tests/cases/passing/readfile-ansi.pre @@ -1,5 +1,5 @@ IMPORT(path) -STR: p = JOIN(path.script_dir, "/plain.txt") +STR p = JOIN(path.script_dir, "/plain.txt") ASSERT(EQ(READFILE(p, coding = "ANSI"), "Prefix")) diff --git a/tests/cases/passing/readfile-binary-hex.pre b/tests/cases/passing/readfile-binary-hex.pre index 0378a59..cd62dca 100644 --- a/tests/cases/passing/readfile-binary-hex.pre +++ b/tests/cases/passing/readfile-binary-hex.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = JOIN(path.script_dir, "/plain.txt") +STR p = JOIN(path.script_dir, "/plain.txt") ASSERT(EQ(READFILE(p, coding = "binary"), "010100000111001001100101011001100110100101111000")) ASSERT(EQ(READFILE(p, coding = "hex"), "507265666978")) diff --git a/tests/cases/passing/readfile-plain.pre b/tests/cases/passing/readfile-plain.pre index 5098b6e..15b3db8 100644 --- a/tests/cases/passing/readfile-plain.pre +++ b/tests/cases/passing/readfile-plain.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = JOIN(path.script_dir, "/plain.txt") +STR p = JOIN(path.script_dir, "/plain.txt") ASSERT(EQ(READFILE(p), "Prefix")) ASSERT(EQ(READFILE(p, coding = "uTf-8"), "Prefix")) diff --git a/tests/cases/passing/readfile-utf16-replacement.pre b/tests/cases/passing/readfile-utf16-replacement.pre index 428e914..053cdf4 100644 --- a/tests/cases/passing/readfile-utf16-replacement.pre +++ b/tests/cases/passing/readfile-utf16-replacement.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-readfile-utf16-replacement.bin") +STR p = path.TEMPFILE("prefix-readfile-utf16-replacement.bin") ASSERT(WRITEFILE("00D8", p, coding = "hex")) ASSERT(EQ(READFILE(p, coding = "UTF-16 LE"), "\uFFFD")) diff --git a/tests/cases/passing/repl-multiline.ps1 b/tests/cases/passing/repl-multiline.ps1 index 0cbc3e3..88d8e1c 100644 --- a/tests/cases/passing/repl-multiline.ps1 +++ b/tests/cases/passing/repl-multiline.ps1 @@ -2,7 +2,7 @@ $helperPath = Join-Path (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)) . $helperPath $input = @' -FUNC STR: hello(){ +FUNC STR hello(){ RETURN("hi") } PRINT(hello()) diff --git a/tests/cases/passing/repl-persistence.ps1 b/tests/cases/passing/repl-persistence.ps1 index 7d73ab8..385a790 100644 --- a/tests/cases/passing/repl-persistence.ps1 +++ b/tests/cases/passing/repl-persistence.ps1 @@ -2,7 +2,7 @@ $helperPath = Join-Path (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)) . $helperPath $input = @' -BOOL: persisted = TRUE +BOOL persisted = TRUE PRINT(persisted) .exit diff --git a/tests/cases/passing/restart-basic.pre b/tests/cases/passing/restart-basic.pre index 884d790..1ccfe83 100644 --- a/tests/cases/passing/restart-basic.pre +++ b/tests/cases/passing/restart-basic.pre @@ -1,6 +1,6 @@ -BOOL: finished = FALSE +BOOL finished = FALSE -THR: worker = ASYNC{ +THR worker = ASYNC{ FOR(i, 0d2){} finished = TRUE } @@ -10,7 +10,7 @@ AWAIT(worker) ASSERT(EQ(finished, TRUE)) ! Restart the finished thread -THR: r = RESTART(worker) +THR r = RESTART(worker) ASSERT(EQ(TYPE(r), "THR")) ASSERT(EQ(r, worker)) ASSERT(BOOL(r)) diff --git a/tests/cases/passing/root-flt.pre b/tests/cases/passing/root-flt.pre index 621db0d..f59db90 100644 --- a/tests/cases/passing/root-flt.pre +++ b/tests/cases/passing/root-flt.pre @@ -1,9 +1,9 @@ -FLT: exact_hex = 0x64.0 -FLT: exact_dec = 0d64.0 -FLT: zero_hex = 0x0.0 -FLT: negative_odd_dec = -0d27.0 -FLT: root_dec = 0d2.0 -FLT: root_hex = 0x3.0 +FLT exact_hex = 0x64.0 +FLT exact_dec = 0d64.0 +FLT zero_hex = 0x0.0 +FLT negative_odd_dec = -0d27.0 +FLT root_dec = 0d2.0 +FLT root_hex = 0x3.0 ASSERT(EQ(ROOT(exact_hex, root_dec), 0xA.0)) ASSERT(ISFLT(ROOT(exact_hex, root_dec))) diff --git a/tests/cases/passing/root-int.pre b/tests/cases/passing/root-int.pre index 6fc1695..a76fc9c 100644 --- a/tests/cases/passing/root-int.pre +++ b/tests/cases/passing/root-int.pre @@ -1,10 +1,10 @@ -INT: exact_hex = 0x64 -INT: floor_dec = 0d17 -INT: zero_hex = 0x0 -INT: unit_hex = 0x1 -INT: root_dec = 0d2 -INT: root_hex = 0x2 -INT: neg_one_dec = -0d1 +INT exact_hex = 0x64 +INT floor_dec = 0d17 +INT zero_hex = 0x0 +INT unit_hex = 0x1 +INT root_dec = 0d2 +INT root_hex = 0x2 +INT neg_one_dec = -0d1 ASSERT(EQ(ROOT(exact_hex, root_dec), 0xA)) ASSERT(ISINT(ROOT(exact_hex, root_dec))) diff --git a/tests/cases/passing/round.pre b/tests/cases/passing/round.pre index 3e0d4b8..cec073d 100644 --- a/tests/cases/passing/round.pre +++ b/tests/cases/passing/round.pre @@ -1,6 +1,6 @@ ! ROUND coverage based on the specification -FLT: r_half = 0b0.101 +FLT r_half = 0b0.101 ASSERT(EQ(ROUND(r_half), 0b0.0)) ASSERT(EQ(ROUND(r_half, mode = "floor", ndigits = 0b10), 0b0.10)) ASSERT(EQ(ROUND(r_half, ndigits = 0b10), 0b0.10)) @@ -11,17 +11,17 @@ ASSERT(EQ(ROUND(r_half, mode = "logical", ndigits = 0b10), 0b0.11)) ASSERT(EQ(ROUND(r_half, mode = "half-up", ndigits = 0b10), 0b0.11)) ASSERT(EQ(ROUND(0b0.101, 0b10), 0b0.10)) -FLT: rn_half = -0b0.101 +FLT rn_half = -0b0.101 ASSERT(EQ(ROUND(rn_half, ndigits = 0b10), -0b0.11)) ASSERT(EQ(ROUND(rn_half, mode = "zero", ndigits = 0b10), -0b0.10)) ASSERT(EQ(ROUND(rn_half, mode = "logical", ndigits = 0b10), -0b0.11)) -FLT: three = 0b11.0 +FLT three = 0b11.0 ASSERT(EQ(ROUND(three, ndigits = -0b1), 0b10.0)) ASSERT(EQ(ROUND(three, mode = "logical", ndigits = -0b1), 0b100.0)) ASSERT(EQ(ROUND(three, -0b1), 0b10.0)) -FLT: neg_three = -0b11.0 +FLT neg_three = -0b11.0 ASSERT(EQ(ROUND(neg_three, ndigits = -0b1), -0b100.0)) ASSERT(EQ(ROUND(neg_three, mode = "zero", ndigits = -0b1), -0b10.0)) ASSERT(EQ(ROUND(neg_three, mode = "logical", ndigits = -0b1), -0b100.0)) \ No newline at end of file diff --git a/tests/cases/passing/run-empty-source.pre b/tests/cases/passing/run-empty-source.pre index 85afdc9..311093c 100644 --- a/tests/cases/passing/run-empty-source.pre +++ b/tests/cases/passing/run-empty-source.pre @@ -1,3 +1,3 @@ -INT: marker = 0d1 +INT marker = 0d1 RUN("") ASSERT(EQ(marker, 0d1)) \ No newline at end of file diff --git a/tests/cases/passing/run-parse-error.pre b/tests/cases/passing/run-parse-error.pre index 09bb4e6..e3afc35 100644 --- a/tests/cases/passing/run-parse-error.pre +++ b/tests/cases/passing/run-parse-error.pre @@ -1,5 +1,5 @@ -INT: step = 0d0 -BOOL: caught = FALSE +INT step = 0d0 +BOOL caught = FALSE TRY{ RUN("step = 0d1; IF(TRUE){") diff --git a/tests/cases/passing/run-runtime-error.pre b/tests/cases/passing/run-runtime-error.pre index 2dc3df6..df883ff 100644 --- a/tests/cases/passing/run-runtime-error.pre +++ b/tests/cases/passing/run-runtime-error.pre @@ -1,5 +1,5 @@ -INT: step = 0d0 -BOOL: caught = FALSE +INT step = 0d0 +BOOL caught = FALSE TRY{ RUN("step = 0d1; ASSERT(FALSE); step = 0d2") diff --git a/tests/cases/passing/run-top-level-env.pre b/tests/cases/passing/run-top-level-env.pre index 39a98d4..bd00604 100644 --- a/tests/cases/passing/run-top-level-env.pre +++ b/tests/cases/passing/run-top-level-env.pre @@ -1,7 +1,7 @@ -INT: counter = 0d2 +INT counter = 0d2 RUN("ASSERT(EQ(counter, 0d2)); counter = ADD(counter, 0d3)") ASSERT(EQ(counter, 0d5)) -RUN("INT: created = SUB(counter, 0d1)") +RUN("INT created = SUB(counter, 0d1)") ASSERT(EQ(created, 0d4)) \ No newline at end of file diff --git a/tests/cases/passing/scat-1d-basic.pre b/tests/cases/passing/scat-1d-basic.pre index ff1832a..617908c 100644 --- a/tests/cases/passing/scat-1d-basic.pre +++ b/tests/cases/passing/scat-1d-basic.pre @@ -1,6 +1,6 @@ -TNS: src = [0d9, 0d8] -TNS: dst = [0d1, 0d2, 0d3, 0d4] -TNS: out = SCAT(src, dst, [[0d2, 0d3]]) +TNS src = [0d9, 0d8] +TNS dst = [0d1, 0d2, 0d3, 0d4] +TNS out = SCAT(src, dst, [[0d2, 0d3]]) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d1, 0d9, 0d8, 0d4])) diff --git a/tests/cases/passing/scat-2d-rect.pre b/tests/cases/passing/scat-2d-rect.pre index 32503f1..b33309d 100644 --- a/tests/cases/passing/scat-2d-rect.pre +++ b/tests/cases/passing/scat-2d-rect.pre @@ -1,6 +1,6 @@ -TNS: src = [[0d7, 0d8], [0d9, 0d10]] -TNS: dst = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6], [0d11, 0d12, 0d13]] -TNS: out = SCAT(src, dst, [[0d2, 0d3], [0d1, 0d2]]) +TNS src = [[0d7, 0d8], [0d9, 0d10]] +TNS dst = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6], [0d11, 0d12, 0d13]] +TNS out = SCAT(src, dst, [[0d2, 0d3], [0d1, 0d2]]) ASSERT(EQ(out, [[0d1, 0d2, 0d3], [0d7, 0d8, 0d6], [0d9, 0d10, 0d13]])) ASSERT(EQ(SHAPE(out), [0d3, 0d3])) diff --git a/tests/cases/passing/scat-3d-rect.pre b/tests/cases/passing/scat-3d-rect.pre index 20eaf5e..42e3654 100644 --- a/tests/cases/passing/scat-3d-rect.pre +++ b/tests/cases/passing/scat-3d-rect.pre @@ -1,5 +1,5 @@ -TNS: src = [[[0d99, 0d98]], [[0d97, 0d96]]] -TNS: dst = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] -TNS: out = SCAT(src, dst, [[0d1, 0d2], [0d2, 0d2], [0d1, 0d2]]) +TNS src = [[[0d99, 0d98]], [[0d97, 0d96]]] +TNS dst = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] +TNS out = SCAT(src, dst, [[0d1, 0d2], [0d2, 0d2], [0d1, 0d2]]) ASSERT(EQ(out, [[[0d1, 0d2], [0d99, 0d98]], [[0d5, 0d6], [0d97, 0d96]]])) diff --git a/tests/cases/passing/scat-inclusive-singleton.pre b/tests/cases/passing/scat-inclusive-singleton.pre index eba45be..548a2f8 100644 --- a/tests/cases/passing/scat-inclusive-singleton.pre +++ b/tests/cases/passing/scat-inclusive-singleton.pre @@ -1,3 +1,3 @@ -TNS: out = SCAT([0d55], [0d10, 0d20, 0d30], [[0d3, 0d3]]) +TNS out = SCAT([0d55], [0d10, 0d20, 0d30], [[0d3, 0d3]]) ASSERT(EQ(out, [0d10, 0d20, 0d55])) diff --git a/tests/cases/passing/ser-func-ref.pre b/tests/cases/passing/ser-func-ref.pre index 8567e75..aced618 100644 --- a/tests/cases/passing/ser-func-ref.pre +++ b/tests/cases/passing/ser-func-ref.pre @@ -1,23 +1,23 @@ -FUNC BOOL: contains(STR: haystack, STR: needle){ +FUNC BOOL contains(STR haystack, STR needle){ RETURN(GT(TLEN(SPLIT(haystack, needle), 0d1), 0d1)) } -FUNC INT: occurrences(STR: haystack, STR: needle){ +FUNC INT occurrences(STR haystack, STR needle){ RETURN(SUB(TLEN(SPLIT(haystack, needle), 0d1), 0d1)) } -FUNC INT: identity(INT: value){ +FUNC INT identity(INT value){ RETURN(value) } -MAP: shared = <"first" = identity, "second" = identity> -STR: json = SER(shared) +MAP shared = <"first" = identity, "second" = identity> +STR json = SER(shared) ASSERT(contains(json, '\R"t":"FUNC"')) ASSERT(contains(json, '\R"name":"identity"')) ASSERT(GT(occurrences(json, '\R"def":{'), 0d0)) ASSERT(contains(json, '\R"ref":true')) -MAP: roundtrip = UNSER(SER(shared)) +MAP roundtrip = UNSER(SER(shared)) ASSERT(EQ(roundtrip<"first">(0d4), 0d4)) ASSERT(EQ(roundtrip<"second">(0d5), 0d5)) \ No newline at end of file diff --git a/tests/cases/passing/ser-func.pre b/tests/cases/passing/ser-func.pre index 4832c25..2e1ac6d 100644 --- a/tests/cases/passing/ser-func.pre +++ b/tests/cases/passing/ser-func.pre @@ -1,15 +1,15 @@ -FUNC BOOL: contains(STR: haystack, STR: needle){ +FUNC BOOL contains(STR haystack, STR needle){ RETURN(GT(TLEN(SPLIT(haystack, needle), 0d1), 0d1)) } -INT: seed = 0d9 -INT: alias = @seed +INT seed = 0d9 +INT alias = @seed -FUNC INT: add_seed(~INT: count, INT: step = 0d1){ +FUNC INT add_seed(~INT count, INT step = 0d1){ RETURN(ADD(alias, ADD(count, step))) } -STR: json = SER(add_seed) +STR json = SER(add_seed) ASSERT(contains(json, '\R"t":"FUNC"')) ASSERT(contains(json, '\R"name":"add_seed"')) diff --git a/tests/cases/passing/ser-map.pre b/tests/cases/passing/ser-map.pre index b782ff8..0b05a94 100644 --- a/tests/cases/passing/ser-map.pre +++ b/tests/cases/passing/ser-map.pre @@ -1,7 +1,7 @@ -MAP: ordered = <"alpha" = 0d1, 0d2 = "two", 0d3.5 = TRUE> +MAP ordered = <"alpha" = 0d1, 0d2 = "two", 0d3.5 = TRUE> ASSERT(EQ(SER(ordered), '\R{"t":"MAP","v":[{"k":{"t":"STR","v":"alpha"},"v":{"t":"INT","v":"0d1"}},{"k":{"t":"INT","v":"0d2"},"v":{"t":"STR","v":"two"}},{"k":{"t":"FLT","v":"0d3.5"},"v":{"t":"BOOL","v":true}}]}')) -MAP: nested = <"outer" = <"inner" = [0d1, 0d2]>> +MAP nested = <"outer" = <"inner" = [0d1, 0d2]>> ASSERT(EQ(UNSER(SER(nested)), nested)) ASSERT(EQ(KEYS(UNSER(SER(ordered))), ["alpha", 0d2, 0d3.5])) \ No newline at end of file diff --git a/tests/cases/passing/ser-strings.pre b/tests/cases/passing/ser-strings.pre index c336c88..0209607 100644 --- a/tests/cases/passing/ser-strings.pre +++ b/tests/cases/passing/ser-strings.pre @@ -1,10 +1,10 @@ ASSERT(EQ(SER("Prefix"), '{"t":"STR","v":"Prefix"}')) -STR: escaped = "\"\\\b\f\n\r\t" +STR escaped = "\"\\\b\f\n\r\t" ASSERT(EQ(SER(escaped), '\R{"t":"STR","v":"\"\\\b\f\n\r\t"}')) ASSERT(EQ(SER("\x01"), '\R{"t":"STR","v":"\u0001"}')) -STR: unicode_json = SER("\u00E9") +STR unicode_json = SER("\u00E9") ASSERT(OR(EQ(unicode_json, '\R{"t":"STR","v":"\u00E9"}'), EQ(unicode_json, '\R{"t":"STR","v":"\u00e9"}'))) ASSERT(EQ(UNSER(unicode_json), "\u00E9")) \ No newline at end of file diff --git a/tests/cases/passing/ser-tensor.pre b/tests/cases/passing/ser-tensor.pre index 78de26e..9a66c1d 100644 --- a/tests/cases/passing/ser-tensor.pre +++ b/tests/cases/passing/ser-tensor.pre @@ -1,5 +1,5 @@ ASSERT(EQ(SER([0d1, 0d2]), '\R{"t":"TNS","shape":[2],"v":[{"t":"INT","v":"0d1"},{"t":"INT","v":"0d2"}]}')) -TNS: square = [[0d1, 0d2], [0d3, 0d4]] +TNS square = [[0d1, 0d2], [0d3, 0d4]] ASSERT(EQ(SER(square), '\R{"t":"TNS","shape":[2,2],"v":[{"t":"INT","v":"0d1"},{"t":"INT","v":"0d2"},{"t":"INT","v":"0d3"},{"t":"INT","v":"0d4"}]}')) ASSERT(EQ(UNSER(SER(square)), square)) \ No newline at end of file diff --git a/tests/cases/passing/ser-thr.pre b/tests/cases/passing/ser-thr.pre index e81029e..756905f 100644 --- a/tests/cases/passing/ser-thr.pre +++ b/tests/cases/passing/ser-thr.pre @@ -1,15 +1,15 @@ -FUNC BOOL: contains(STR: haystack, STR: needle){ +FUNC BOOL contains(STR haystack, STR needle){ RETURN(GT(TLEN(SPLIT(haystack, needle), 0d1), 0d1)) } -FUNC INT: occurrences(STR: haystack, STR: needle){ +FUNC INT occurrences(STR haystack, STR needle){ RETURN(SUB(TLEN(SPLIT(haystack, needle), 0d1), 0d1)) } THR(worker){} AWAIT(worker) -STR: json = SER(worker) +STR json = SER(worker) ASSERT(contains(json, '\R"t":"THR"')) ASSERT(contains(json, '\R"id":"t1"')) @@ -20,6 +20,6 @@ ASSERT(contains(json, '\R"stop":false')) ASSERT(contains(json, '\R"env":')) ASSERT(contains(json, '\R"block":{"n":"Block"')) -MAP: shared = <"first" = worker, "second" = worker> -STR: shared_json = SER(shared) +MAP shared = <"first" = worker, "second" = worker> +STR shared_json = SER(shared) ASSERT(EQ(occurrences(shared_json, '\R"id":"t1"'), 0d2)) \ No newline at end of file diff --git a/tests/cases/passing/shape-rank-1.pre b/tests/cases/passing/shape-rank-1.pre index b6203b3..c400225 100644 --- a/tests/cases/passing/shape-rank-1.pre +++ b/tests/cases/passing/shape-rank-1.pre @@ -1,4 +1,4 @@ -TNS: v = [0d10, 0d20, 0d30, 0d40] +TNS v = [0d10, 0d20, 0d30, 0d40] ASSERT(EQ(TYPE(SHAPE(v)), "TNS")) ASSERT(EQ(SHAPE(v), [0d4])) diff --git a/tests/cases/passing/shape-rank-2.pre b/tests/cases/passing/shape-rank-2.pre index 8fb7045..61334f3 100644 --- a/tests/cases/passing/shape-rank-2.pre +++ b/tests/cases/passing/shape-rank-2.pre @@ -1,3 +1,3 @@ -TNS: m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] +TNS m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] ASSERT(EQ(SHAPE(m), [0d2, 0d3])) diff --git a/tests/cases/passing/shape-rank-3.pre b/tests/cases/passing/shape-rank-3.pre index cb7d03d..402e7ea 100644 --- a/tests/cases/passing/shape-rank-3.pre +++ b/tests/cases/passing/shape-rank-3.pre @@ -1,3 +1,3 @@ -TNS: cube = [[[0d1, 0d2]], [[0d3, 0d4]], [[0d5, 0d6]]] +TNS cube = [[[0d1, 0d2]], [[0d3, 0d4]], [[0d5, 0d6]]] ASSERT(EQ(SHAPE(cube), [0d3, 0d1, 0d2])) diff --git a/tests/cases/passing/shape-result-is-1d.pre b/tests/cases/passing/shape-result-is-1d.pre index bde92a8..7fc646a 100644 --- a/tests/cases/passing/shape-result-is-1d.pre +++ b/tests/cases/passing/shape-result-is-1d.pre @@ -1,5 +1,5 @@ -TNS: t = [[[0d1], [0d2], [0d3]], [[0d4], [0d5], [0d6]]] -TNS: dims = SHAPE(t) +TNS t = [[[0d1], [0d2], [0d3]], [[0d4], [0d5], [0d6]]] +TNS dims = SHAPE(t) ASSERT(EQ(TYPE(dims), "TNS")) ASSERT(EQ(TLEN(dims, 0d1), 0d3)) diff --git a/tests/cases/passing/shush-input-prompt-forwarded.ps1 b/tests/cases/passing/shush-input-prompt-forwarded.ps1 index 5d281a9..8b07f5a 100644 --- a/tests/cases/passing/shush-input-prompt-forwarded.ps1 +++ b/tests/cases/passing/shush-input-prompt-forwarded.ps1 @@ -8,7 +8,7 @@ try { Set-Content -Path $programPath -Encoding Ascii -Value @' SHUSH() -STR: line = INPUT("PROMPT>") +STR line = INPUT("PROMPT>") ASSERT(EQ(line, "alpha")) PRINT("hidden") '@ diff --git a/tests/cases/passing/signature.pre b/tests/cases/passing/signature.pre index da0c2f6..007e957 100644 --- a/tests/cases/passing/signature.pre +++ b/tests/cases/passing/signature.pre @@ -1,19 +1,19 @@ -INT: sample_value = 0d5 +INT sample_value = 0d5 -FUNC INT: plain(INT: left, STR: right = "def"){ +FUNC INT plain(INT left, STR right = "def"){ RETURN(left) } -FUNC INT: coerced(~INT: value, STR: suffix = "x"){ +FUNC INT coerced(~INT value, STR suffix = "x"){ RETURN(value) } -FUNC STR: local_signature(){ - INT: inner_value = 0d1 +FUNC STR local_signature(){ + INT inner_value = 0d1 RETURN(SIGNATURE(inner_value)) } -ASSERT(EQ(SIGNATURE(sample_value), 'INT: sample_value')) -ASSERT(EQ(SIGNATURE(plain), 'INT: plain(INT: left, STR: right = "def")')) -ASSERT(EQ(SIGNATURE(coerced), 'INT: coerced(~INT: value, STR: suffix = "x")')) -ASSERT(EQ(local_signature(), 'INT: inner_value')) +ASSERT(EQ(SIGNATURE(sample_value), 'INT sample_value')) +ASSERT(EQ(SIGNATURE(plain), 'INT plain(INT left, STR right = "def")')) +ASSERT(EQ(SIGNATURE(coerced), 'INT coerced(~INT value, STR suffix = "x")')) +ASSERT(EQ(local_signature(), 'INT inner_value')) diff --git a/tests/cases/passing/split-default-delimiter.pre b/tests/cases/passing/split-default-delimiter.pre index c90c7e3..bc7ec87 100644 --- a/tests/cases/passing/split-default-delimiter.pre +++ b/tests/cases/passing/split-default-delimiter.pre @@ -1,4 +1,4 @@ -TNS: words = SPLIT("foo bar baz") +TNS words = SPLIT("foo bar baz") ASSERT(EQ(TYPE(words), "TNS")) ASSERT(EQ(words, ["foo", "bar", "baz"])) diff --git a/tests/cases/passing/split-return-element-type.pre b/tests/cases/passing/split-return-element-type.pre index a822281..cb0185f 100644 --- a/tests/cases/passing/split-return-element-type.pre +++ b/tests/cases/passing/split-return-element-type.pre @@ -1,4 +1,4 @@ -TNS: parts = SPLIT("left|right", "|") +TNS parts = SPLIT("left|right", "|") ASSERT(EQ(TYPE(parts[0d1]), "STR")) ASSERT(EQ(TYPE(parts[0d2]), "STR")) diff --git a/tests/cases/passing/statement-using-caret.pre b/tests/cases/passing/statement-using-caret.pre index 8790bde..cda234e 100644 --- a/tests/cases/passing/statement-using-caret.pre +++ b/tests/cases/passing/statement-using-caret.pre @@ -1,2 +1,2 @@ -BOOL: ^ +BOOL ^ x = TRUE diff --git a/tests/cases/passing/statements-semicolon-delimiter.pre b/tests/cases/passing/statements-semicolon-delimiter.pre index b2b555d..ee01b6b 100644 --- a/tests/cases/passing/statements-semicolon-delimiter.pre +++ b/tests/cases/passing/statements-semicolon-delimiter.pre @@ -1 +1 @@ -BOOL: x = TRUE ; BOOL: y = FALSE +BOOL x = TRUE ; BOOL y = FALSE diff --git a/tests/cases/passing/stop-async-deferred-arg.pre b/tests/cases/passing/stop-async-deferred-arg.pre index 635f7f0..8234e89 100644 --- a/tests/cases/passing/stop-async-deferred-arg.pre +++ b/tests/cases/passing/stop-async-deferred-arg.pre @@ -1,6 +1,6 @@ -BOOL: reached_end = FALSE +BOOL reached_end = FALSE -THR: stopped = STOP(ASYNC{ +THR stopped = STOP(ASYNC{ FOR(i, 0d100000){} reached_end = TRUE }) diff --git a/tests/cases/passing/stop-async-handle.pre b/tests/cases/passing/stop-async-handle.pre index da33058..46600e3 100644 --- a/tests/cases/passing/stop-async-handle.pre +++ b/tests/cases/passing/stop-async-handle.pre @@ -1,13 +1,13 @@ -BOOL: reached_end = FALSE +BOOL reached_end = FALSE -THR: worker = ASYNC{ +THR worker = ASYNC{ FOR(i, 0d100000){} reached_end = TRUE } ASSERT(BOOL(worker)) -THR: stopped = STOP(worker) +THR stopped = STOP(worker) ASSERT(EQ(TYPE(stopped), "THR")) ASSERT(EQ(stopped, worker)) diff --git a/tests/cases/passing/stop-thread-handle.pre b/tests/cases/passing/stop-thread-handle.pre index ad34086..f14ecd4 100644 --- a/tests/cases/passing/stop-thread-handle.pre +++ b/tests/cases/passing/stop-thread-handle.pre @@ -1,4 +1,4 @@ -BOOL: reached_end = FALSE +BOOL reached_end = FALSE THR(worker){ FOR(i, 0d1000000){ @@ -8,7 +8,7 @@ THR(worker){ ASSERT(BOOL(worker)) -THR: stopped = STOP(worker) +THR stopped = STOP(worker) ASSERT(EQ(TYPE(stopped), "THR")) ASSERT(EQ(stopped, worker)) diff --git a/tests/cases/passing/string-literals.pre b/tests/cases/passing/string-literals.pre index 5a1f7fa..94e3112 100644 --- a/tests/cases/passing/string-literals.pre +++ b/tests/cases/passing/string-literals.pre @@ -1,9 +1,9 @@ -STR: empty_single = '' -STR: empty_double = "" -STR: single = 'alpha' -STR: double = "beta" -STR: mixed_single = 'double "quote"' -STR: mixed_double = "single 'quote'" +STR empty_single = '' +STR empty_double = "" +STR single = 'alpha' +STR double = "beta" +STR mixed_single = 'double "quote"' +STR mixed_double = "single 'quote'" ASSERT(EQ(empty_single, empty_double)) ASSERT(EQ(single, "alpha")) diff --git a/tests/cases/passing/sub-flt.pre b/tests/cases/passing/sub-flt.pre index 305c135..10829ce 100644 --- a/tests/cases/passing/sub-flt.pre +++ b/tests/cases/passing/sub-flt.pre @@ -1,6 +1,6 @@ -FLT: left_oct = 0o1.4 -FLT: right_hex = 0x0.8 -FLT: left_oct_one = 0o1.0 +FLT left_oct = 0o1.4 +FLT right_hex = 0x0.8 +FLT left_oct_one = 0o1.0 ASSERT(EQ(SUB(left_oct_one, right_hex), 0x0.8)) ASSERT(EQ(BASE(SUB(left_oct_one, right_hex)), 0d16)) diff --git a/tests/cases/passing/sub-int.pre b/tests/cases/passing/sub-int.pre index 0165a23..825993e 100644 --- a/tests/cases/passing/sub-int.pre +++ b/tests/cases/passing/sub-int.pre @@ -1,6 +1,6 @@ -INT: left_dec = 0d2 -INT: right_bin = 0b11 -INT: wide_hex = 0x10 +INT left_dec = 0d2 +INT right_bin = 0b11 +INT wide_hex = 0x10 ASSERT(EQ(SUB(right_bin, left_dec), 0d1)) ASSERT(EQ(BASE(SUB(right_bin, left_dec)), 0d10)) diff --git a/tests/cases/passing/sub-pointer-writeback.pre b/tests/cases/passing/sub-pointer-writeback.pre index afb213d..9480be2 100644 --- a/tests/cases/passing/sub-pointer-writeback.pre +++ b/tests/cases/passing/sub-pointer-writeback.pre @@ -1,9 +1,9 @@ -INT: a1 = 0d5 -INT: b1 = 0d3 +INT a1 = 0d5 +INT b1 = 0d3 SUB(@a1, b1) ASSERT(EQ(a1, 0d2)) -FLT: f1 = 0d5.5 -FLT: g1 = 0d1.25 +FLT f1 = 0d5.5 +FLT g1 = 0d1.25 SUB(@f1, g1) ASSERT(EQ(f1, 0d4.25)) diff --git a/tests/cases/passing/sum-flt.pre b/tests/cases/passing/sum-flt.pre index c83e9fb..35effaf 100644 --- a/tests/cases/passing/sum-flt.pre +++ b/tests/cases/passing/sum-flt.pre @@ -1,3 +1,3 @@ ! SUM with two FLT arguments -FLT: result = SUM(0d1.5, 0d2.5) +FLT result = SUM(0d1.5, 0d2.5) ASSERT(EQ(result, 0d4.0)) diff --git a/tests/cases/passing/sum-int.pre b/tests/cases/passing/sum-int.pre index 6d6bcd7..a52c8e6 100644 --- a/tests/cases/passing/sum-int.pre +++ b/tests/cases/passing/sum-int.pre @@ -1,3 +1,3 @@ ! SUM with three INT arguments -INT: result = SUM(0d1, 0d2, 0d3) +INT result = SUM(0d1, 0d2, 0d3) ASSERT(EQ(result, 0d6)) diff --git a/tests/cases/passing/tadd-basic.pre b/tests/cases/passing/tadd-basic.pre index 4abd90c..acab918 100644 --- a/tests/cases/passing/tadd-basic.pre +++ b/tests/cases/passing/tadd-basic.pre @@ -1,4 +1,4 @@ -TNS: out = TADD([0d1, 0d2, 0d3], 0d4) +TNS out = TADD([0d1, 0d2, 0d3], 0d4) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d5, 0d6, 0d7])) diff --git a/tests/cases/passing/tadd-rank2-shape.pre b/tests/cases/passing/tadd-rank2-shape.pre index cc02948..30878e8 100644 --- a/tests/cases/passing/tadd-rank2-shape.pre +++ b/tests/cases/passing/tadd-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d1, 0d2], [0d3, 0d4]] -TNS: out = TADD(src, 0d10) +TNS src = [[0d1, 0d2], [0d3, 0d4]] +TNS out = TADD(src, 0d10) ASSERT(EQ(out, [[0d11, 0d12], [0d13, 0d14]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/tdiv-basic.pre b/tests/cases/passing/tdiv-basic.pre index e0734ad..6cb5dc0 100644 --- a/tests/cases/passing/tdiv-basic.pre +++ b/tests/cases/passing/tdiv-basic.pre @@ -1,4 +1,4 @@ -TNS: out = TDIV([0d8, 0d6, 0d4], 0d2) +TNS out = TDIV([0d8, 0d6, 0d4], 0d2) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d4, 0d3, 0d2])) diff --git a/tests/cases/passing/tdiv-rank2-shape.pre b/tests/cases/passing/tdiv-rank2-shape.pre index 6d45eae..f0787bc 100644 --- a/tests/cases/passing/tdiv-rank2-shape.pre +++ b/tests/cases/passing/tdiv-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d12, 0d10], [0d8, 0d6]] -TNS: out = TDIV(src, 0d2) +TNS src = [[0d12, 0d10], [0d8, 0d6]] +TNS out = TDIV(src, 0d2) ASSERT(EQ(out, [[0d6, 0d5], [0d4, 0d3]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/tflip-rank1.pre b/tests/cases/passing/tflip-rank1.pre index 0e77bce..b3e991e 100644 --- a/tests/cases/passing/tflip-rank1.pre +++ b/tests/cases/passing/tflip-rank1.pre @@ -1,4 +1,4 @@ -TNS: v = [0d1, 0d2, 0d3, 0d4] +TNS v = [0d1, 0d2, 0d3, 0d4] ASSERT(EQ(TYPE(TFLIP(v, 0d1)), "TNS")) ASSERT(EQ(TFLIP(v, 0d1), [0d4, 0d3, 0d2, 0d1])) diff --git a/tests/cases/passing/tflip-rank2-dim1.pre b/tests/cases/passing/tflip-rank2-dim1.pre index 52b1014..961a932 100644 --- a/tests/cases/passing/tflip-rank2-dim1.pre +++ b/tests/cases/passing/tflip-rank2-dim1.pre @@ -1,5 +1,5 @@ -TNS: m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] -TNS: flipped = TFLIP(m, 0d1) +TNS m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] +TNS flipped = TFLIP(m, 0d1) ASSERT(EQ(flipped, [[0d4, 0d5, 0d6], [0d1, 0d2, 0d3]])) ASSERT(EQ(SHAPE(flipped), [0d2, 0d3])) diff --git a/tests/cases/passing/tflip-rank2-dim2.pre b/tests/cases/passing/tflip-rank2-dim2.pre index 85aa0dc..2845629 100644 --- a/tests/cases/passing/tflip-rank2-dim2.pre +++ b/tests/cases/passing/tflip-rank2-dim2.pre @@ -1,3 +1,3 @@ -TNS: m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] +TNS m = [[0d1, 0d2, 0d3], [0d4, 0d5, 0d6]] ASSERT(EQ(TFLIP(m, 0d2), [[0d3, 0d2, 0d1], [0d6, 0d5, 0d4]])) diff --git a/tests/cases/passing/tflip-rank3-dim3.pre b/tests/cases/passing/tflip-rank3-dim3.pre index 702db0a..247bec9 100644 --- a/tests/cases/passing/tflip-rank3-dim3.pre +++ b/tests/cases/passing/tflip-rank3-dim3.pre @@ -1,3 +1,3 @@ -TNS: cube = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] +TNS cube = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] ASSERT(EQ(TFLIP(cube, 0d3), [[[0d2, 0d1], [0d4, 0d3]], [[0d6, 0d5], [0d8, 0d7]]])) diff --git a/tests/cases/passing/tflt.pre b/tests/cases/passing/tflt.pre index c562e7f..c6fff14 100644 --- a/tests/cases/passing/tflt.pre +++ b/tests/cases/passing/tflt.pre @@ -1,5 +1,5 @@ -TNS: source = [[TRUE, FALSE, 0d7, -0b11, 0d1.75, -0d1.75], ["0d2.5", "-0d3.25", "0d0.5", "INF", "-INF", "NaN"]] -TNS: converted = TFLT(source) +TNS source = [[TRUE, FALSE, 0d7, -0b11, 0d1.75, -0d1.75], ["0d2.5", "-0d3.25", "0d0.5", "INF", "-INF", "NaN"]] +TNS converted = TFLT(source) ASSERT(EQ(TYPE(converted), "TNS")) ASSERT(EQ(converted[0d1], [0d1.0, 0d0.0, 0d7.0, -0d3.0, 0d1.75, -0d1.75])) ASSERT(EQ(converted[0d2, 0d1], 0d2.5)) diff --git a/tests/cases/passing/thaw.pre b/tests/cases/passing/thaw.pre index 9760bf9..e4e824e 100644 --- a/tests/cases/passing/thaw.pre +++ b/tests/cases/passing/thaw.pre @@ -1,4 +1,4 @@ -BOOL: thaw_value = TRUE +BOOL thaw_value = TRUE REFUTE(THAW(thaw_value)) ASSERT(thaw_value) @@ -11,7 +11,7 @@ REFUTE(FROZEN(thaw_value)) thaw_value = FALSE ASSERT(EQ(thaw_value, FALSE)) -BOOL: thaw_undefined_failed = FALSE +BOOL thaw_undefined_failed = FALSE TRY{ THAW(not_declared) } CATCH { diff --git a/tests/cases/passing/throw-concat-message.pre b/tests/cases/passing/throw-concat-message.pre index d07b352..5221780 100644 --- a/tests/cases/passing/throw-concat-message.pre +++ b/tests/cases/passing/throw-concat-message.pre @@ -1,4 +1,4 @@ -BOOL: caught = FALSE +BOOL caught = FALSE TRY{ THROW("left=", 0d42, ",right=", -0b10) diff --git a/tests/cases/passing/throw-control-transfer.pre b/tests/cases/passing/throw-control-transfer.pre index 935f5e7..d297d63 100644 --- a/tests/cases/passing/throw-control-transfer.pre +++ b/tests/cases/passing/throw-control-transfer.pre @@ -1,4 +1,4 @@ -INT: step = 0d0 +INT step = 0d0 TRY{ step = 0d1 diff --git a/tests/cases/passing/throw-default-message.pre b/tests/cases/passing/throw-default-message.pre index 513f237..37772b2 100644 --- a/tests/cases/passing/throw-default-message.pre +++ b/tests/cases/passing/throw-default-message.pre @@ -1,4 +1,4 @@ -BOOL: caught = FALSE +BOOL caught = FALSE TRY{ THROW() diff --git a/tests/cases/passing/throw-empty-message.pre b/tests/cases/passing/throw-empty-message.pre index 6f425ab..fd21e01 100644 --- a/tests/cases/passing/throw-empty-message.pre +++ b/tests/cases/passing/throw-empty-message.pre @@ -1,4 +1,4 @@ -BOOL: caught = FALSE +BOOL caught = FALSE TRY{ THROW('') diff --git a/tests/cases/passing/throw-string-message.pre b/tests/cases/passing/throw-string-message.pre index b66a840..ecf05ad 100644 --- a/tests/cases/passing/throw-string-message.pre +++ b/tests/cases/passing/throw-string-message.pre @@ -1,4 +1,4 @@ -BOOL: caught = FALSE +BOOL caught = FALSE TRY{ THROW('prefix') diff --git a/tests/cases/passing/tint.pre b/tests/cases/passing/tint.pre index ada7abb..7350968 100644 --- a/tests/cases/passing/tint.pre +++ b/tests/cases/passing/tint.pre @@ -1,4 +1,4 @@ -TNS: source = [[TRUE, FALSE, 0d7, -0b11, 0d1.75, -0d1.75], ["0x1A", "-0d9", "", "prefix", "0b101", "0d0"]] -TNS: converted = TINT(source) +TNS source = [[TRUE, FALSE, 0d7, -0b11, 0d1.75, -0d1.75], ["0x1A", "-0d9", "", "prefix", "0b101", "0d0"]] +TNS converted = TINT(source) ASSERT(EQ(TYPE(converted), "TNS")) ASSERT(EQ(converted, [[0d1, 0d0, 0d7, -0d3, 0d1, -0d1], [0d26, -0d9, 0d0, 0d1, 0d5, 0d0]])) \ No newline at end of file diff --git a/tests/cases/passing/tlen.pre b/tests/cases/passing/tlen.pre index 98af089..c75839a 100644 --- a/tests/cases/passing/tlen.pre +++ b/tests/cases/passing/tlen.pre @@ -1,4 +1,4 @@ -TNS: tensor = [[[0d1, 0d2, 0d3]], [[0d4, 0d5, 0d6]]] +TNS tensor = [[[0d1, 0d2, 0d3]], [[0d4, 0d5, 0d6]]] ASSERT(EQ(TLEN(tensor, 0b1), 0d2)) ASSERT(EQ(TLEN(tensor, 0b10), 0d1)) diff --git a/tests/cases/passing/tmul-basic.pre b/tests/cases/passing/tmul-basic.pre index 8f5385c..750aa6e 100644 --- a/tests/cases/passing/tmul-basic.pre +++ b/tests/cases/passing/tmul-basic.pre @@ -1,4 +1,4 @@ -TNS: out = TMUL([0d2, 0d3, 0d4], 0d5) +TNS out = TMUL([0d2, 0d3, 0d4], 0d5) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d10, 0d15, 0d20])) diff --git a/tests/cases/passing/tmul-rank2-shape.pre b/tests/cases/passing/tmul-rank2-shape.pre index 2d5f55e..876d471 100644 --- a/tests/cases/passing/tmul-rank2-shape.pre +++ b/tests/cases/passing/tmul-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d1, 0d2], [0d3, 0d4]] -TNS: out = TMUL(src, 0d6) +TNS src = [[0d1, 0d2], [0d3, 0d4]] +TNS out = TMUL(src, 0d6) ASSERT(EQ(out, [[0d6, 0d12], [0d18, 0d24]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/tns-indexing.pre b/tests/cases/passing/tns-indexing.pre index 9a4f41c..8aefd82 100644 --- a/tests/cases/passing/tns-indexing.pre +++ b/tests/cases/passing/tns-indexing.pre @@ -1,6 +1,6 @@ -TNS: vec = [0d1, 0d2, 0d3] -TNS: matrix = [[0d1, 0d2], [0d3, 0d4]] -TNS: cube = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] +TNS vec = [0d1, 0d2, 0d3] +TNS matrix = [[0d1, 0d2], [0d3, 0d4]] +TNS cube = [[[0d1, 0d2], [0d3, 0d4]], [[0d5, 0d6], [0d7, 0d8]]] ASSERT(EQ(vec[0d1], 0d1)) ASSERT(EQ(vec[0d3], 0d3)) @@ -27,7 +27,7 @@ ASSERT(EQ(matrix[0d1-0d2, 0d1-0d2], matrix)) ASSERT(EQ(matrix[0d1--0d1, 0d1], [0d1, 0d3])) ASSERT(EQ(cube[*, 0d2, 0d1], [0d3, 0d7])) -INT: errors_caught = 0d0 +INT errors_caught = 0d0 TRY { vec[0d4] diff --git a/tests/cases/passing/tns-literals-ifs.pre b/tests/cases/passing/tns-literals-ifs.pre index d9e1faa..47dcb47 100644 --- a/tests/cases/passing/tns-literals-ifs.pre +++ b/tests/cases/passing/tns-literals-ifs.pre @@ -1,5 +1,5 @@ -TNS: zero_row = [0d0, 0d0] -TNS: row = [0d1, 0d2] +TNS zero_row = [0d0, 0d0] +TNS row = [0d1, 0d2] IF([FALSE, 0d0, 0d0.0, "", zero_row]){ ASSERT(FALSE) diff --git a/tests/cases/passing/tns-literals-matrices.pre b/tests/cases/passing/tns-literals-matrices.pre index 46f5c33..d963401 100644 --- a/tests/cases/passing/tns-literals-matrices.pre +++ b/tests/cases/passing/tns-literals-matrices.pre @@ -1,5 +1,5 @@ -TNS: matrix = [[0d1, 0d2], [0d3, 0d4]] -TNS: cube = [[[0d1], [0d2]], [[0d3], [0d4]]] +TNS matrix = [[0d1, 0d2], [0d3, 0d4]] +TNS cube = [[[0d1], [0d2]], [[0d3], [0d4]]] ASSERT(EQ(matrix, [[0d1, 0d2], [0d3, 0d4]])) ASSERT(EQ(matrix[0d1, 0d2], 0d2)) diff --git a/tests/cases/passing/tns-literals-mixed.pre b/tests/cases/passing/tns-literals-mixed.pre index 7ea5fe2..fa2da33 100644 --- a/tests/cases/passing/tns-literals-mixed.pre +++ b/tests/cases/passing/tns-literals-mixed.pre @@ -1,13 +1,13 @@ -FUNC INT: ID(INT: x){ +FUNC INT ID(INT x){ RETURN(x) } -MAP: sample_map = <"n" = 0d5> -TNS: zero_row = [0d0, 0d0] -TNS: row = [0d1, 0d2] +MAP sample_map = <"n" = 0d5> +TNS zero_row = [0d0, 0d0] +TNS row = [0d1, 0d2] THR(worker){} -TNS: mixed = [TRUE, 0d2, 0d3.5, "four", sample_map, ID, worker, row] +TNS mixed = [TRUE, 0d2, 0d3.5, "four", sample_map, ID, worker, row] ASSERT(EQ(mixed[0d1], TRUE)) ASSERT(EQ(mixed[0d2], 0d2)) diff --git a/tests/cases/passing/tns-slice-assign-1d.pre b/tests/cases/passing/tns-slice-assign-1d.pre index 2a3f549..08cb2b4 100644 --- a/tests/cases/passing/tns-slice-assign-1d.pre +++ b/tests/cases/passing/tns-slice-assign-1d.pre @@ -1,4 +1,4 @@ -TNS: vec = [0d1, 0d2, 0d3] +TNS vec = [0d1, 0d2, 0d3] ASSERT(EQ(ASSIGN(vec[0d1-0d2], [0d9, 0d10]), [0d9, 0d10])) ASSERT(EQ(vec, [0d9, 0d10, 0d3])) diff --git a/tests/cases/passing/tns-slice-assign-2d.pre b/tests/cases/passing/tns-slice-assign-2d.pre index 60b3e60..b934ebb 100644 --- a/tests/cases/passing/tns-slice-assign-2d.pre +++ b/tests/cases/passing/tns-slice-assign-2d.pre @@ -1,4 +1,4 @@ -TNS: matrix = [[0d1, 0d2], [0d3, 0d4]] +TNS matrix = [[0d1, 0d2], [0d3, 0d4]] ASSERT(EQ(ASSIGN(matrix[*, 0d2], [0d9, 0d10]), [0d9, 0d10])) ASSERT(EQ(matrix, [[0d1, 0d9], [0d3, 0d10]])) diff --git a/tests/cases/passing/tpow-basic.pre b/tests/cases/passing/tpow-basic.pre index 8812611..735a25d 100644 --- a/tests/cases/passing/tpow-basic.pre +++ b/tests/cases/passing/tpow-basic.pre @@ -1,4 +1,4 @@ -TNS: out = TPOW([0d2, 0d3, 0d4], 0d3) +TNS out = TPOW([0d2, 0d3, 0d4], 0d3) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d8, 0d27, 0d64])) diff --git a/tests/cases/passing/tpow-rank2-shape.pre b/tests/cases/passing/tpow-rank2-shape.pre index 20142ac..b3ea0fe 100644 --- a/tests/cases/passing/tpow-rank2-shape.pre +++ b/tests/cases/passing/tpow-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d1, 0d2], [0d3, 0d4]] -TNS: out = TPOW(src, 0d2) +TNS src = [[0d1, 0d2], [0d3, 0d4]] +TNS out = TPOW(src, 0d2) ASSERT(EQ(out, [[0d1, 0d4], [0d9, 0d16]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/tstr.pre b/tests/cases/passing/tstr.pre index d2034d3..ee5808e 100644 --- a/tests/cases/passing/tstr.pre +++ b/tests/cases/passing/tstr.pre @@ -1,4 +1,4 @@ -TNS: source = [[TRUE, FALSE, 0b101, -0d7, 0d1.5, -0d1.5], ["prefix", "", INF, -INF, NaN, 0x1A]] -TNS: converted = TSTR(source) +TNS source = [[TRUE, FALSE, 0b101, -0d7, 0d1.5, -0d1.5], ["prefix", "", INF, -INF, NaN, 0x1A]] +TNS converted = TSTR(source) ASSERT(EQ(TYPE(converted), "TNS")) ASSERT(EQ(converted, [["TRUE", "FALSE", "0b101", "-0d7", "0d1.5", "-0d1.5"], ["prefix", "", "INF", "-INF", "NaN", "0x1A"]])) \ No newline at end of file diff --git a/tests/cases/passing/tsub-basic.pre b/tests/cases/passing/tsub-basic.pre index f69dd44..cf772b4 100644 --- a/tests/cases/passing/tsub-basic.pre +++ b/tests/cases/passing/tsub-basic.pre @@ -1,4 +1,4 @@ -TNS: out = TSUB([0d9, 0d7, 0d5], 0d2) +TNS out = TSUB([0d9, 0d7, 0d5], 0d2) ASSERT(EQ(TYPE(out), "TNS")) ASSERT(EQ(out, [0d7, 0d5, 0d3])) diff --git a/tests/cases/passing/tsub-rank2-shape.pre b/tests/cases/passing/tsub-rank2-shape.pre index 9d8810b..67016c8 100644 --- a/tests/cases/passing/tsub-rank2-shape.pre +++ b/tests/cases/passing/tsub-rank2-shape.pre @@ -1,5 +1,5 @@ -TNS: src = [[0d8, 0d7], [0d6, 0d5]] -TNS: out = TSUB(src, 0d3) +TNS src = [[0d8, 0d7], [0d6, 0d5]] +TNS out = TSUB(src, 0d3) ASSERT(EQ(out, [[0d5, 0d4], [0d3, 0d2]])) ASSERT(EQ(SHAPE(out), [0d2, 0d2])) diff --git a/tests/cases/passing/type-then-decl-type.pre b/tests/cases/passing/type-then-decl-type.pre index aa5d2da..58dfe44 100644 --- a/tests/cases/passing/type-then-decl-type.pre +++ b/tests/cases/passing/type-then-decl-type.pre @@ -1,2 +1,2 @@ -BOOL: x -BOOL: x = TRUE +BOOL x +BOOL x = TRUE diff --git a/tests/cases/passing/type-then-decl.pre b/tests/cases/passing/type-then-decl.pre index c0f4e53..945f9f7 100644 --- a/tests/cases/passing/type-then-decl.pre +++ b/tests/cases/passing/type-then-decl.pre @@ -1,2 +1,2 @@ -BOOL: x +BOOL x x = TRUE diff --git a/tests/cases/passing/type.pre b/tests/cases/passing/type.pre index df11345..cfa0f84 100644 --- a/tests/cases/passing/type.pre +++ b/tests/cases/passing/type.pre @@ -1,11 +1,11 @@ -BOOL: sample_bool = TRUE -INT: sample_int = 0d1 -FLT: sample_flt = 0d1.5 -STR: sample_str = "prefix" -TNS: sample_tns = [0d1, 0d2] -MAP: sample_map = <"n" = 0d1> +BOOL sample_bool = TRUE +INT sample_int = 0d1 +FLT sample_flt = 0d1.5 +STR sample_str = "prefix" +TNS sample_tns = [0d1, 0d2] +MAP sample_map = <"n" = 0d1> -FUNC INT: sample_func(){ +FUNC INT sample_func(){ RETURN(0d1) } diff --git a/tests/cases/passing/unser-errors-json.pre b/tests/cases/passing/unser-errors-json.pre index f23a895..d84661b 100644 --- a/tests/cases/passing/unser-errors-json.pre +++ b/tests/cases/passing/unser-errors-json.pre @@ -1,4 +1,4 @@ -INT: errors = 0d0 +INT errors = 0d0 TRY{ UNSER("{") diff --git a/tests/cases/passing/unser-errors-numeric.pre b/tests/cases/passing/unser-errors-numeric.pre index 39c5c3d..73c9706 100644 --- a/tests/cases/passing/unser-errors-numeric.pre +++ b/tests/cases/passing/unser-errors-numeric.pre @@ -1,4 +1,4 @@ -INT: errors = 0d0 +INT errors = 0d0 TRY{ UNSER('\R{"t":"INT","v":"12"}') diff --git a/tests/cases/passing/unser-errors-structure.pre b/tests/cases/passing/unser-errors-structure.pre index 64cb3cb..678a906 100644 --- a/tests/cases/passing/unser-errors-structure.pre +++ b/tests/cases/passing/unser-errors-structure.pre @@ -1,4 +1,4 @@ -INT: errors = 0d0 +INT errors = 0d0 TRY{ UNSER('\R{"t":"TNS","shape":[0],"v":[]}') diff --git a/tests/cases/passing/unser-func-closure.pre b/tests/cases/passing/unser-func-closure.pre index 1851356..1dff26a 100644 --- a/tests/cases/passing/unser-func-closure.pre +++ b/tests/cases/passing/unser-func-closure.pre @@ -1,6 +1,6 @@ -STR: loc = '\R{"file":"","line":1,"column":1,"statement":""}' +STR loc = '\R{"file":"","line":1,"column":1,"statement":""}' -STR: json = JOIN( ^ +STR json = JOIN( ^ '\R{"t":"FUNC","id":"f1","name":"read_alias","return":"INT","params":[],"def":{"name":"read_alias","return":"INT","params":[],"body":{"n":"Block","loc":', ^ loc, ^ '\R,"statements":[{"n":"ReturnStatement","loc":', ^ @@ -10,6 +10,6 @@ STR: json = JOIN( ^ '\R,"name":"alias"}}]},"closure":{"t":"ENV","id":"e1","def":{"values":{"seed":{"t":"INT","v":"0d9"},"alias":{"t":"PTR","name":"seed","env":{"t":"ENV","id":"e1","ref":true},"value_type":"INT"}},"declared":{"seed":"INT","alias":"INT"},"frozen":[],"permafrozen":[],"parent":null}}}}' ^ ) -FUNC: reader = UNSER(json) +FUNC reader = UNSER(json) ASSERT(EQ(TYPE(reader), "FUNC")) ASSERT(EQ(reader(), 0d9)) \ No newline at end of file diff --git a/tests/cases/passing/unser-func-params.pre b/tests/cases/passing/unser-func-params.pre index ff729a1..7aa5f87 100644 --- a/tests/cases/passing/unser-func-params.pre +++ b/tests/cases/passing/unser-func-params.pre @@ -1,18 +1,18 @@ -STR: loc = '\R{"file":"","line":1,"column":1,"statement":""}' +STR loc = '\R{"file":"","line":1,"column":1,"statement":""}' -STR: step_default = JOIN( ^ +STR step_default = JOIN( ^ '\R{"n":"Literal","loc":', ^ loc, ^ '\R,"value":2,"base":10,"literal_type":"INT"}' ^ ) -STR: params = JOIN( ^ +STR params = JOIN( ^ '\R[{"name":"value","type":"INT","coerced":true,"default":null},{"name":"step","type":"INT","coerced":false,"default":', ^ step_default, ^ '\R}]' ^ ) -STR: json = JOIN( ^ +STR json = JOIN( ^ '\R{"t":"FUNC","id":"f1","name":"add_default","return":"INT","params":', ^ params, ^ '\R,"def":{"name":"add_default","return":"INT","params":', ^ @@ -32,6 +32,6 @@ STR: json = JOIN( ^ '\R,"name":"step"}}]}}]},"closure":null}}' ^ ) -FUNC: add_default = UNSER(json) +FUNC add_default = UNSER(json) ASSERT(EQ(add_default("0d3"), 0d5)) ASSERT(EQ(add_default("0d3", step = 0d4), 0d7)) \ No newline at end of file diff --git a/tests/cases/passing/unser-func-ref.pre b/tests/cases/passing/unser-func-ref.pre index 79fd368..640bd69 100644 --- a/tests/cases/passing/unser-func-ref.pre +++ b/tests/cases/passing/unser-func-ref.pre @@ -1,6 +1,6 @@ -STR: loc = '\R{"file":"","line":1,"column":1,"statement":""}' +STR loc = '\R{"file":"","line":1,"column":1,"statement":""}' -STR: full = JOIN( ^ +STR full = JOIN( ^ '\R{"t":"FUNC","id":"f1","name":"five","return":"INT","params":[],"def":{"name":"five","return":"INT","params":[],"body":{"n":"Block","loc":', ^ loc, ^ '\R,"statements":[{"n":"ReturnStatement","loc":', ^ @@ -10,13 +10,13 @@ STR: full = JOIN( ^ '\R,"value":5,"base":10,"literal_type":"INT"}}]},"closure":null}}' ^ ) -STR: json = JOIN( ^ +STR json = JOIN( ^ '\R{"t":"MAP","v":[{"k":{"t":"STR","v":"first"},"v":', ^ full, ^ '\R},{"k":{"t":"STR","v":"second"},"v":{"t":"FUNC","id":"f1","ref":true}}]}' ^ ) -MAP: funcs = UNSER(json) +MAP funcs = UNSER(json) ASSERT(EQ(funcs<"first">, funcs<"second">)) ASSERT(EQ(funcs<"first">(), 0d5)) ASSERT(EQ(funcs<"second">(), 0d5)) \ No newline at end of file diff --git a/tests/cases/passing/unser-func.pre b/tests/cases/passing/unser-func.pre index 70174ce..0bc1fbd 100644 --- a/tests/cases/passing/unser-func.pre +++ b/tests/cases/passing/unser-func.pre @@ -1,6 +1,6 @@ -STR: loc = '\R{"file":"","line":1,"column":1,"statement":""}' +STR loc = '\R{"file":"","line":1,"column":1,"statement":""}' -STR: json = JOIN( ^ +STR json = JOIN( ^ '\R{"t":"FUNC","id":"f1","name":"double","return":"INT","params":[{"name":"value","type":"INT","coerced":false,"default":null}],"def":{"name":"double","return":"INT","params":[{"name":"value","type":"INT","coerced":false,"default":null}],"body":{"n":"Block","loc":', ^ loc, ^ '\R,"statements":[{"n":"ReturnStatement","loc":', ^ @@ -16,6 +16,6 @@ STR: json = JOIN( ^ '\R,"name":"value"}}]}}]},"closure":null}}' ^ ) -FUNC: double = UNSER(json) +FUNC double = UNSER(json) ASSERT(EQ(TYPE(double), "FUNC")) ASSERT(EQ(double(0d3), 0d6)) \ No newline at end of file diff --git a/tests/cases/passing/unser-map.pre b/tests/cases/passing/unser-map.pre index 3f5ff24..069b2e0 100644 --- a/tests/cases/passing/unser-map.pre +++ b/tests/cases/passing/unser-map.pre @@ -1,4 +1,4 @@ -MAP: value = UNSER('\R{"t":"MAP","v":[{"k":{"t":"STR","v":"alpha"},"v":{"t":"INT","v":"0d1"}},{"k":{"t":"INT","v":"0d2"},"v":{"t":"STR","v":"two"}},{"k":{"t":"FLT","v":"0d3.5"},"v":{"t":"MAP","v":[{"k":{"t":"STR","v":"nested"},"v":{"t":"BOOL","v":true}}]}}]}') +MAP value = UNSER('\R{"t":"MAP","v":[{"k":{"t":"STR","v":"alpha"},"v":{"t":"INT","v":"0d1"}},{"k":{"t":"INT","v":"0d2"},"v":{"t":"STR","v":"two"}},{"k":{"t":"FLT","v":"0d3.5"},"v":{"t":"MAP","v":[{"k":{"t":"STR","v":"nested"},"v":{"t":"BOOL","v":true}}]}}]}') ASSERT(EQ(value<"alpha">, 0d1)) ASSERT(EQ(value<0d2>, "two")) diff --git a/tests/cases/passing/unser-scalars.pre b/tests/cases/passing/unser-scalars.pre index 155bd59..731b775 100644 --- a/tests/cases/passing/unser-scalars.pre +++ b/tests/cases/passing/unser-scalars.pre @@ -1,6 +1,6 @@ ASSERT(EQ(UNSER('\R{"t":"BOOL","v":true}'), TRUE)) -STR: spaced_false = JOIN("\n ", '\R{"t":"BOOL","v":false}', "\r\t") +STR spaced_false = JOIN("\n ", '\R{"t":"BOOL","v":false}', "\r\t") ASSERT(EQ(UNSER(spaced_false), FALSE)) ASSERT(EQ(UNSER('\R{"t":"INT","v":"-0xA"}'), -0xA)) diff --git a/tests/cases/passing/unser-tensor.pre b/tests/cases/passing/unser-tensor.pre index b6fa4b4..49b4495 100644 --- a/tests/cases/passing/unser-tensor.pre +++ b/tests/cases/passing/unser-tensor.pre @@ -1,7 +1,7 @@ -TNS: tensor = UNSER('\R{"t":"TNS","shape":[2,2],"v":[{"t":"INT","v":"0d1"},{"t":"INT","v":"0d2"},{"t":"INT","v":"0d3"},{"t":"INT","v":"0d4"}]}') +TNS tensor = UNSER('\R{"t":"TNS","shape":[2,2],"v":[{"t":"INT","v":"0d1"},{"t":"INT","v":"0d2"},{"t":"INT","v":"0d3"},{"t":"INT","v":"0d4"}]}') ASSERT(EQ(tensor, [[0d1, 0d2], [0d3, 0d4]])) ASSERT(EQ(SHAPE(tensor), [0d2, 0d2])) -TNS: mixed = UNSER('\R{"t":"TNS","shape":[3],"v":[{"t":"BOOL","v":true},{"t":"STR","v":"two"},{"t":"FLT","v":"0d3.5"}]}') +TNS mixed = UNSER('\R{"t":"TNS","shape":[3],"v":[{"t":"BOOL","v":true},{"t":"STR","v":"two"},{"t":"FLT","v":"0d3.5"}]}') ASSERT(EQ(mixed, [TRUE, "two", 0d3.5])) \ No newline at end of file diff --git a/tests/cases/passing/unser-thr-ref.pre b/tests/cases/passing/unser-thr-ref.pre index 0567711..72e3bff 100644 --- a/tests/cases/passing/unser-thr-ref.pre +++ b/tests/cases/passing/unser-thr-ref.pre @@ -1,6 +1,6 @@ -STR: thread_json = '\R{"t":"THR","id":"t1","state":"finished","paused":false,"finished":true,"stop":false,"env":null,"block":null}' +STR thread_json = '\R{"t":"THR","id":"t1","state":"finished","paused":false,"finished":true,"stop":false,"env":null,"block":null}' -STR: json = JOIN( ^ +STR json = JOIN( ^ '\R{"t":"MAP","v":[{"k":{"t":"STR","v":"first"},"v":', ^ thread_json, ^ '\R},{"k":{"t":"STR","v":"second"},"v":', ^ @@ -8,6 +8,6 @@ STR: json = JOIN( ^ '\R}]}' ^ ) -MAP: threads = UNSER(json) +MAP threads = UNSER(json) ASSERT(EQ(threads<"first">, threads<"second">)) REFUTE(BOOL(threads<"first">)) \ No newline at end of file diff --git a/tests/cases/passing/unser-thr.pre b/tests/cases/passing/unser-thr.pre index dffb493..f2278b0 100644 --- a/tests/cases/passing/unser-thr.pre +++ b/tests/cases/passing/unser-thr.pre @@ -1,9 +1,9 @@ -THR: finished = UNSER('\R{"t":"THR","id":"t1","state":"finished","paused":false,"finished":true,"stop":false,"env":null,"block":null}') +THR finished = UNSER('\R{"t":"THR","id":"t1","state":"finished","paused":false,"finished":true,"stop":false,"env":null,"block":null}') ASSERT(EQ(TYPE(finished), "THR")) REFUTE(BOOL(finished)) ASSERT(EQ(AWAIT(finished), finished)) -THR: paused = UNSER('\R{"t":"THR","id":"t2","state":"paused","paused":true,"finished":false,"stop":false,"env":null,"block":null}') +THR paused = UNSER('\R{"t":"THR","id":"t2","state":"paused","paused":true,"finished":false,"stop":false,"env":null,"block":null}') ASSERT(PAUSED(paused)) ASSERT(BOOL(paused)) \ No newline at end of file diff --git a/tests/cases/passing/valuein-any-type.pre b/tests/cases/passing/valuein-any-type.pre index 55658b4..b1dd4b6 100644 --- a/tests/cases/passing/valuein-any-type.pre +++ b/tests/cases/passing/valuein-any-type.pre @@ -1,8 +1,8 @@ -MAP: bool_map = <"t" = TRUE, "f" = FALSE> -MAP: int_map = <"i" = 0d7> -MAP: flt_map = <"p" = 0d2.5> -MAP: str_map = <"s" = "text"> -MAP: tns_map = <"vec" = [0d1, 0d2]> +MAP bool_map = <"t" = TRUE, "f" = FALSE> +MAP int_map = <"i" = 0d7> +MAP flt_map = <"p" = 0d2.5> +MAP str_map = <"s" = "text"> +MAP tns_map = <"vec" = [0d1, 0d2]> ASSERT(VALUEIN(TRUE, bool_map)) ASSERT(VALUEIN(0d7, int_map)) diff --git a/tests/cases/passing/valuein-basic.pre b/tests/cases/passing/valuein-basic.pre index 338e92a..3a908a1 100644 --- a/tests/cases/passing/valuein-basic.pre +++ b/tests/cases/passing/valuein-basic.pre @@ -1,4 +1,4 @@ -MAP: m = <"x" = "cat", "y" = "dog"> +MAP m = <"x" = "cat", "y" = "dog"> ASSERT(VALUEIN("cat", m)) REFUTE(VALUEIN("bird", m)) diff --git a/tests/cases/passing/values-insertion-order.pre b/tests/cases/passing/values-insertion-order.pre index bf89e82..1619c0d 100644 --- a/tests/cases/passing/values-insertion-order.pre +++ b/tests/cases/passing/values-insertion-order.pre @@ -1,3 +1,3 @@ -MAP: m = <"alpha" = "first", "beta" = "second", "gamma" = "third"> +MAP m = <"alpha" = "first", "beta" = "second", "gamma" = "third"> ASSERT(EQ(VALUES(m), ["first", "second", "third"])) diff --git a/tests/cases/passing/values-result-is-1d.pre b/tests/cases/passing/values-result-is-1d.pre index 4c36cb7..d1eb5ab 100644 --- a/tests/cases/passing/values-result-is-1d.pre +++ b/tests/cases/passing/values-result-is-1d.pre @@ -1,3 +1,3 @@ -MAP: m = <0d1 = 0d10, 0d2 = 0d20, 0d3 = 0d30> +MAP m = <0d1 = 0d10, 0d2 = 0d20, 0d3 = 0d30> ASSERT(EQ(VALUES(m), [0d10, 0d20, 0d30])) diff --git a/tests/cases/passing/while.pre b/tests/cases/passing/while.pre index 706c143..066c217 100644 --- a/tests/cases/passing/while.pre +++ b/tests/cases/passing/while.pre @@ -1,4 +1,4 @@ -INT: c = 0d0 +INT c = 0d0 WHILE(LT(c, 0d10)){ ADD(@c, 0d1) } diff --git a/tests/cases/passing/whitespace.pre b/tests/cases/passing/whitespace.pre index 9e10b3e..3305b22 100644 --- a/tests/cases/passing/whitespace.pre +++ b/tests/cases/passing/whitespace.pre @@ -1,7 +1,7 @@ -BOOL : x = TRUE -BOOL: x = TRUE -BOOL :x = TRUE -BOOL:x = TRUE -BOOL: x= TRUE -BOOL: x =TRUE -BOOL: x=TRUE +BOOL x = TRUE +BOOL x = TRUE +BOOL x = TRUE +BOOL x = TRUE +BOOL x= TRUE +BOOL x =TRUE +BOOL x=TRUE diff --git a/tests/cases/passing/writefile-ansi.pre b/tests/cases/passing/writefile-ansi.pre index 0b605d8..07e81dc 100644 --- a/tests/cases/passing/writefile-ansi.pre +++ b/tests/cases/passing/writefile-ansi.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-ansi.txt") +STR p = path.TEMPFILE("prefix-writefile-ansi.txt") ASSERT(WRITEFILE("Prefix", p, coding = "ANSI")) ASSERT(EQ(READFILE(p, coding = "ANSI"), "Prefix")) diff --git a/tests/cases/passing/writefile-bin-alias.pre b/tests/cases/passing/writefile-bin-alias.pre index 876445b..58788f6 100644 --- a/tests/cases/passing/writefile-bin-alias.pre +++ b/tests/cases/passing/writefile-bin-alias.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-bin.bin") +STR p = path.TEMPFILE("prefix-writefile-bin.bin") ASSERT(WRITEFILE("0100000101111010", p, coding = "bin")) ASSERT(EQ(READFILE(p, coding = "bin"), "0100000101111010")) diff --git a/tests/cases/passing/writefile-binary.pre b/tests/cases/passing/writefile-binary.pre index c283550..7ca7833 100644 --- a/tests/cases/passing/writefile-binary.pre +++ b/tests/cases/passing/writefile-binary.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-binary.bin") +STR p = path.TEMPFILE("prefix-writefile-binary.bin") ASSERT(WRITEFILE("0100000101111010", p, coding = "binary")) ASSERT(EQ(READFILE(p, coding = "binary"), "0100000101111010")) diff --git a/tests/cases/passing/writefile-fail-dir.pre b/tests/cases/passing/writefile-fail-dir.pre index 04533d7..4df9799 100644 --- a/tests/cases/passing/writefile-fail-dir.pre +++ b/tests/cases/passing/writefile-fail-dir.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: d = path.TEMPFILE("prefix-writefile-fail-dir") +STR d = path.TEMPFILE("prefix-writefile-fail-dir") IF(EQ(OS(),"win")){ ASSERT(EQ(CL(JOIN("powershell -NoProfile -NonInteractive -Command \"New-Item -ItemType Directory -Force -Path '", path.WINPATH(d), "'\"")), 0d0)) diff --git a/tests/cases/passing/writefile-hex.pre b/tests/cases/passing/writefile-hex.pre index 093483e..8294689 100644 --- a/tests/cases/passing/writefile-hex.pre +++ b/tests/cases/passing/writefile-hex.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-hex.bin") +STR p = path.TEMPFILE("prefix-writefile-hex.bin") ASSERT(WRITEFILE("507265666978", p, coding = "hex")) ASSERT(EQ(READFILE(p), "Prefix")) diff --git a/tests/cases/passing/writefile-utf16-be.pre b/tests/cases/passing/writefile-utf16-be.pre index 4ad5526..6b42ae3 100644 --- a/tests/cases/passing/writefile-utf16-be.pre +++ b/tests/cases/passing/writefile-utf16-be.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-utf16-be.txt") +STR p = path.TEMPFILE("prefix-writefile-utf16-be.txt") ASSERT(WRITEFILE("Prefix", p, coding = "UTF-16 BE")) ASSERT(EQ(READFILE(p, coding = "UTF-16 BE"), "Prefix")) diff --git a/tests/cases/passing/writefile-utf16-le.pre b/tests/cases/passing/writefile-utf16-le.pre index 935a967..c36a58a 100644 --- a/tests/cases/passing/writefile-utf16-le.pre +++ b/tests/cases/passing/writefile-utf16-le.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-utf16-le.txt") +STR p = path.TEMPFILE("prefix-writefile-utf16-le.txt") ASSERT(WRITEFILE("Prefix", p, coding = "UTF-16 LE")) ASSERT(EQ(READFILE(p, coding = "UTF-16 LE"), "Prefix")) diff --git a/tests/cases/passing/writefile-utf8-bom.pre b/tests/cases/passing/writefile-utf8-bom.pre index 75495dc..532247c 100644 --- a/tests/cases/passing/writefile-utf8-bom.pre +++ b/tests/cases/passing/writefile-utf8-bom.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-utf8-bom.txt") +STR p = path.TEMPFILE("prefix-writefile-utf8-bom.txt") ASSERT(WRITEFILE("Prefix", p, coding = "UTF-8 BOM")) ASSERT(EQ(READFILE(p), "Prefix")) diff --git a/tests/cases/passing/writefile-utf8.pre b/tests/cases/passing/writefile-utf8.pre index 41d7e68..e162ea9 100644 --- a/tests/cases/passing/writefile-utf8.pre +++ b/tests/cases/passing/writefile-utf8.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: p = path.TEMPFILE("prefix-writefile-utf8.txt") +STR p = path.TEMPFILE("prefix-writefile-utf8.txt") ASSERT(WRITEFILE("Prefix", p)) ASSERT(EQ(READFILE(p), "Prefix")) diff --git a/tests/cases/passing/zero-and-one-in-ident.pre b/tests/cases/passing/zero-and-one-in-ident.pre index fcade79..2847771 100644 --- a/tests/cases/passing/zero-and-one-in-ident.pre +++ b/tests/cases/passing/zero-and-one-in-ident.pre @@ -1,2 +1,2 @@ -BOOL: x0 = TRUE -BOOL: x1 = FALSE +BOOL x0 = TRUE +BOOL x1 = FALSE diff --git a/tests/helpers/export_target.pre b/tests/helpers/export_target.pre index 747ce4a..40c35dd 100644 --- a/tests/helpers/export_target.pre +++ b/tests/helpers/export_target.pre @@ -1,15 +1,15 @@ -FUNC INT: read_box_value(){ +FUNC INT read_box_value(){ RETURN(box<"value">) } -FUNC BOOL: set_box_value(INT: value){ +FUNC BOOL set_box_value(INT value){ box<"value"> = value } -FUNC INT: read_tensor_first(){ +FUNC INT read_tensor_first(){ RETURN(tensor[0d1]) } -FUNC BOOL: set_tensor_first(INT: value){ +FUNC BOOL set_tensor_first(INT value){ tensor[0d1] = value } \ No newline at end of file diff --git a/tests/helpers/extend_core_once.pre b/tests/helpers/extend_core_once.pre index fffe700..439c463 100644 --- a/tests/helpers/extend_core_once.pre +++ b/tests/helpers/extend_core_once.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(extend_core) \ No newline at end of file +BOOL extend_result = EXTEND(extend_core) \ No newline at end of file diff --git a/tests/helpers/extend_core_twice.pre b/tests/helpers/extend_core_twice.pre index 616c739..c92ec38 100644 --- a/tests/helpers/extend_core_twice.pre +++ b/tests/helpers/extend_core_twice.pre @@ -1,2 +1,2 @@ -BOOL: first_result = EXTEND(extend_core) -BOOL: second_result = EXTEND(extend_core) \ No newline at end of file +BOOL first_result = EXTEND(extend_core) +BOOL second_result = EXTEND(extend_core) \ No newline at end of file diff --git a/tests/helpers/extend_missing_init_loader.pre b/tests/helpers/extend_missing_init_loader.pre index 8774708..1c742ce 100644 --- a/tests/helpers/extend_missing_init_loader.pre +++ b/tests/helpers/extend_missing_init_loader.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(extend_missing_init) \ No newline at end of file +BOOL extend_result = EXTEND(extend_missing_init) \ No newline at end of file diff --git a/tests/helpers/extend_missing_package_loader.pre b/tests/helpers/extend_missing_package_loader.pre index bc9d572..efbe373 100644 --- a/tests/helpers/extend_missing_package_loader.pre +++ b/tests/helpers/extend_missing_package_loader.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(exttree) \ No newline at end of file +BOOL extend_result = EXTEND(exttree) \ No newline at end of file diff --git a/tests/helpers/extend_package_loader.pre b/tests/helpers/extend_package_loader.pre index 077132b..b2882ba 100644 --- a/tests/helpers/extend_package_loader.pre +++ b/tests/helpers/extend_package_loader.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(extend_package) \ No newline at end of file +BOOL extend_result = EXTEND(extend_package) \ No newline at end of file diff --git a/tests/helpers/extend_prex_loader.pre b/tests/helpers/extend_prex_loader.pre index 5a468cc..e93086c 100644 --- a/tests/helpers/extend_prex_loader.pre +++ b/tests/helpers/extend_prex_loader.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(extend_prex_only) \ No newline at end of file +BOOL extend_result = EXTEND(extend_prex_only) \ No newline at end of file diff --git a/tests/helpers/extend_submodule_loader.pre b/tests/helpers/extend_submodule_loader.pre index d43794a..fc4dfb3 100644 --- a/tests/helpers/extend_submodule_loader.pre +++ b/tests/helpers/extend_submodule_loader.pre @@ -1 +1 @@ -BOOL: extend_result = EXTEND(extpackage..submod) \ No newline at end of file +BOOL extend_result = EXTEND(extpackage..submod) \ No newline at end of file diff --git a/tests/helpers/import_path_basic_target.pre b/tests/helpers/import_path_basic_target.pre index a88cda3..0cfacff 100644 --- a/tests/helpers/import_path_basic_target.pre +++ b/tests/helpers/import_path_basic_target.pre @@ -1,3 +1,3 @@ -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("basic") } \ No newline at end of file diff --git a/tests/helpers/import_path_cache_target.pre b/tests/helpers/import_path_cache_target.pre index f03c671..908096a 100644 --- a/tests/helpers/import_path_cache_target.pre +++ b/tests/helpers/import_path_cache_target.pre @@ -1,6 +1,6 @@ IMPORT(path) -STR: marker = path.TEMPFILE("prefix-import-path-cache-target.txt") +STR marker = path.TEMPFILE("prefix-import-path-cache-target.txt") IF(EXISTFILE(marker)){ WRITEFILE("reloaded", marker) @@ -8,6 +8,6 @@ IF(EXISTFILE(marker)){ WRITEFILE("loaded", marker) } -FUNC STR: marker_text(){ +FUNC STR marker_text(){ RETURN(READFILE(marker)) } \ No newline at end of file diff --git a/tests/helpers/import_path_hidden_target.pre b/tests/helpers/import_path_hidden_target.pre index 7f46931..fcbfe79 100644 --- a/tests/helpers/import_path_hidden_target.pre +++ b/tests/helpers/import_path_hidden_target.pre @@ -1 +1 @@ -INT: hidden = 0d7 \ No newline at end of file +INT hidden = 0d7 \ No newline at end of file diff --git a/tests/helpers/import_path_isolated_target.pre b/tests/helpers/import_path_isolated_target.pre index 32ca2d4..99c3f68 100644 --- a/tests/helpers/import_path_isolated_target.pre +++ b/tests/helpers/import_path_isolated_target.pre @@ -1,5 +1,5 @@ -INT: shared = 0d7 +INT shared = 0d7 -FUNC INT: read_shared(){ +FUNC INT read_shared(){ RETURN(shared) } \ No newline at end of file diff --git a/tests/helpers/import_path_prex_target.pre b/tests/helpers/import_path_prex_target.pre index 9512936..4fc909a 100644 --- a/tests/helpers/import_path_prex_target.pre +++ b/tests/helpers/import_path_prex_target.pre @@ -1,3 +1,3 @@ -FUNC STR: identify(){ +FUNC STR identify(){ RETURN("source") } \ No newline at end of file