Skip to content

Commit bd7a478

Browse files
committed
added type type
1 parent a62683b commit bd7a478

File tree

6 files changed

+45
-11
lines changed

6 files changed

+45
-11
lines changed

language.coffee

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,15 @@ module.factory 'interpreter', ($q, $http, $timeout, $rootScope) ->
595595
position: position
596596
implementation: implementation
597597

598+
class Type extends Subroutine
599+
constructor: ->
600+
super
601+
@type_input = new Input
602+
text:''
603+
id:@id
604+
605+
get_call_inputs: -> [@type_input]
606+
598607
class Symbol extends Definition
599608
evaluate: -> @id
600609

@@ -620,6 +629,7 @@ module.factory 'interpreter', ($q, $http, $timeout, $rootScope) ->
620629
Text
621630
Symbol
622631
Lambda
632+
Type
623633
]
624634

625635
definition_class_map = make_index_map definition_classes, 'name'
@@ -1021,6 +1031,7 @@ module.factory 'interpreter', ($q, $http, $timeout, $rootScope) ->
10211031
JavaScript
10221032
CoffeeScript
10231033
Lambda
1034+
Type
10241035

10251036
# literals
10261037
Literal

language.js

Lines changed: 22 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nibs-editor.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,5 @@ <h3>Outputs</h3>
99
</div>
1010
<a ng-click="new_output(definition)">+Output</a>
1111
</div>
12-
<div class="span6">
13-
14-
<h3>Inputs</h3>
15-
<div ng-repeat="input in definition.inputs">
16-
<input ng-model="input.text">
17-
<a ng-click="delete_input(input)">-</a>
18-
</div>
19-
<a ng-click="new_input(definition)">+Input</a>
20-
</div>
12+
<div class="span6" ng-include="'input_editor.html'"></div>
2113
</div>

stuff.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ module.filter 'editor_type', (interpreter) ->
6666
(obj) ->
6767
if obj instanceof interpreter.Lambda
6868
'lambda'
69+
else if obj instanceof interpreter.Type
70+
'type'
6971
else if obj instanceof interpreter.Graph
7072
'graph'
7173
else if obj instanceof interpreter.Code

stuff.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

subroutine.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@
110110
</div>
111111
</div>
112112

113+
<div ng-switch-when="type">
114+
<div ng-include="'definition-options.html'"></div>
115+
<div class="container-fluid">
116+
<div class="span6" ng-include="'input_editor.html'"></div>
117+
</div>
118+
</div>
119+
113120
<div ng-switch-when="code" id="builtin_editor">
114121
<div ng-include="'definition-options.html'"></div>
115122
<label for="stateful"><input id="stateful" type="checkbox" ng-model="definition.stateful">Stateful</label>

0 commit comments

Comments
 (0)