Syntax errors don't show on correct line

Syntax errors don't show on correct line

Hi Zoho,
I've noticed that I get "improper statement" errors with unhelpful line numbers.

E.g. try compiling some code like this:

  1. //send out editorial writer emails
  2. for each booking in input.Edition_Bookings
  3. {
  4. //check whether an email has already been sent to this writer
  5. writer_obj = Editorial_Writer[ID == booking.Editorial_Writer];
  6. writer_email_address=writer_obj.Email;
  7. email_sent_to=booking.Email_sent_to_editor_email;
  8. if(email_sent_to  !=  writer_email_address)
  9. {
  10. //either no email has been sent to any writer, or the editorial writer has been changed
  11. //therefore send out email
  12. booking.Email_sent_to_editor_email=writer_email_address;
  13. //retrieve email template
  14. template_HTML = Email_Template[Template_Name == "Editorial Writer Assignment"].Template_Content;
  15. //replace shortcodes with variables
  16. template_HTML = template_HTML.replaceAll("<writer name>",writer_obj.Name,false);
  17. template_HTML = template_HTML.replaceAll("<Client Name>",booking.Advertiser_Name,false);
  18. template_HTML = template_HTML.replaceAll("<Client Contact>",booking.Advertiser_Contact,false);
  19. template_HTML = template_HTML.replaceAll("<Client Mobile>",booking.Advertiser_Phone,false);
  20. template_HTML = template_HTML.replaceAll("<Client Email>",booking.Advertiser_Email,false);
  21. template_HTML = template_HTML.replaceAll("<Publication Name>",booking.Publication_Name,false);
  22. template_HTML = template_HTML.replaceAll("<Special Instructions>",booking.Special_Instruction,false);
  23. template_HTML = template_HTML.replaceAll("<Copy in due date>",booking.Copy_Due,false);
  24. template_HTML = template_HTML.replaceAll("<Photograph Required>",booking.Photograph_required,false);
  25. template_HTML = template_HTML.replaceAll("<approximate word count>",booking.Approx_Word_Count,false);
  26. sendmail
  27. [
  28. From : "molly@morningtonlife.com.au"
  29. To : writer_email_address 
  30. Subject : "Congrats! You've been selected to write an editorial for " + booking.Advertiser_Name 
  31. Message : template_HTML
  32. ];
  33. }
  34. }

  35. //send out proof check email if new proof added
  36. for each proof_upload_id in input.Proof_21
  37. {
  38. proof_upload = Proof_Upload[ID == proof_upload_id];
  39. if (!proof_upload.Emailed_to_advertiser)
  40. {
  41. //get advertiser email
  42. client_account_obj = zoho.crm.getRecordById(("Accounts"), input.Client_Account_ID);
  43. advertiser_email = (client_account_obj).get("Email");
  44. //retrieve email template
  45. template_HTML = Email_Template[Template_Name == "Proof Check Email"].Template_Content;
  46. //replace shortcodes with variables
  47. template_HTML = template_HTML.replaceAll("<advertiser name>",input.Client_Account,false));
  48. proof_link = "<a href='" + proof_upload.Dropbox_Link + "'>here</a>";
  49. template_HTML = template_HTML.replaceAll("<proof link>",proof_link,false));
  50. //get publication details
  51. booking_obj = Edition_Booking[ID == proof_upload.Edition_Booking];
  52. template_HTML = template_HTML.replaceAll("<publication name>",booking_obj.Publication_Name,false));
  53. pub_date_obj = Publication_Date[ID == booking_obj.Publication_Date];
  54. template_HTML = template_HTML.replaceAll("<publication date>",pub_date_obj.Publication_Date,false));
  55. //add approve link using CSS button generator for format
  56. approve_link = "<a href=\"https://creator.zoho.com/bigbangmedia/big-bang-media-p-l-advertising-agreement/view-embed/Approve_Proof/proof_id=" + proof_upload_id + "\" class=\"approve_proof_button\">Approve Proof</a>";
  57. template_HTML = template_HTML.replaceAll("<approve link>",approve_link,false));
  58. sendmail
  59. [
  60. From : "molly@morningtonlife.com.au"
  61. To : advertiser_email
  62. Subject : "Please give feedback on your updated proof for publication in " + booking_obj.Publication_Name
  63. Message : template_HTML
  64. ];
  65. }
  66. }
There is a bug with the replaceAll calls. They have two closing brackets )) instead of one. The error number should thus be on line 51. But it shows at line 39 at the start of a for statement.