summaryrefslogtreecommitdiff
path: root/tiger-compiler/tcsh/src/tiger_desugar.i
blob: 94f6b824ae709402902a63b7e17fbaf766ecb4e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// -*- C++ -*-

%module tiger_desugar

%import "tiger_ast.i"

%{
  #include <desugar/libdesugar.hh>
  #include <ast/all.hh>
  #include "swig_real_type.hh"
%}

%rename(desugar) ast_desugar;
%rename(raw_desugar) ast_raw_desugar;

%inline {
ast::Ast* ast_desugar(const ast::Ast& tree,
                        bool desugar_for = false,
                        bool desugar_string_cmp = false)
{
  return desugar::desugar<ast::Ast>(tree, desugar_for, desugar_string_cmp);
}
ast::Ast* ast_raw_desugar(const ast::Ast& tree,
                          bool desugar_for = false,
                          bool desugar_string_cmp = false)
{
  return desugar::raw_desugar<ast::Ast>(tree, desugar_for, desugar_string_cmp);
}
}