' Gambas module file

'' Apply the keyword filter to the passed in source line
'' This is an initial implentation, should maybe allow some sort of
'' call to plugins or such, but for now just a bunch of 
'' regular expressions
'' Causes a compile error if anything matches
'' Therefore never returns unless all is well
'' This is a seperate module so as not to load the gb.prc module if not used by the scripter
'' This is expensive the first time a plugin script is processed but of course does not
'' effect the cached plugins that have be created, as they are not processed

Public Sub _Call(sLine As String, KeywordPatternTable As Collection, iLine As Integer, sPath As String)
  
  For Each Pattern As String In KeywordPatternTable
    Verbose(Subst("Script Apply Filter : &1 > &2", Quote(KeywordPatternTable.key), Quote(Pattern)))
    If RegExp.Match(sLine, Pattern) Then 
      CompileError(sPath, iLine, "\nPlugin Error: " & KeywordPatternTable.key & "\nPlugIn Error: " & sLine & "\n")
    Endif
    
  Next
  
  Return 
  
End

