/** This program lists the functions available in a Frink executable and
    compares it to the functions documented in the official Frink
    documentation. */

docs = read["https://frinklang.org/"]

for f = lexicalSort[functions[]]
{
   [truncFunc] = f =~ %r/([^\[]*)/
   regex = regex[truncFunc + "\\["]
//   println["regex is $regex"]
   if docs =~ regex
   {
      // Fully matched with brackets
   } else
   {
      regex = regex[truncFunc]
      if docs =~ regex
         println["Matched (without brackets) $f"]
      else
         println["Unmatched $f"]
   }
}