Top Level Namespace

Defined Under Namespace

Classes: CompositeSexpProcessor, Examples, MethodBasedSexpProcessor, NotEmptyError, Object, ParseTreeTestCase, Sexp, SexpInterpreter, SexpProcessor, SexpProcessorError, SexpTypeError, Unique, UnknownNodeError, UnsupportedNodeError

Instance Method Summary collapse

Instance Method Details

#s(*args, &blk) ⇒ Object

This is a very important shortcut to make using Sexps much more awesome.

In its normal form s(…), creates a Sexp instance. If passed a block, it creates a Sexp::Matcher using the factory methods on Sexp.

See Matcher and other factory class methods on Sexp.



364
365
366
367
# File 'lib/sexp.rb', line 364

def s *args, &blk
  return Sexp.class_eval(&blk) if blk
  Sexp.new(*args)
end