Nullable structure in a repetition

Top  Previous  Next

Messages > Nullable structure in a repetition

 

The meaning of a "(...)+" repeat isn't clear if it contains a nullable structure.

 

Example:

 

( "a"? )+ "b"

 

The structure "( "a"? )+" could be as interpreted as nullable so that an occurrence of b in the text would not produce an error: With the same right one could say progressing directly to b would be wrong since the loop must at least be passed through once. Perhaps a third possibility would be entering the loop once and immediately exiting again before accepting b.

 

In the TextTransformer the occurrence of b in front of the loop is judged to be an error since the +-operator is used presumably with the intention that something shall at least occur in the text once.

 



This page belongs to the TextTransformer Documentation

Home  Content  German