             </ul>
             <ul id="panel-content-body" class="list-group">
                 <li class="list-item" v-repeat="body.goal">
-                    <button class='no-btn text-info' v-on="click: jumpToGoal(goalIndex)">{{goalIndex}}</button>
+                    <button class='no-btn text-info' v-on="click: jumpToGoal(index)">{{index}}</button>
                     <span>:</span>
-                    <type input="{{goalType}}"></type>
+                    <type input="{{body}}"></type>
                 </li>
                 <li class="list-item" v-repeat="body.term">
-                    <span class="text-success">{{termIndex}}</span>
+                    <span class="text-success">{{index}}</span>
                     <span>:</span>
-                    <type input="{{termType}}"></type>
+                    <type input="{{body}}"></type>
                 </li>
                 <li class="list-item" v-repeat="body.meta">
-                    <span class="text-success">{{metaIndex}}</span>
+                    <span class="text-success">{{index}}</span>
                     <span>:</span>
-                    <type input="{{metaType}}"></type><span class="location text-subtle">{{location}}</span>
+                    <type input="{{body}}"></type><span class="location text-subtle">{{location}}</span>
                 </li>
                 <li class="list-item" v-repeat="body.sort">
-                    <span class="text-highlight">Sort</span> <span class="text-warning">{{sortIndex}}</span><span class="location text-subtle">{{location}}</span>
+                    <span class="text-highlight">Sort</span> <span class="text-warning">{{index}}</span><span class="location text-subtle">{{location}}</span>
                 </li>
                 <li class="list-item" v-repeat="body.value">
                     <type input="{{value}}"></type>

_   = require 'lodash'
require './body/type'

parseHeaderRegex = /^(Goal|Have)\: ((?:\n|.)+)/
parseHeader = (str) ->
    result = str.match parseHeaderRegex
    label: result[1]
    type: result[2]

parseBodyRegex = /(?:^(\?\d+) \: ((?:\n|.)+))|(?:^([^\_].*) \: ((?:\n|.)+))|(?:(?:^Sort (.+))|(?:^(.+) : ([^\[]*))) \[ at (((?:\/[a-zA-Z_\-\s0-9\.]+)+)\.agda\:(?:(\d+)\,(\d+)\-(\d+)|(\d+)\,(\d+)\-(\d+)\,(\d+))) \]/
parseBody = (str) ->
    result = str.match parseBodyRegex
    if result
        # goal
        goalIndex: result[1]
        goalType: result[2]
        # term
        termIndex: result[3]
        termType: result[4]
        # sort
        sortIndex: result[5]
        # meta
        metaIndex: result[6]
        metaType: result[7]
        # location
        location: result[8]
        # filepath: result[8]
        # lineNo: result[9]
        # charStart: result[10]
        # charEnd: result[11]
    else
        value: str

# divide content into header and body
# divideContent : [String] -> { header :: [String], body :: [String] }

            set: (content) ->
                if content.type is 'value' or content.type is 'type-judgement'
                    {header, body} = divideContent content.body

                    @header = concatJudgements(header).map parseHeader

                    items = concatJudgements(body).map(parseBody)
                    @body =
                        goal: _.filter(items, type: 'goal')
                        term: _.filter(items, type: 'term')
                        meta: _.filter(items, type: 'meta')
                        sort: _.filter(items, type: 'sort')

                else
                    @header = []
