code: def test_foreach_do_syntax_errors(tmp_dir, dvc):
      definition = make_foreach_def(
          tmp_dir,
          "build",
          ["foo", "bar"],
          {"cmd": "echo ${syntax.[error}"},
      )
  
      with pytest.raises(ResolveError) as exc_info:
          definition.resolve_all()
  
      assert (
          escape_ansi(str(exc_info.value))
          == "failed to parse 'stages.build.cmd' in 'dvc.yaml':\n"
          "${syntax.[error}\n"
          "        ^\n"
          "ParseException: Expected end of text, found '.'"
          "  (at char 8), (line:1, col:9)"
      )
  
imports: import logging
  import re
  import pytest
  from dvc.parsing import ResolveError
  from dvc.parsing.context import Context
  from dvc.parsing.interpolate import embrace
  from dvc.utils.humanize import join
  from .None import make_entry_definition, make_foreach_def
label_desc: Use image node_id 14 for calling a global function with example usage: test_foreach_do_syntax_errors(tmp_dir, dvc) without return types