Skip to content

Commit

Permalink
nitcc: document plusize and quesize
Browse files Browse the repository at this point in the history
Signed-off-by: Jean Privat <[email protected]>
  • Loading branch information
privat committed Jun 23, 2024
1 parent daba0bf commit ca2c650
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions contrib/nitcc/src/nitcc_semantic.nit
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ private class CheckNameVisitor
var plusizes = new HashMap[Element, Production]

# Create a + version of an element
#
# ```
# foo = x bar+ y | z ;
# ```
#
# becomes
#
# ```
# foo = x abs0 y | z ;
# abs0 = {one:} bar | {more:} abs0 bar ;
# ```
fun plusize(e: Element): Production
do
if plusizes.has_key(e) then return plusizes[e]
Expand All @@ -142,6 +153,17 @@ private class CheckNameVisitor
var quesizes = new HashMap[Element, Production]

# Create a ? version of an element
#
# ```
# foo = x bar? y | z ;
# ```
#
# becomes
#
# ```
# foo = x abs0 y | z ;
# abs0 = {one:} bar | {none} Empty ;
# ```
fun quesize(e: Element): Production
do
if quesizes.has_key(e) then return quesizes[e]
Expand Down

0 comments on commit ca2c650

Please sign in to comment.