Skip to content

Commit

Permalink
[ruby/prism] Document UnlessNode fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusRich authored and matzbot committed Apr 23, 2024
1 parent b62ab95 commit 99a46d7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions prism/config.yml
Expand Up @@ -3392,18 +3392,56 @@ nodes:
fields:
- name: keyword_loc
type: location
comment: |
The location of the `unless` keyword.
unless cond then bar end
^^^^^^
bar unless cond
^^^^^^
- name: predicate
type: node
comment: |
The condition to be evaluated for the unless expression. Can be any
kind of node that represents a non-void expression.
unless cond then bar end
^^^^
bar unless cond
^^^^
- name: then_keyword_loc
type: location?
comment:
The location of the `then` keyword, if present.

unless cond then bar end
^^^^
- name: statements
type: node?
kind: StatementsNode
comment: |
The body of statements that will executed if the unless condition is
falsey. Will be `nil` if no body is provided.
unless cond then bar end
^^^
- name: consequent
type: node?
kind: ElseNode
comment: |
The else clause of the unless expression, if present.
unless cond then bar else baz end
^^^^^^^^
- name: end_keyword_loc
type: location?
comment: |
The location of the `end` keyword, if present.
unless cond then bar end
^^^
newline: predicate
comment: |
Represents the use of the `unless` keyword, either in the block form or the modifier form.
Expand Down

0 comments on commit 99a46d7

Please sign in to comment.