Skip to content

Commit

Permalink
Synced syntax tests
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Helwer <[email protected]>
  • Loading branch information
ahelwer committed Oct 26, 2024
1 parent 8a8413f commit ffb6c4b
Show file tree
Hide file tree
Showing 10 changed files with 648 additions and 60 deletions.
75 changes: 65 additions & 10 deletions test/corpus/infix_op.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
=============|||
Cartesian Product Infix Op Definition
=============|||

---- MODULE Test ----
x \X y == 0
x \times y == 0
====

-------------|||

(source_file (module (header_line) name: (identifier) (header_line)
(operator_definition parameter: (identifier) name: (infix_op_symbol (times)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (times)) parameter: (identifier) (def_eq) definition: (nat_number))
(double_line)))

=============|||
Infix Operator Definition
=============|||
Expand Down Expand Up @@ -100,8 +116,6 @@ x \succ y == 92
x \succeq y == 93
x \supset y == 94
x \supseteq y == 95
x \X y == 96
x \times y == 97
x \uplus y == 98
x | y == 99
x || y == 100
Expand Down Expand Up @@ -208,14 +222,28 @@ x \wr y == 101
(operator_definition parameter: (identifier) name: (infix_op_symbol (succeq)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (supset)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (supseteq)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (times)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (times)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (uplus)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (vert)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (vertvert)) parameter: (identifier) (def_eq) definition: (nat_number))
(operator_definition parameter: (identifier) name: (infix_op_symbol (wr)) parameter: (identifier) (def_eq) definition: (nat_number))
(double_line)))

=============|||
Cartesian Product Declaration as Parameter
=============|||

---- MODULE Test ----
op(_ \X _, _ \times _) == TRUE
====

-------------|||

(source_file (module (header_line) name: (identifier) (header_line)
(operator_definition name: (identifier)
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (times)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (times)) (placeholder))
(def_eq) definition: (boolean))
(double_line)))

=============|||
Infix Operator Declaration as Parameter
Expand Down Expand Up @@ -320,8 +348,6 @@ op(
_ \succeq _,
_ \supset _,
_ \supseteq _,
_ \X _,
_ \times _,
_ \uplus _,
_ | _,
_ || _,
Expand Down Expand Up @@ -430,8 +456,6 @@ op(
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (succeq)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (supset)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (supseteq)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (times)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (times)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (uplus)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (vert)) (placeholder))
parameter: (operator_declaration (placeholder) name: (infix_op_symbol (vertvert)) (placeholder))
Expand Down Expand Up @@ -663,6 +687,39 @@ op == {
))
(double_line)))

=============|||
Cartesian Product as Parameter
=============|||

---- MODULE Test ----
op == f(\X, \times)
====

-------------|||

(source_file (module (header_line) name: (identifier) (header_line)
(operator_definition name: (identifier) (def_eq) definition: (bound_op name: (identifier_ref)
parameter: (infix_op_symbol (times))
parameter: (infix_op_symbol (times))
))
(double_line)))

=============|||
Infix Minus as Parameter
=============|||

---- MODULE Test ----
op == f ( - )
====

-------------|||

(source_file (module (header_line) name: (identifier) (header_line)
(operator_definition name: (identifier) (def_eq) definition: (bound_op name: (identifier_ref)
parameter: (infix_op_symbol (minus))
))
(double_line)))

=============|||
Infix Operators as Parameters
=============|||
Expand Down Expand Up @@ -717,7 +774,6 @@ op == f(
<,
<:,
:>,
-,
--,
%,
%%,
Expand Down Expand Up @@ -824,7 +880,6 @@ op == f(
parameter: (infix_op_symbol (lt))
parameter: (infix_op_symbol (map_from))
parameter: (infix_op_symbol (map_to))
parameter: (infix_op_symbol (minus))
parameter: (infix_op_symbol (minusminus))
parameter: (infix_op_symbol (mod))
parameter: (infix_op_symbol (modmod))
Expand Down
18 changes: 15 additions & 3 deletions test/corpus/number.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
======================|||
All Number Formats
Common Number Formats
======================|||

---- MODULE Test ----
op == 12345
op == 12345.12345
====

----------------------|||

(source_file (module (header_line) (identifier) (header_line)
(operator_definition (identifier) (def_eq) (nat_number))
(operator_definition (identifier) (def_eq) (real_number))
(double_line)))

======================|||
Bitfield Number Formats
======================|||

---- MODULE Test ----
op == \b01010101
op == \B10101010
op == \o01234567
Expand All @@ -16,8 +30,6 @@ op == \H9876543210FEDCBA
----------------------|||

(source_file (module (header_line) (identifier) (header_line)
(operator_definition (identifier) (def_eq) (nat_number))
(operator_definition (identifier) (def_eq) (real_number))
(operator_definition (identifier) (def_eq) (binary_number (format) (value)))
(operator_definition (identifier) (def_eq) (binary_number (format) (value)))
(operator_definition (identifier) (def_eq) (octal_number (format) (value)))
Expand Down
Loading

0 comments on commit ffb6c4b

Please sign in to comment.