D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
SyntaxSuggest
/
CodeSearch
/
Filename :
cdesc-CodeSearch.ri
back
Copy
U:RDoc::NormalClass[iI"CodeSearch:ETI"SyntaxSuggest::CodeSearch;TI"Object;To:RDoc::Markup::Document:@parts[o;;[o:RDoc::Markup::Paragraph;[I"%Searches code for a syntax error;To:RDoc::Markup::BlankLine o; ;[I"2There are three main phases in the algorithm:;T@o:RDoc::Markup::List: @type:NUMBER:@items[o:RDoc::Markup::ListItem:@label0;[o; ;[I"!Sanitize/format input source;To;;0;[o; ;[I"Search for invalid blocks;To;;0;[o; ;[I"3Format invalid blocks into something meaninful;T@o; ;[I"!This class handles the part.;T@o; ;[I".The bulk of the heavy lifting is done in:;T@o:RDoc::Markup::Verbatim;[I"g- CodeFrontier (Holds information for generating blocks and determining if we can stop searching) ;TI">- ParseBlocksFromLine (Creates blocks into the frontier) ;TI"A- BlockExpand (Expands existing blocks to search more code) ;T:@format0o; ;[I"## Syntax error detection;T@o; ;[I"DWhen the frontier holds the syntax error, we can stop searching;T@o;;[I"%search = CodeSearch.new(<<~EOM) ;TI" def dog ;TI" def lol ;TI" end ;TI" EOM ;TI" ;TI"search.call ;TI" ;TI",search.invalid_blocks.map(&:to_s) # => ;TI"# => ["def lol\n"];T;0: @fileI"&lib/syntax_suggest/code_search.rb;T:0@omit_headings_from_table_of_contents_below0;0;0[ [ I"code_lines;TI"R;T:publicFI"&lib/syntax_suggest/code_search.rb;T[ I" frontier;T@G:privateF@H[ I"invalid_blocks;T@G;F@H[ I"record_dir;T@G;F@H[ [ [[I" class;T[[;[[I"new;T@H[:protected[ [;[ [I" instance;T[[;[ [I" call;T@H[I"'create_blocks_from_untracked_lines;T@H[I"expand_existing;T@H[I" push;T@H[I"record;T@H[;[ [;[ [ [U:RDoc::Context::Section[i 0o;;[ ;0;0[@CI"SyntaxSuggest;TcRDoc::NormalModule