List < SnippetEvent > eval ( String userSource ) throws IllegalStateException { List < SnippetEvent > allEvents = new ArrayList <> ( ) ; for ( Snippet snip : sourceToSnippets ( userSource ) ) { if ( snip . kind ( ) == Kind . ERRONEOUS ) { state . maps . installSnippet ( snip ) ; allEvents . add ( new SnippetEvent ( snip , Status . NONEXISTENT , Status . REJECTED , false , null , null , null ) ) ; } else { allEvents . addAll ( declare ( snip , snip . syntheticDiags ( ) ) ) ; } } return allEvents ; }
Evaluates a snippet of source .