Skip to content

Commit

Permalink
assert and comprehension
Browse files Browse the repository at this point in the history
Signed-off-by: Daksh <[email protected]>
  • Loading branch information
Daksh-10 committed May 17, 2024
1 parent 4f6fd86 commit 7aa8fe2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 14 deletions.
29 changes: 15 additions & 14 deletions test/corpus/assert.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
================================================================================
assert statements with error message
assert logic with error message
================================================================================

assert 1==2 , "Wrong"
Expand All @@ -17,22 +17,23 @@ assert 1==2 , "Wrong"
(string_end))))

================================================================================
assert statements with 'if' condition
assert logic with 'if' condition
================================================================================

assert 1 == 2 if True, "error message"
assert 1 == 2 if 3 > 2, "error message"

--------------------------------------------------------------------------------

(module
(if_statement
(true)
(assert_statement
(comparison_operator
(integer)
(integer))
(string
(string_start)
(string_content)
(string_end)))
))
(assert_statement
(comparison_operator
(integer)
(integer))
(comparison_operator
(integer)
(integer))
(string
(string_start)
(string_content)
(string_end))))

18 changes: 18 additions & 0 deletions test/corpus/expr.txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,22 @@ print("hello world", end="")
(string_start)
(string_end))))))

================================================================================
Comprehensions
================================================================================

[x * x for x in range(5)]

--------------------------------------------------------------------------------

(module
(list_comprehension
(binary_operator
(identifier)
(identifier))
(for_in_clause
(identifier)
(call
(identifier)
(argument_list
(integer))))))

0 comments on commit 7aa8fe2

Please sign in to comment.