 
     body: [
       ast: 'subroutine call'
-      name:
-        ast: 'identifier'
-        val: 'writeln'
+      name: 'writeln'
+      type: 'integer'
       args: [
         ast: 'subroutine call'
-        name:
-          ast: 'identifier'
-          val: 'factorial'
+        type: 'integer'
+        name: 'factorial'
         args: [
           ast: 'integer'
           val: 6
+          type: 'integer'
         ]
       ]
     ]
 
+module.exports = AST

    subroutines: [

      ast: 'function'
      name:
        ast: 'identifier'
        val: 'factorial'
      params: [
        ast: 'formal parameter'
        reference: no
        name:
          ast: 'identifier'
          val: 'n'
      ]
      rettype:
        ast: 'identifier'
        val: 'integer'

      declarations:
        ast: 'declarations'

          ast: 'if'
          condition:
            ast: '<='
            type: 'boolean'
            left:
              ast: 'scalar'
              name: 'n'
              type: 'integer'
            right:
              ast: 'integer'
              val: 1
              type: 'integer'
          consequent: [
            ast: 'assignment'
            left:
              ast: 'scalar'
              val: 'fatorial'
              type: 'integer'
            right:
              ast: 'integer'
              val: 1
              type: 'integer'
          ]
          alternative: [
            ast: 'assignment'
            left:
              ast: 'scalar'
              val: 'fatorial'
              type: 'integer'
            right:
              ast: '*'
              type: 'integer'
              left:
                ast: 'scalar'
                val: 'n'
                type: 'integer'
              right:
                ast: 'subroutine call'
                type: 'integer'
                name:
                  ast: 'scalar'
                  val: 'fatorial'
                  type: 'integer'
                args: [
                  ast: '-'
                  left:
                    ast: 'scalar'
                    val: 'n'
                    type: 'integer'
                  right:
                    ast: 'integer'
                    val: 1
                    type: 'integer'
                ]
          ]
        ]
