Hetu Script Language
Guide
Grammar
  • Dart APIs
  • Hetu APIs
  • VS Code extension
Github
  • English
  • 简体中文
  • English
Guide
Grammar
  • Dart APIs
  • Hetu APIs
  • VS Code extension
Github
  • English
  • 简体中文
  • English
  • Introduction
  • Installation
  • Package & Module
  • Communicating with Dart
  • Command line tool
  • Analyzer
  • Implementation detail

Analyzer

WARNING: Type system related tools are not finished right now. It's not recommended to use Analyzer tools & turn on doStaticAnalysis & computeConstantExpression of HetuConfig.

Analyzer is a standalone utility class for analyze a Hetu source.

Example:

import 'package:hetu_script/analyzer.dart';

void main() {
  final hetu = HTAnalyzer();
  hetu.init();
  final result = hetu.eval(r'''
    var i = 'Hello, world!'
  ''');
  if (result != null) {
    if (result.errors.isNotEmpty) {
      print('Analyzer found ${result.errors.length} problems:');
      for (final err in result.errors) {
        print(err);
      }
    } else {
      print('Analyzer found 0 problem.');
    }
  } else {
    print('Unkown error occurred during analysis.');
  }
}

Last Updated: 9/20/22, 4:55 PM
Contributors: hythloday@live.com, 邵燃
Prev
Command line tool
Next
Implementation detail