         'name': 'keyword.functions.data.stata' 
       '10': 
         'name': 'keyword.functions.data.stata' 
-  }       
+  }
+  {
+    'begin': '^\\s*mata:?\\s*$'
+    'comment': 'won\'t match single-line Mata statements'
+    'contentName': 'source.mata'
+    'end': '^\\s*end\\s*$\\n?'
+    'name': 'meta.embedded.block.mata'
+    'patterns': [
+      {
+        'include': 'source.mata'
+      }
+    ]
+  }
 ]
 'repository':
   'builtin_functions':

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

      'match': '[A-Za-z_][A-Za-z0-9_]{0,31}'
  'illegal_names':
      'match':
       '\\b(gen(e|er|era|erat|erate)?|egen)\\s((byte|int|long|float|double|str[1-9]?[0-9]?[0-9]?[0-9]?|strL)?\\s)?(_all|_b|byte|_coef|_cons|double|float|if|in|int|long|_n|_N|_pi|_pred|_rc|_skip|str[0-9]+|strL|using|with|[0-9][A-Za-z0-9_]+|[A-Za-z_][A-Za-z0-9_]{32,})\\b\\s*(///)?\\s*\\n?\\s*='
      'name': 'invalid.illegal.name.stata'
      'comment': 'highlights as illegal if variable name is more than 32 characters'
  'varlist':
