struct Novika::Scissors
- Novika::Scissors
- Struct
- Value
- Object
Overview
Scissors deal with cutting a source string into fragments,
known as unclassified forms. They are then fed to an
instance of Classifier
, which determines whether an
unclassified form is actually a decimal, quoted word,
quote, etc. You can think of Scissors as a fancy split-
by-whitespace.
Scissors
and Classifier
are designed to work in tandem.
Separating one from the other is possible and will work, but is
not recommended unless you have read the source code of both.
Defined in:
novika/scissors.crConstructors
Class Method Summary
-
.cut(source : String, & : Int32, Int32, Int32 | Nil -> )
Cuts source into a series of unclassified forms; yields start byte index and byte length of each to the block.
Instance Method Summary
-
#each(&)
Cuts the source string into a series of unclassified forms; yields start byte index, byte length, and first dot
'.'
byte index of each to the block.
Constructor Detail
Class Method Detail
Cuts source into a series of unclassified forms; yields start byte index and byte length of each to the block.
Instance Method Detail
Cuts the source string into a series of unclassified forms;
yields start byte index, byte length, and first dot '.'
byte
index of each to the block.
Dot byte index is yielded to save an O(N) search, which would be otherwise required since '.' is handled specially by several forms in Novika.