diff --git a/test.sh b/test.sh index 3f6f5a9..9c3652e 100755 --- a/test.sh +++ b/test.sh @@ -20,147 +20,110 @@ LIGHTCYAN='\033[1;36m' WHITE='\033[1;37m' if [ ! -f "./alpha" ]; then - echo -e "${RED}[ERROR] ${YELLOW}File ./alpha not found!${WHITE}" - exit 1 + echo -e "${RED}[ALERT] ${YELLOW}File ./alpha not found! Generating with 'make'.${WHITE}" + make fi if [ ! -d "./out" ]; then mkdir -p out fi -SWITCH=${YELLOW} -count=0 +if [ $# -eq 0 ]; then + help +fi -switchfunc() { - if [ $count -eq 0 ]; then - count=1 - SWITCH=${YELLOW} - else - count=0 - SWITCH='\033[0;35m' - fi +help() { + echo -e "${GREEN}[HELP] ${YELLOW}Usage: ./test.sh [-exp] ${WHITE}" + echo -e "${GREEN}[HELP] ${YELLOW}To all tests in a folder: ./test/sh /* [-exp]${WHITE}" + exit 1 } -if [ $# -eq 0 ]; then - echo -e "${YELLOW}[INFO] ${WHITE}Running all tests...${WHITE}" - echo -e "${YELLOW}[INFO] ${ORANGE}Testing SPRINT-1 ---------------------------\n${WHITE}" - for file in ./tests/sprint1/test/*; do - if [ -f "$file" ]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - echo -e "" +run() { + filename=$(basename -- "$1") + first_line=$(head -n 1 "$1") + if [[ "$first_line" == "\$\$ TEST: ["*"]"* ]]; then + if [ -n "$2" ]; then + if [[ "$2" == "-exp" ]]; then + bracket_content=$(echo "$first_line" | sed -n 's/.*\[\(.*\)\].*/\1/p') + sed -i '1d' "$1" + ./alpha ${bracket_content} "$1" + sed -i "1s/^/$first_line\n/" "$1" + path=$(dirname "$1") + filename_noext=${filename:0:${#filename}-6} - echo -e "${YELLOW}[INFO] ${ORANGE}Testing SPRINT-2 ---------------------------\n${WHITE}" - for file in ./tests/sprint2/test/*; do - if [ -f "$file" ]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - echo -e "" + for file in out/${filename_noext}.*; do + if [[ "$file" == *".asc" || "$file" == *".s" || "$file" == *".st" || "$file" == *".tok" || "$file" == *".ir" ]]; then + for_filename=$(basename -- "$file") + for_filename="${for_filename}.exp" + if [ -f "${path}/../expected/${for_filename}" ]; then + echo -e "${RED}[ALERT] ${YELLOW}File ${path}/../expected/${for_filename} already exists! Overwriting...${WHITE}" + fi + cp "$file" "${path}/../expected/${for_filename}" + else + echo -e "${RED}[ALERT] ${YELLOW}Unexpected file found: $file ${WHITE}" + fi + done + else + echo -e "${BLUE}[ERROR] ${YELLOW}Invalid argument $2!${WHITE}" + help + fi + fi - echo -e "${YELLOW}[INFO] ${ORANGE}Testing SPRINT-3 ---------------------------\n${WHITE}" - for file in ./tests/sprint3/test/*; do - if [ -f "$file" ]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - echo -e "" + bracket_content=$(echo "$first_line" | sed -n 's/.*\[\(.*\)\].*/\1/p') + sed -i '1d' "$1" + ./alpha ${bracket_content} "$1" + sed -i "1s/^/$first_line\n/" "$1" + else + echo -e "${RED}[ERROR] ${YELLOW}File $1 is not a valid .alpha test file!${WHITE}" + help + fi +} - echo -e "${YELLOW}[INFO] ${ORANGE}Testing SPRINT-4 ---------------------------\n${WHITE}" - for file in ./tests/sprint4/test/*; do - if [ -f "$file" ]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -cg "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n${WHITE}" - switchfunc - fi - done -else - if [ "$1" == "--help" ]; then - echo -e "${YELLOW}[INFO] ${WHITE}Usage: ./test.sh [prefix]" - echo -e "${YELLOW}[INFO] ${WHITE}--help: show this help message" - echo -e "${YELLOW}[INFO] ${WHITE}--file : run test with file" - exit 0 - fi - if [[ "$1" == "--file" ]]; then - shift - if [ $# -eq 0 ]; then - echo -e "${RED}[ERROR] ${YELLOW}No file specified!${WHITE}" - exit 1 - fi - if [ -f "$1" ]; then - filename=$(basename -- "$1") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$1" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}" - exit 1 - else - echo -e "${RED}[ERROR] ${YELLOW}File $1 not found!${WHITE}" - exit 1 - fi - fi - if [[ "$1" == "sp1" ]]; then - echo -e "${YELLOW}[INFO] ${WHITE}Running tests with prefix $1..." - for file in ./tests/sprint1/test/*; do - if [[ "$file" == *"$1"* ]]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - elif [[ "$1" == "sp2" ]]; then - echo -e "${YELLOW}[INFO] ${WHITE}Running tests with prefix $1..." - for file in ./tests/sprint2/test/*; do - if [[ "$file" == *"$1"* ]]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - elif [[ "$1" == "sp3" ]]; then - echo -e "${YELLOW}[INFO] ${WHITE}Running tests with prefix $1..." - for file in ./tests/sprint3/test/*; do - if [[ "$file" == *"$1"* ]]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -st -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - elif [[ "$1" == "sp4" ]]; then - echo -e "${YELLOW}[INFO] ${WHITE}Running tests with prefix $1..." - for file in ./tests/sprint4/test/*; do - if [[ "$file" == *"$1"* ]]; then - filename=$(basename -- "$file") - echo -e "- ${SWITCH}Running test: ${LIGHTBLUE}$filename ${SWITCH}-----${WHITE}" - ./alpha -cg -debug "$file" - echo -e "${SWITCH}----- End of test: ${LIGHTBLUE}$filename ${SWITCH}-${WHITE}\n" - switchfunc - fi - done - else - echo -e "${RED}[ERROR] ${YELLOW}Invalid prefix $1!${WHITE}" - exit 1 - fi +if [[ "$1" == *"/" ]]; then + if [ -n $2 ]; then + for file in "$1"/*; do + if [[ "$file" == *.alpha ]]; then + if [[ "$2" == "-exp" ]]; then + run "$file" "$2" + else + echo -e "${RED}[ERROR] ${YELLOW}Invalid argument $2!${WHITE}" + help + fi + else + echo -e "${RED}[ERROR] ${YELLOW}File $file is not a .alpha file!${WHITE}" + help + fi + done + else + for file in "$1"/*; do + if [[ "$file" == *.alpha ]]; then + run "$file" + else + echo -e "${RED}[ERROR] ${YELLOW}File $file is not a .alpha file!${WHITE}" + help + fi + done + + fi + exit 0 +fi + +if [ -f "$1" ]; then + if [[ "$1" == *.alpha ]]; then + if [ -n "$2" ]; then + if [[ "$2" == "-exp" ]]; then + run "$1" "$2" + else + echo -e "${RED}[ERROR] ${YELLOW}Invalid argument $2!${WHITE}" + help + fi + else + run "$1" + fi + else + echo -e "${RED}[ERROR] ${YELLOW}File $1 is not a .alpha file!${WHITE}" + help + fi fi diff --git a/tests/carl/Errors/entry.undeclaredType.alpha b/tests/carl/Errors/entry.undeclaredType.alpha deleted file mode 100644 index 6b9531f..0000000 --- a/tests/carl/Errors/entry.undeclaredType.alpha +++ /dev/null @@ -1,10 +0,0 @@ -type M : string -> integer - -function foo : M - -foo (s) := { - [ - int: x - ] - return 0; -} diff --git a/tests/carl/Errors/entry.undeclaredType.alpha.asc b/tests/carl/Errors/entry.undeclaredType.alpha.asc deleted file mode 100644 index cd1d37c..0000000 --- a/tests/carl/Errors/entry.undeclaredType.alpha.asc +++ /dev/null @@ -1,16 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.undeclaredType.alpha -001: type M : string -> integer -002: -003: function foo : M -004: -005: foo (s) := { -006: [ -007: int: x - ^0 ^1 - LINE 7:9 ** ERROR #0: the name 'int', used here as a type, has not been declared at this point in the program. - LINE 7:14 ** ERROR #1: the name 'x' is being declared with an unknown type. - -008: ] -009: return 0; -010: } -011: diff --git a/tests/carl/Errors/entry.undeclaredVar.alpha b/tests/carl/Errors/entry.undeclaredVar.alpha deleted file mode 100644 index 6cd5fa7..0000000 --- a/tests/carl/Errors/entry.undeclaredVar.alpha +++ /dev/null @@ -1,7 +0,0 @@ -type M : string -> integer - -function entry : M - -entry(s) := { - return x; -} diff --git a/tests/carl/Errors/entry.undeclaredVar.alpha.asc b/tests/carl/Errors/entry.undeclaredVar.alpha.asc deleted file mode 100644 index 7c4e6c2..0000000 --- a/tests/carl/Errors/entry.undeclaredVar.alpha.asc +++ /dev/null @@ -1,12 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.undeclaredVar.alpha -001: type M : string -> integer -002: -003: function entry : M -004: -005: entry(s) := { -006: return x; - ^0 - LINE 6:12 ** ERROR #0: the name 'x', used here as a variable name, has not been declared at this point in the program. - -007: } -008: diff --git a/tests/carl/Errors/error.operator.alpha b/tests/carl/Errors/error.operator.alpha deleted file mode 100644 index a7b0691..0000000 --- a/tests/carl/Errors/error.operator.alpha +++ /dev/null @@ -1,14 +0,0 @@ -type string2int: string -> integer - -function entry : string2int - -entry(arg) := { - [ integer: i; integer: sum ] - sum := 0; - i := 0; - while (i < 10) { - sum = sum + i; - i := i + 1; - } - return 0; -} diff --git a/tests/carl/Errors/error.operator.alpha.asc b/tests/carl/Errors/error.operator.alpha.asc deleted file mode 100644 index 82f5614..0000000 --- a/tests/carl/Errors/error.operator.alpha.asc +++ /dev/null @@ -1,19 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file error.operator.alpha -001: type string2int: string -> integer -002: -003: function entry : string2int -004: -005: entry(arg) := { -006: [ integer: i; integer: sum ] -007: sum := 0; -008: i := 0; -009: while (i < 10) { -010: sum = sum + i; - ^0 - LINE 10:13 ** ERROR #0: assignment operator (:=) expected but equality operator (=) found. - -011: i := i + 1; -012: } -013: return 0; -014: } -015: diff --git a/tests/carl/NoErrors/entry.definition.alpha.asc b/tests/carl/NoErrors/entry.definition.alpha.asc deleted file mode 100644 index 07dbd42..0000000 --- a/tests/carl/NoErrors/entry.definition.alpha.asc +++ /dev/null @@ -1,10 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.definition.alpha -001: (* type string : 1 -> character *) -002: type M : string -> integer -003: -004: function entry : M -005: -006: entry(s) := { -007: return 0; -008: } -009: diff --git a/tests/carl/NoErrors/entry.duplicateDifferent.alpha.asc b/tests/carl/NoErrors/entry.duplicateDifferent.alpha.asc deleted file mode 100644 index 65ae8d8..0000000 --- a/tests/carl/NoErrors/entry.duplicateDifferent.alpha.asc +++ /dev/null @@ -1,13 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.duplicateDifferent.alpha -001: type M : string -> integer -002: -003: function entry : M -004: -005: entry(s) := { -006: [ -007: integer: x; -008: character: x -009: ] -010: return x; -011: } -012: diff --git a/tests/carl/NoErrors/entry.duplicateSame.alpha.asc b/tests/carl/NoErrors/entry.duplicateSame.alpha.asc deleted file mode 100644 index 7861cc6..0000000 --- a/tests/carl/NoErrors/entry.duplicateSame.alpha.asc +++ /dev/null @@ -1,11 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.duplicateSame.alpha -001: type M : string -> integer -002: function entry : M -003: -004: entry(s) := { -005: [ -006: integer: x; integer: x -007: ] -008: return x; -009: } -010: diff --git a/tests/carl/NoErrors/entry.local.alpha.asc b/tests/carl/NoErrors/entry.local.alpha.asc deleted file mode 100644 index e9882d4..0000000 --- a/tests/carl/NoErrors/entry.local.alpha.asc +++ /dev/null @@ -1,13 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file entry.local.alpha -001: type M : string -> integer -002: -003: function entry : M -004: -005: entry(s) := { -006: [ -007: integer: x -008: ] -009: x := 0; -010: return x; -011: } -012: diff --git a/tests/carl/NoErrors/error.none.alpha.asc b/tests/carl/NoErrors/error.none.alpha.asc deleted file mode 100644 index 9fdcadb..0000000 --- a/tests/carl/NoErrors/error.none.alpha.asc +++ /dev/null @@ -1,16 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file error.none.alpha -001: type string2int: string -> integer -002: -003: function entry : string2int -004: -005: entry(arg) := { -006: [ integer: i ; integer: sum ] -007: sum := 0; -008: i := 0 ; -009: while (i < 10) { -010: sum := sum + i; -011: i := i + 1; -012: } -013: return 0; -014: } -015: diff --git a/tests/carl/NoErrors/function.declaration.alpha.asc b/tests/carl/NoErrors/function.declaration.alpha.asc deleted file mode 100644 index fca046a..0000000 --- a/tests/carl/NoErrors/function.declaration.alpha.asc +++ /dev/null @@ -1,5 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file function.declaration.alpha -001: type M : integer -> integer -002: -003: function f : M -004: diff --git a/tests/carl/NoErrors/function.definition.alpha.asc b/tests/carl/NoErrors/function.definition.alpha.asc deleted file mode 100644 index e476758..0000000 --- a/tests/carl/NoErrors/function.definition.alpha.asc +++ /dev/null @@ -1,9 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file function.definition.alpha -001: type M : integer -> integer -002: -003: function f : M -004: -005: f(x) := { -006: return x; -007: } -008: diff --git a/tests/carl/NoErrors/functionValue.alpha.asc b/tests/carl/NoErrors/functionValue.alpha.asc deleted file mode 100644 index 882d558..0000000 --- a/tests/carl/NoErrors/functionValue.alpha.asc +++ /dev/null @@ -1,75 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file functionValue.alpha -001: (* Type definitions *) -002: -003: (* mapping type *) -004: type string2int: string -> integer -005: -006: (* array of functions *) -007: type funArray: 1 -> string2int -008: -009: (* record of functions *) -010: type funRec: [ string2int: f; string2int: g ] -011: -012: (* function returning function *) -013: type integer_2_string2int: integer -> string2int -014: -015: (* function returning function *) -016: type string2int_2_integer: string2int -> integer -017: -018: -019: type iXiXc: [integer: a; integer: b; character: c] -020: -021: type iic2b: iXiXc -> Boolean -022: -023: (* Function declarations using the above type definitions *) -024: function a: string2int -025: function b: integer_2_string2int -026: function c: string2int_2_integer -027: -028: function d: iic2b -029: -030: d(x,y,z) := { -031: return (x < y & z < 'm'); -032: } -033: -034: function entry: string2int -035: -036: a(x) := { -037: [string : s] -038: s := x; -039: return 0; -040: } -041: -042: b(x) := { -043: [integer: i] -044: i := x; -045: return a; -046: } -047: -048: c(x) := { -049: [string: s] -050: s := "Hi!"; -051: return x(s); -052: } -053: -054: -055: (* Function definition -056: entry is the first function called -057: *) -058: entry(arg) := { -059: [integer: result; string2int: f; integer: temp] -060: temp := a("Hello"); -061: f := b(temp); -062: result := c(f); -063: if (d(1,2,'c')) -064: then { -065: result := 0; -066: } -067: else { -068: [ Boolean : b] -069: result := entry("hello"); -070: } -071: result := c(f); -072: return result; -073: } -074: diff --git a/tests/carl/NoErrors/sample.good.alpha.asc b/tests/carl/NoErrors/sample.good.alpha.asc deleted file mode 100644 index a4bfa3a..0000000 --- a/tests/carl/NoErrors/sample.good.alpha.asc +++ /dev/null @@ -1,31 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file sample.good.alpha -001: -001: (* Type definitions *) -003: type int2int: integer -> integer -004: type string2int: string -> integer -005: -006: (* Function declarations -007: They use the above type definitions -008: *) -009: function square : int2int -010: function entry : string2int -011: -012: (* Function definition -013: Functions must be declared before they are defined -014: *) -015: square(x) := { -016: return x * x; -017: } -018: -019: (* Function definition -020: entry is the first function called -021: *) -022: entry(arg) := { -023: [ integer: input ; integer: expected ; integer: actual ; Boolean: result ] -024: input := 7; -025: expected := 49; -026: actual := square(input); -027: result := expected = actual; -028: return 0; -029: } -030: diff --git a/tests/carl/NoErrors/selectionSort.alpha.asc b/tests/carl/NoErrors/selectionSort.alpha.asc deleted file mode 100644 index 2a12877..0000000 --- a/tests/carl/NoErrors/selectionSort.alpha.asc +++ /dev/null @@ -1,70 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file selectionSort.alpha -001: (* Type definitions *) -002: -003: type string2int: string -> integer -004: type intArray: 1 -> integer -005: type intArrayXinteger: [ intArray: data; integer: index ] -006: type intArrayXinteger2integer: intArrayXinteger -> integer -007: type intArray2Boolean: intArray -> Boolean -008: -009: -010: (* Function declarations -011: They use the above type definitions -012: *) -013: function indexOfSmallest: intArrayXinteger2integer -014: function selectionSort: intArray2Boolean -015: function entry : string2int -016: -017: (* indexOfSmallest *) -018: indexOfSmallest (* as *) (data, startingIndex) := { -019: [ integer: indexOfSmallestSoFar; integer: i ] -020: indexOfSmallestSoFar := startingIndex; -021: i := 0 ; -022: while (i < data._1 ) { -023: if ( data(i) < data(indexOfSmallestSoFar) ) -024: then { -025: indexOfSmallestSoFar := i; -026: } -027: else { -028: i := i; -029: } -030: i := i + 1; -031: } -032: return indexOfSmallestSoFar; -033: } -034: -035: -036: (* selectionSort *) -037: selectionSort(data) := { -038: [ integer: i ] -039: i := 0 ; -040: while (i < data._1 ) { -041: [ integer: index; integer: temp ] -042: index := indexOfSmallest(data,i); -043: temp := data(index); -044: data(index) := data(i); -045: data(i) := temp; -046: i := i + 1; -047: } -048: return true; -049: } -050: -051: -052: (* Function definition -053: entry is the first function called -054: *) -055: entry(arg) := { -056: [ intArray: data; Boolean: _ ] -057: data := reserve data(8); -058: data(0) := 60; -059: data(1) := 80; -060: data(2) := 10; -061: data(3) := 50; -062: data(4) := 30; -063: data(5) := 40; -064: data(6) := 20; -065: data(7) := 70; -066: _ := selectionSort(data); -067: return 0; -068: } -069: diff --git a/tests/carl/NoErrors/type.array.alpha.asc b/tests/carl/NoErrors/type.array.alpha.asc deleted file mode 100644 index 8e6154d..0000000 --- a/tests/carl/NoErrors/type.array.alpha.asc +++ /dev/null @@ -1,3 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file type.array.alpha -001: type A : 1 -> integer -002: diff --git a/tests/carl/NoErrors/type.mapping.alpha.asc b/tests/carl/NoErrors/type.mapping.alpha.asc deleted file mode 100644 index 2ce8f0c..0000000 --- a/tests/carl/NoErrors/type.mapping.alpha.asc +++ /dev/null @@ -1,4 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file type.mapping.alpha -001: type M : integer -> character -002: -003: diff --git a/tests/carl/NoErrors/type.record.alpha.asc b/tests/carl/NoErrors/type.record.alpha.asc deleted file mode 100644 index 848948b..0000000 --- a/tests/carl/NoErrors/type.record.alpha.asc +++ /dev/null @@ -1,3 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file type.record.alpha -001: type R : [ integer : i ; character : c ] -002: diff --git a/tests/carl/NoErrors/types.alpha.asc b/tests/carl/NoErrors/types.alpha.asc deleted file mode 100644 index 8844865..0000000 --- a/tests/carl/NoErrors/types.alpha.asc +++ /dev/null @@ -1,77 +0,0 @@ -alpha parser, version 0.2 (2023-03-04) - Annotated Source Code for file types.alpha -001: (* -001: -002: At compiler start-up your program should -003: create symbol table entries for the following -004: built-in types: -005: -006: Boolean (1 byte) -007: character (1 byte) -008: integer (4 bytes) -009: address (8 bytes) -010: -011: and the following privileged type (it has literals): -012: -013: type string: 1 -> character -014: -015: Your compiler can define other types during -016: its start-up routine as well, if it is helpful -017: to do so. -018: -019: *) -021: -022: -023: -024: type BooleanXBoolean: [Boolean: x; Boolean: y] -025: type characterXcharacter: [character: x; character: y] -026: type integerXinteger: [integer: x; integer: y] -027: -028: type Boolean2Boolean: Boolean -> Boolean -029: type integer2integer: integer -> integer -030: -031: type character2integer: character -> integer -032: type Boolean2integer: Boolean -> integer -033: type string2integer: string -> integer -034: -035: type integerXinteger2integer: integerXinteger -> integer -036: -037: type integerXinteger2Boolean: integerXinteger -> Boolean -038: type characterXcharacter2Boolean: characterXcharacter -> Boolean -039: type BooleanXBoolean2Boolean: BooleanXBoolean -> Boolean -040: -041: -042: type integer2address: integer -> address -043: type address2integer: address -> integer -044: -045: -046: (* The alpha library functions -047: You will be provided with x86-64 assembly -048: code implementations of these. -049: *) -050: -051: external function printInteger: integer2integer -052: external function printCharacter: character2integer -053: external function printBoolean: Boolean2integer -054: -055: (* -056: A declaration of the entry point function for your program -057: -058: You may assume that when starting this function will behave as if -059: it had been called from the C language main function like this: -060: -061: int main(int argc, char * argv[]) { -062: if (argc == 1) { -063: return entry(NULL); -064: } -065: else { -066: return entry(makeAlphaString(argv[1])); -067: } -068: } -069: -070: for some suitable definition of makeAlphaString which creates -071: an alpha string representation of its argument C string in memory -072: and returns a pointer to that alpha string. -073: *) -074: -075: function entry: string2integer -076: diff --git a/tests/carl/NoErrors/entry.definition.alpha b/tests/given/test/entry.definition.alpha similarity index 84% rename from tests/carl/NoErrors/entry.definition.alpha rename to tests/given/test/entry.definition.alpha index 0003cd5..c9538b4 100644 --- a/tests/carl/NoErrors/entry.definition.alpha +++ b/tests/given/test/entry.definition.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] (* type string : 1 -> character *) type M : string -> integer diff --git a/tests/carl/NoErrors/entry.duplicateDifferent.alpha b/tests/given/test/entry.duplicateDifferent.alpha similarity index 86% rename from tests/carl/NoErrors/entry.duplicateDifferent.alpha rename to tests/given/test/entry.duplicateDifferent.alpha index 5cbd668..41168f2 100644 --- a/tests/carl/NoErrors/entry.duplicateDifferent.alpha +++ b/tests/given/test/entry.duplicateDifferent.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type M : string -> integer function entry : M diff --git a/tests/carl/NoErrors/entry.duplicateSame.alpha b/tests/given/test/entry.duplicateSame.alpha similarity index 85% rename from tests/carl/NoErrors/entry.duplicateSame.alpha rename to tests/given/test/entry.duplicateSame.alpha index 554b9d8..e6b295d 100644 --- a/tests/carl/NoErrors/entry.duplicateSame.alpha +++ b/tests/given/test/entry.duplicateSame.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type M : string -> integer function entry : M diff --git a/tests/carl/NoErrors/entry.local.alpha b/tests/given/test/entry.local.alpha similarity index 85% rename from tests/carl/NoErrors/entry.local.alpha rename to tests/given/test/entry.local.alpha index cff2062..e9905c4 100644 --- a/tests/carl/NoErrors/entry.local.alpha +++ b/tests/given/test/entry.local.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type M : string -> integer function entry : M diff --git a/tests/carl/NoErrors/error.none.alpha b/tests/given/test/error.none.alpha similarity index 92% rename from tests/carl/NoErrors/error.none.alpha rename to tests/given/test/error.none.alpha index 85aa4f2..50fc401 100644 --- a/tests/carl/NoErrors/error.none.alpha +++ b/tests/given/test/error.none.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type string2int: string -> integer function entry : string2int diff --git a/tests/carl/NoErrors/function.declaration.alpha b/tests/given/test/function.declaration.alpha similarity index 68% rename from tests/carl/NoErrors/function.declaration.alpha rename to tests/given/test/function.declaration.alpha index 69f210f..9653a68 100644 --- a/tests/carl/NoErrors/function.declaration.alpha +++ b/tests/given/test/function.declaration.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type M : integer -> integer function f : M diff --git a/tests/carl/NoErrors/function.definition.alpha b/tests/given/test/function.definition.alpha similarity index 78% rename from tests/carl/NoErrors/function.definition.alpha rename to tests/given/test/function.definition.alpha index b729610..72f1f68 100644 --- a/tests/carl/NoErrors/function.definition.alpha +++ b/tests/given/test/function.definition.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] type M : integer -> integer function f : M diff --git a/tests/carl/NoErrors/functionValue.alpha b/tests/given/test/functionValue.alpha similarity index 98% rename from tests/carl/NoErrors/functionValue.alpha rename to tests/given/test/functionValue.alpha index c1134ce..85158c7 100644 --- a/tests/carl/NoErrors/functionValue.alpha +++ b/tests/given/test/functionValue.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] (* Type definitions *) (* mapping type *) diff --git a/tests/carl/NoErrors/sample.good.alpha b/tests/given/test/sample.good.alpha similarity index 96% rename from tests/carl/NoErrors/sample.good.alpha rename to tests/given/test/sample.good.alpha index 8a8b727..54c4ae6 100644 --- a/tests/carl/NoErrors/sample.good.alpha +++ b/tests/given/test/sample.good.alpha @@ -1,4 +1,4 @@ - +$$ TEST: [-asc -tc] (* Type definitions *) type int2int: integer -> integer type string2int: string -> integer diff --git a/tests/carl/NoErrors/selectionSort.alpha b/tests/given/test/selectionSort.alpha similarity index 98% rename from tests/carl/NoErrors/selectionSort.alpha rename to tests/given/test/selectionSort.alpha index 24fb000..d785542 100644 --- a/tests/carl/NoErrors/selectionSort.alpha +++ b/tests/given/test/selectionSort.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] (* Type definitions *) type string2int: string -> integer diff --git a/tests/carl/NoErrors/type.array.alpha b/tests/given/test/type.array.alpha similarity index 52% rename from tests/carl/NoErrors/type.array.alpha rename to tests/given/test/type.array.alpha index 2b04ba0..ef76679 100644 --- a/tests/carl/NoErrors/type.array.alpha +++ b/tests/given/test/type.array.alpha @@ -1 +1,2 @@ +$$ TEST: [-asc -tc] type A : 1 -> integer diff --git a/tests/carl/NoErrors/type.mapping.alpha b/tests/given/test/type.mapping.alpha similarity index 60% rename from tests/carl/NoErrors/type.mapping.alpha rename to tests/given/test/type.mapping.alpha index 8b6bc50..37c1037 100644 --- a/tests/carl/NoErrors/type.mapping.alpha +++ b/tests/given/test/type.mapping.alpha @@ -1,2 +1,3 @@ +$$ TEST: [-asc -tc] type M : integer -> character diff --git a/tests/carl/NoErrors/type.record.alpha b/tests/given/test/type.record.alpha similarity index 67% rename from tests/carl/NoErrors/type.record.alpha rename to tests/given/test/type.record.alpha index 2c5e9c9..4a08b73 100644 --- a/tests/carl/NoErrors/type.record.alpha +++ b/tests/given/test/type.record.alpha @@ -1 +1,2 @@ +$$ TEST: [-asc -tc] type R : [ integer : i ; character : c ] diff --git a/tests/carl/NoErrors/types.alpha b/tests/given/test/types.alpha similarity index 99% rename from tests/carl/NoErrors/types.alpha rename to tests/given/test/types.alpha index 0402f95..d4947d7 100644 --- a/tests/carl/NoErrors/types.alpha +++ b/tests/given/test/types.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-asc -tc] (* At compiler start-up your program should diff --git a/tests/sprint1/expected/sp1_comment_fix1.expected b/tests/sprint1/expected/sp1_comment_fix1.tok.exp similarity index 100% rename from tests/sprint1/expected/sp1_comment_fix1.expected rename to tests/sprint1/expected/sp1_comment_fix1.tok.exp diff --git a/tests/sprint1/expected/sp1_comment_fix2.expected b/tests/sprint1/expected/sp1_comment_fix2.tok.exp similarity index 100% rename from tests/sprint1/expected/sp1_comment_fix2.expected rename to tests/sprint1/expected/sp1_comment_fix2.tok.exp diff --git a/tests/sprint1/expected/sp1_comment_issues.expected b/tests/sprint1/expected/sp1_comment_issues.tok.exp similarity index 100% rename from tests/sprint1/expected/sp1_comment_issues.expected rename to tests/sprint1/expected/sp1_comment_issues.tok.exp diff --git a/tests/sprint1/expected/sp1_comments.expected b/tests/sprint1/expected/sp1_comments.tok.exp similarity index 100% rename from tests/sprint1/expected/sp1_comments.expected rename to tests/sprint1/expected/sp1_comments.tok.exp diff --git a/tests/sprint1/expected/sp1_general_token.expected b/tests/sprint1/expected/sp1_general_token.tok.exp similarity index 100% rename from tests/sprint1/expected/sp1_general_token.expected rename to tests/sprint1/expected/sp1_general_token.tok.exp diff --git a/tests/sprint1/expected/sp1_keywords.expected b/tests/sprint1/expected/sp1_keywords.expected deleted file mode 100644 index 9e70321..0000000 --- a/tests/sprint1/expected/sp1_keywords.expected +++ /dev/null @@ -1,29 +0,0 @@ -1 1 401 "while" -2 1 101 "While" -3 1 101 "whiLe" -4 1 402 "if" -5 1 101 "IF" -6 1 101 "If" -7 1 101 "iF" -8 1 403 "then" -9 1 101 "Then" -10 1 101 "theN" -11 1 404 "else" -12 1 101 "eLse" -13 1 101 "elSe" -14 1 101 "Else" -15 1 405 "type" -16 1 101 "Type" -17 1 101 "tyPe" -18 1 406 "function" -19 1 101 "Function" -20 1 101 "functioN" -21 1 407 "return" -22 1 101 "Return" -23 1 101 "returN" -24 1 408 "external" -25 1 101 "External" -26 1 101 "exteRnal" -27 1 409 "as" -28 1 101 "As" -29 1 101 "aS" diff --git a/tests/sprint1/expected/sp1_operators.expected b/tests/sprint1/expected/sp1_operators.expected deleted file mode 100644 index dd3eaab..0000000 --- a/tests/sprint1/expected/sp1_operators.expected +++ /dev/null @@ -1,22 +0,0 @@ -1 1 601 "+" -2 1 602 "-" -3 1 603 "*" -4 1 604 "/" -6 1 605 "%" -7 1 606 "<" -9 1 607 "=" -10 1 608 ":=" -11 1 607 "=" -11 2 508 ":" -12 1 508 ":" -13 1 607 "=" -14 1 609 "!" -15 1 610 "&" -16 1 611 "|" -17 1 612 "." -18 1 101 "relEASE" -19 1 614 "release" -20 1 101 "RELEASE" -21 1 613 "reserve" -22 1 101 "RESERVE" -23 1 101 "reSERVe" diff --git a/tests/sprint1/expected/sp1_other_punc.expected b/tests/sprint1/expected/sp1_other_punc.expected deleted file mode 100644 index 7500378..0000000 --- a/tests/sprint1/expected/sp1_other_punc.expected +++ /dev/null @@ -1,7 +0,0 @@ -1 1 507 ";" -2 1 508 ":" -3 1 509 "," -4 1 510 "->" -5 1 510 "->" -6 1 602 "-" -6 2 510 "->" diff --git a/tests/sprint1/expected/sp1_punc_grouping.expected b/tests/sprint1/expected/sp1_punc_grouping.expected deleted file mode 100644 index c58a316..0000000 --- a/tests/sprint1/expected/sp1_punc_grouping.expected +++ /dev/null @@ -1,59 +0,0 @@ -1 1 502 ")" -2 1 101 "a" -2 2 502 ")" -3 1 502 ")" -3 2 101 "a" -4 1 502 ")" -4 2 603 "*" -5 1 603 "*" -5 2 502 ")" -7 1 700 "(* jellsls - well this seems to work - - - *)" -13 1 501 "(" -14 1 101 "a" -14 2 501 "(" -15 1 501 "(" -15 2 101 "a" -16 1 501 "(" -16 2 603 "*" -17 1 603 "*" -17 2 501 "(" -20 1 505 "{" -21 1 101 "a" -21 2 505 "{" -22 1 505 "{" -22 2 101 "a" -23 1 505 "{" -23 2 603 "*" -24 1 603 "*" -24 2 505 "{" -25 1 506 "}" -26 1 101 "a" -26 2 506 "}" -27 1 506 "}" -27 2 101 "a" -28 1 506 "}" -28 2 603 "*" -29 1 603 "*" -29 2 506 "}" -33 1 503 "[" -34 1 101 "a" -34 2 503 "[" -35 1 503 "[" -35 2 101 "a" -36 1 503 "[" -36 2 603 "*" -37 1 603 "*" -37 2 503 "[" -38 1 504 "]" -39 1 101 "a" -39 2 504 "]" -40 1 504 "]" -40 2 101 "a" -41 1 504 "]" -41 2 603 "*" -42 1 603 "*" -42 2 504 "]" diff --git a/tests/sprint1/expected/sp1_real_alpha_file1.expected b/tests/sprint1/expected/sp1_real_alpha_file1.expected deleted file mode 100644 index cc3f2c9..0000000 --- a/tests/sprint1/expected/sp1_real_alpha_file1.expected +++ /dev/null @@ -1,145 +0,0 @@ -1 1 405 "type" -1 6 101 "rec" -1 9 508 ":" -1 11 503 "[" -1 12 201 "integer" -1 19 508 ":" -1 21 101 "x" -1 22 507 ";" -1 24 201 "integer" -1 31 508 ":" -1 33 101 "y" -1 34 504 "]" -2 1 405 "type" -2 6 101 "T1" -2 8 508 ":" -2 10 201 "integer" -2 18 510 "->" -2 21 201 "integer" -3 1 405 "type" -3 6 101 "T2" -3 8 508 ":" -3 10 101 "rec" -3 14 510 "->" -3 17 201 "integer" -4 1 406 "function" -4 10 101 "foo" -4 14 508 ":" -4 16 101 "T1" -5 1 406 "function" -5 10 101 "bar1" -5 15 508 ":" -5 17 101 "T2" -6 1 406 "function" -6 10 101 "bar2" -6 15 508 ":" -6 17 101 "T2" -7 1 101 "foo" -7 4 501 "(" -7 5 101 "x" -7 6 502 ")" -7 8 608 ":=" -7 11 505 "{" -8 2 407 "return" -8 9 101 "x" -8 11 603 "*" -8 13 101 "x" -8 14 507 ";" -9 9 506 "}" -10 1 101 "bar1" -10 5 501 "(" -10 6 101 "a" -10 7 502 ")" -10 9 608 ":=" -10 12 505 "{" -11 9 407 "return" -11 16 101 "a" -11 17 612 "." -11 18 101 "x" -11 20 603 "*" -11 22 101 "a" -11 23 612 "." -11 24 101 "y" -11 25 507 ";" -12 9 506 "}" -13 1 101 "bar2" -13 6 409 "as" -13 9 501 "(" -13 10 101 "r" -13 11 509 "," -13 12 101 "s" -13 13 502 ")" -13 15 608 ":=" -13 18 505 "{" -14 9 407 "return" -14 16 101 "r" -14 18 603 "*" -14 20 101 "s" -14 21 507 ";" -15 9 506 "}" -16 1 101 "entry" -16 6 501 "(" -16 7 101 "arg" -16 10 502 ")" -16 12 608 ":=" -16 15 505 "{" -17 9 503 "[" -17 11 201 "integer" -17 18 508 ":" -17 20 101 "result" -17 27 507 ";" -17 29 101 "rec" -17 32 508 ":" -17 34 101 "w" -17 35 504 "]" -18 9 101 "result" -18 16 608 ":=" -18 19 101 "foo" -18 22 501 "(" -18 23 301 "5" -18 24 502 ")" -18 25 507 ";" -19 9 101 "w" -19 11 608 ":=" -19 14 613 "reserve" -19 21 501 "(" -19 22 101 "w" -19 23 502 ")" -19 24 507 ";" -19 26 700 "(* see types.alpha – reserve returns a value of type address, - which can be assigned to array and record variables - *)" -22 9 101 "w" -22 10 612 "." -22 11 101 "x" -22 13 608 ":=" -22 16 301 "5" -22 17 507 ";" -23 9 101 "w" -23 10 612 "." -23 11 101 "y" -23 13 608 ":=" -23 16 301 "7" -23 17 507 ";" -24 9 101 "result" -24 16 608 ":=" -24 19 101 "bar1" -24 23 501 "(" -24 24 101 "w" -24 25 502 ")" -24 26 507 ";" -24 28 700 "(* pass w (a rec type value) to bar1 *)" -25 9 101 "result" -25 16 608 ":=" -25 19 101 "bar2" -25 23 501 "(" -25 24 301 "5" -25 25 509 "," -25 26 301 "7" -25 27 502 ")" -25 28 507 ";" -25 30 700 "(* implicitly build a rec type value, assign 5 and 7 to fields x and y, but call them r and s *)" -27 9 407 "return" -27 16 301 "0" -27 17 507 ";" -28 1 506 "}" diff --git a/tests/sprint1/expected/sp1_real_alpha_file2.expected b/tests/sprint1/expected/sp1_real_alpha_file2.expected deleted file mode 100644 index 90c34a2..0000000 --- a/tests/sprint1/expected/sp1_real_alpha_file2.expected +++ /dev/null @@ -1,100 +0,0 @@ -1 1 700 "(* Type definitions *)" -2 1 405 "type" -2 6 101 "string" -2 12 508 ":" -2 14 301 "1" -2 16 510 "->" -2 19 204 "character" -3 1 405 "type" -3 6 101 "int2int" -3 13 508 ":" -3 15 201 "integer" -3 23 510 "->" -3 26 201 "integer" -4 1 405 "type" -4 6 101 "string2int" -4 16 508 ":" -4 18 101 "string" -4 25 510 "->" -4 28 201 "integer" -5 1 700 "(* Function prototypes -They use the above type definitions -*)" -8 1 406 "function" -8 10 101 "square" -8 17 508 ":" -8 19 101 "int2int" -9 1 406 "function" -9 10 101 "entry" -9 16 508 ":" -9 18 101 "string2int" -10 1 700 "(* Function definition -Functions must be declared before they are defined -*)" -13 1 101 "square" -13 7 501 "(" -13 8 101 "x" -13 9 502 ")" -13 11 608 ":=" -13 14 505 "{" -14 1 407 "return" -14 8 101 "x" -14 10 603 "*" -14 12 101 "x" -14 13 507 ";" -15 1 506 "}" -16 1 700 "(* Function definition -entry is the first function called -*)" -19 1 101 "entry" -19 6 501 "(" -19 7 101 "arg" -19 10 502 ")" -19 12 608 ":=" -19 15 505 "{" -20 1 101 "input" -20 7 607 "=" -20 9 301 "7" -20 10 507 ";" -21 1 101 "expected" -21 10 607 "=" -21 12 301 "49" -21 14 507 ";" -22 1 101 "actual" -22 8 608 ":=" -22 11 101 "square" -22 17 501 "(" -22 18 101 "input" -22 23 502 ")" -22 24 507 ";" -23 1 101 "rseult" -23 8 608 ":=" -23 11 101 "expected" -23 20 607 "=" -23 22 101 "actual" -23 28 507 ";" -24 1 407 "return" -24 8 301 "0" -24 9 507 ";" -25 1 503 "[" -25 3 201 "integer" -25 10 508 ":" -25 12 101 "input" -25 17 507 ";" -25 19 201 "integer" -25 26 508 ":" -25 28 101 "expected" -25 36 507 ";" -25 38 201 "integer" -25 45 508 ":" -25 47 101 "actual" -25 53 507 ";" -25 55 101 "boolean" -25 62 508 ":" -25 64 101 "result" -25 70 507 ";" -25 72 101 "string" -25 78 508 ":" -25 80 101 "input" -25 86 504 "]" -26 1 506 "}" diff --git a/tests/sprint1/expected/sp1_simple_int.expected b/tests/sprint1/expected/sp1_simple_int.expected deleted file mode 100644 index 0bcbefb..0000000 --- a/tests/sprint1/expected/sp1_simple_int.expected +++ /dev/null @@ -1,8 +0,0 @@ -1 1 301 "45" -2 1 301 "123" -3 1 301 "8392" -4 1 301 "40" -4 4 301 "40" -5 2 301 "200" -5 6 301 "50" -5 9 301 "21783" diff --git a/tests/sprint1/expected/sp1_simple_literals.expected b/tests/sprint1/expected/sp1_simple_literals.expected deleted file mode 100644 index 788adc2..0000000 --- a/tests/sprint1/expected/sp1_simple_literals.expected +++ /dev/null @@ -1,64 +0,0 @@ -1 1 304 ""this is a string"" -1 20 301 "721398" -1 27 303 "'g'" -1 32 604 "/" -1 33 101 "n" -1 36 700 "(* should print 3 tokens before this *)" -4 1 301 "12893" -4 8 101 "this" -4 13 101 "is" -4 16 101 "not" -4 20 101 "a" -4 22 101 "string" -4 29 700 "(*one valid token before this*)" -5 1 700 "(* spacey comment here -over multiple lines -will it work? *)" -7 18 306 "false" -11 1 306 "false" -12 1 700 "(**)" -14 1 101 "nullfalse" -15 2 101 "nulltrue" -16 1 302 "null" -17 1 303 "'7'" -18 1 305 "true" -19 2 301 "189" -20 1 303 "'\t'" -21 1 303 "'"'" -22 1 303 "'/'" -23 1 303 "'\n'" -24 1 303 "'\''" -25 1 303 "'\t'" -26 1 303 "'\\'" -27 1 303 "'n'" -29 2 101 "fdsf" -30 1 700 "(*/jnewjno2893u86^ Lots of random characters /n /t '") *)" -35 1 304 ""STRINGwithnotSPaces"" -36 1 303 "' '" -38 1 304 ""J"" -39 1 304 """" -40 1 304 "" "" -42 1 304 ""{SCHAR}"" -43 1 304 ""SCHAR"" -44 1 304 ""[SCHAR]"" -45 1 304 ""FINAL: I'd think this is a legal \"string\" that contains \n \t several escaped characters, isn't it?"" -46 2 101 "I" -46 4 101 "d" -46 6 101 "think" -46 12 101 "this" -46 17 101 "is" -46 20 101 "a" -46 22 101 "legal" -46 30 101 "string" -46 39 101 "that" -46 44 101 "contains" -46 53 101 "several" -46 63 101 "n" -46 66 101 "t" -46 68 101 "escaped" -46 76 101 "characters" -46 86 509 "," -46 88 101 "isn" -46 92 101 "t" -46 94 101 "it" -47 1 101 "nullLike" diff --git a/tests/sprint1/expected/sp1_variables.expected b/tests/sprint1/expected/sp1_variables.expected deleted file mode 100644 index 223288a..0000000 --- a/tests/sprint1/expected/sp1_variables.expected +++ /dev/null @@ -1,13 +0,0 @@ -1 1 101 "valid1" -2 1 101 "Valid2" -3 1 101 "_valid3" -4 1 101 "_valid_name_4" -5 1 101 "VALID" -6 1 301 "0" -6 2 101 "Invalid" -7 1 301 "1" -7 2 101 "invalid" -8 2 101 "invalid" -9 1 101 "invalid" -9 8 607 "=" -10 1 101 "String" diff --git a/tests/sprint1/test/sp1_comment_fix1.alpha b/tests/sprint1/test/sp1_comment_fix1.alpha index 910a538..0f2ec67 100644 --- a/tests/sprint1/test/sp1_comment_fix1.alpha +++ b/tests/sprint1/test/sp1_comment_fix1.alpha @@ -1 +1,2 @@ +$$ TEST: [-tok] (***) \ No newline at end of file diff --git a/tests/sprint1/test/sp1_comment_fix2.alpha b/tests/sprint1/test/sp1_comment_fix2.alpha index bd710e9..72e5ffe 100644 --- a/tests/sprint1/test/sp1_comment_fix2.alpha +++ b/tests/sprint1/test/sp1_comment_fix2.alpha @@ -1 +1,2 @@ +$$ TEST: [-tok] (*(**)*) \ No newline at end of file diff --git a/tests/sprint1/test/sp1_comment_issues.alpha b/tests/sprint1/test/sp1_comment_issues.alpha index e968d93..45b244d 100644 --- a/tests/sprint1/test/sp1_comment_issues.alpha +++ b/tests/sprint1/test/sp1_comment_issues.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] (*(**)*) (***) (******)(*\kpp*********) diff --git a/tests/sprint1/test/sp1_comments.alpha b/tests/sprint1/test/sp1_comments.alpha index 1111428..63f216b 100644 --- a/tests/sprint1/test/sp1_comments.alpha +++ b/tests/sprint1/test/sp1_comments.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] (* hello *) (* hello *) (* I'd think this is a legal "string" that contains several \n \t diff --git a/tests/sprint1/test/sp1_general_token.alpha b/tests/sprint1/test/sp1_general_token.alpha index defc56b..dcb581f 100644 --- a/tests/sprint1/test/sp1_general_token.alpha +++ b/tests/sprint1/test/sp1_general_token.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] This is a test 9combined 7okens 12345 diff --git a/tests/sprint1/test/sp1_keywords.alpha b/tests/sprint1/test/sp1_keywords.alpha index ff18168..8b76ac7 100644 --- a/tests/sprint1/test/sp1_keywords.alpha +++ b/tests/sprint1/test/sp1_keywords.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] while While whiLe diff --git a/tests/sprint1/test/sp1_operators.alpha b/tests/sprint1/test/sp1_operators.alpha index b985387..eacaec4 100644 --- a/tests/sprint1/test/sp1_operators.alpha +++ b/tests/sprint1/test/sp1_operators.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] + - * diff --git a/tests/sprint1/test/sp1_other_punc.alpha b/tests/sprint1/test/sp1_other_punc.alpha index bd1f2de..87bdb10 100644 --- a/tests/sprint1/test/sp1_other_punc.alpha +++ b/tests/sprint1/test/sp1_other_punc.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] ; : , diff --git a/tests/sprint1/test/sp1_punc_grouping.alpha b/tests/sprint1/test/sp1_punc_grouping.alpha index 45dfb99..57df795 100644 --- a/tests/sprint1/test/sp1_punc_grouping.alpha +++ b/tests/sprint1/test/sp1_punc_grouping.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] ) a) )a diff --git a/tests/sprint1/test/sp1_real_alpha_file1.alpha b/tests/sprint1/test/sp1_real_alpha_file1.alpha index 51d5d08..c7713be 100644 --- a/tests/sprint1/test/sp1_real_alpha_file1.alpha +++ b/tests/sprint1/test/sp1_real_alpha_file1.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] type rec: [integer: x; integer: y] type T1: integer -> integer type T2: rec -> integer diff --git a/tests/sprint1/test/sp1_real_alpha_file2.alpha b/tests/sprint1/test/sp1_real_alpha_file2.alpha index 0beb2af..7fe7705 100644 --- a/tests/sprint1/test/sp1_real_alpha_file2.alpha +++ b/tests/sprint1/test/sp1_real_alpha_file2.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] (* Type definitions *) type string: 1 -> character type int2int: integer -> integer diff --git a/tests/sprint1/test/sp1_simple_alpha.alpha b/tests/sprint1/test/sp1_simple_alpha.alpha index 719384b..2d8b2ce 100644 --- a/tests/sprint1/test/sp1_simple_alpha.alpha +++ b/tests/sprint1/test/sp1_simple_alpha.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] type main: string -> integer function entry: main diff --git a/tests/sprint1/test/sp1_simple_int.alpha b/tests/sprint1/test/sp1_simple_int.alpha index 127f0a6..f712914 100644 --- a/tests/sprint1/test/sp1_simple_int.alpha +++ b/tests/sprint1/test/sp1_simple_int.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] 45 123 8392 diff --git a/tests/sprint1/test/sp1_simple_literals.alpha b/tests/sprint1/test/sp1_simple_literals.alpha index 4c5b0b2..ce5b0bd 100644 --- a/tests/sprint1/test/sp1_simple_literals.alpha +++ b/tests/sprint1/test/sp1_simple_literals.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] "this is a string" 721398 'g' '/n' (* should print 3 tokens before this *) ' ' diff --git a/tests/sprint1/test/sp1_variables.alpha b/tests/sprint1/test/sp1_variables.alpha index 26db6c0..ec787c6 100644 --- a/tests/sprint1/test/sp1_variables.alpha +++ b/tests/sprint1/test/sp1_variables.alpha @@ -1,3 +1,4 @@ +$$ TEST: [-tok] valid1 Valid2 _valid3