   {
     'comment': 'keywords that delimit flow conditionals'
     'name': 'keyword.control.conditional.stata'
-    'match': '\\b(if|else)\\b'
+    'match': '\\b(if|else if|else)\\b'
+  }
+  {
+    'captures':
+      '1':
+        'name': 'storage.type.scalar.stata'
+    'match': '^\\s*(sca(l|la|lar)?(\\s+de(f|fi|fin|fine)?)?)\\s+(?!(drop|dir?|l(i|is|ist)?)\\s+)'
   }
   {
     'captures':

  'builtin_variables':
    'match': '\\b(_b|_coef|_cons|_n|_N|_rc|_se)\\b'
    'name': 'variable.object.stata'
  'comments':
    'patterns': [
      {

      '1': 'keyword.functions.data.stata.test'
  }
  {
    "captures":
      "1":
        "name": "support.function.models.stata"
    "comment": "model commands."
    "match": "\\b(anova|xtmixed|regress|ivregress|xtreg|xtreg_be|xtreg_fe|xtreg_ml|xtreg_pa_p|xtreg_re|xtregar|xtrere_p|xtset|xtsf_ll|xtsf_llti|xtsum|xttab|xttest0|xttobit|xttobit_8|xttobit_p|xttrans)\\b"
  }

  # Start manual functions:
  {
    'captures':
      '1':
        'name': 'keyword.functions.data.stata'
    'comment': 'one-word commands',
    'match': '\\b(sa(v|ve)|saveold|destring|replace|tostring|u(s|se)?|note(s)?|form(a|at)?)\\b'
  }
  {
    'match': '\\b(exit|end)\\b'
    'name': 'keyword.functions.data.stata'
    'comment': 'programming commands'
  }
  {
    'match': '\\b(g(e|en|ene|erer|enera|enerat|enerate)?|egen)\\s+((byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)?\\s+)?([A-Za-z_][A-Za-z0-9_]{0,31})'
    'captures':
      '1':
        'name': 'keyword.functions.data.stata'
      '3':
        'name': 'support.type.stata'
  }
  {
    'match': '\\b(set ty(p|pe)?)\\s+((byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)?\\s+)'
    'captures':
      '1':
        'name': 'keyword.functions.data.stata'
