Notice that the begin/end construct is necessary because multiple statements appear in the always statement. This is analogous to {} in C or Java. The begin/end was not needed in the flopr example because if/else counts as a single statement.
VHDL
library IEEE; use IEEE.STD_LOGIC_1164.all;
entity sync is
port(clk: in STD_LOGIC;
d: in STD_LOGIC;
q: out STD_LOGIC);
end;
architecture ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.