Ejemplo n.º 1
0
        protected override IEnumerable <BFCommand> ParseByRow(string row)
        {
            BFCommand prevCommand = default;

            for (int currentPos = 0; currentPos < row.Length;)
            {
                if (this.TryGetNextCommand(row, currentPos, out var command) && !prevCommand.IsBeginComment())
                {
                    yield return(command);

                    prevCommand = command;
                    currentPos += command.Length;
                    continue;
                }
                else
                {
                    command = this.GetTrivia(row, currentPos, prevCommand.IsBeginComment());
                    yield return(command);

                    prevCommand = command;
                    currentPos += command.Length;
                    continue;
                }
            }
        }
Ejemplo n.º 2
0
 public static bool IsExecutable(this BFCommand command)
 {
     return(!(command.IsUndefined() || command.IsTrivia() || command.IsBeginComment() || command.IsEndComment()));
 }