diff options
author | seb <seb@seb-U36JC> | 2011-11-24 09:21:36 +0000 |
---|---|---|
committer | seb <seb@seb-U36JC> | 2011-11-24 09:21:36 +0000 |
commit | a4e533f1588a5d34dca4ab462b58ddd83eed37c5 (patch) | |
tree | 58bb3b57ec5664e094ae151c18b6c1915256e364 /vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb | |
parent | d473fce1d0451c913d3ef697d3b45bd58c6fff54 (diff) | |
parent | e649c2a7f19d0a75206149d886ff47b3ccda4e91 (diff) |
Merge branch 'develop' into xapian-dcabo
Conflicts:
spec/models/xapian_spec.rb
Diffstat (limited to 'vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb')
-rw-r--r-- | vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb b/vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb new file mode 100644 index 000000000..0a1eb9130 --- /dev/null +++ b/vendor/gems/rdoc-2.4.3/lib/rdoc/tokenstream.rb @@ -0,0 +1,33 @@ +module RDoc; end + +## +# A TokenStream is a list of tokens, gathered during the parse of some entity +# (say a method). Entities populate these streams by being registered with the +# lexer. Any class can collect tokens by including TokenStream. From the +# outside, you use such an object by calling the start_collecting_tokens +# method, followed by calls to add_token and pop_token. + +module RDoc::TokenStream + + def token_stream + @token_stream + end + + def start_collecting_tokens + @token_stream = [] + end + + def add_token(tk) + @token_stream << tk + end + + def add_tokens(tks) + tks.each {|tk| add_token(tk)} + end + + def pop_token + @token_stream.pop + end + +end + |