From c13f76f365ccab04a797196b3fd368bf4c1b33ba Mon Sep 17 00:00:00 2001 From: Meyer Simon Date: Wed, 12 Feb 2025 15:22:59 -0500 Subject: [PATCH] Added tests for grouping t#09 --- lexicalStructure.lex | 4 +-- tests/test_punctuation_grouping.alpha | 35 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 tests/test_punctuation_grouping.alpha diff --git a/lexicalStructure.lex b/lexicalStructure.lex index 28bc93e..121eb47 100644 --- a/lexicalStructure.lex +++ b/lexicalStructure.lex @@ -15,7 +15,7 @@ ID [A-Za-z_][0-9A-Za-z_]* DIGIT [0-9] CHAR \\n|\\t|\\'|[^'\n\t\\] /* char can be a newline, tab, an escaped quote, or anything but a single quote, an actual line break, an actual tab, or a backslash by itself (to prevent confusion from escaped quote */ -SCHAR \\n|\\t|\\\"|[^\"\n\\] +SCHAR \\n|\\t|\\\"|[^\"\n\\] /* similar to above, a string Char (SCHAR) is the same as a CHAR except we cannot have double quotes instead of single quotes. Double quotes need to be escaped in Flex unlike single quotes based on documentation */ %% @@ -79,4 +79,4 @@ int main( int argc, char **argv ) else yyin = stdin; yylex(); -} \ No newline at end of file +} diff --git a/tests/test_punctuation_grouping.alpha b/tests/test_punctuation_grouping.alpha new file mode 100644 index 0000000..149cadc --- /dev/null +++ b/tests/test_punctuation_grouping.alpha @@ -0,0 +1,35 @@ +) +a) +)a +)* +*) +( +a( +(a +(* +*( + + +{ +a{ +{a +{* +*{ +} +a} +}a +}* +*} + + + +[ +a[ +[a +[* +*[ +] +a] +]a +]* +*]