@@ -14,22 +14,22 @@ function Diagram() {
1414/*
1515 * Return an existing actor with this alias, or creates a new one with alias and name.
1616 */
17- Diagram . prototype . getActor = function ( alias , name ) {
17+ Diagram . prototype . getActor = function ( alias , name , lineno ) {
1818 alias = alias . trim ( ) ;
1919
2020 var i , actors = this . actors ;
2121 for ( i in actors ) {
2222 if ( actors [ i ] . alias == alias )
2323 return actors [ i ] ;
2424 }
25- i = actors . push ( new Diagram . Actor ( alias , ( name || alias ) , actors . length ) ) ;
25+ i = actors . push ( new Diagram . Actor ( alias , ( name || alias ) , actors . length , lineno ) ) ;
2626 return actors [ i - 1 ] ;
2727} ;
2828
2929/*
3030 * Parses the input as either a alias, or a "name as alias", and returns the corresponding actor.
3131 */
32- Diagram . prototype . getActorWithAlias = function ( input ) {
32+ Diagram . prototype . getActorWithAlias = function ( input , lineno ) {
3333 input = input . trim ( ) ;
3434
3535 // We are lazy and do some of the parsing in javascript :(. TODO move into the .jison file.
@@ -42,41 +42,47 @@ Diagram.prototype.getActorWithAlias = function(input) {
4242 name = alias = input ;
4343 }
4444
45- return this . getActor ( alias , name ) ;
45+ return this . getActor ( alias , name , lineno ) ;
4646} ;
4747
48- Diagram . prototype . setTitle = function ( title ) {
49- this . title = title ;
48+ Diagram . prototype . setTitle = function ( title , lineno ) {
49+ this . title = {
50+ message : title ,
51+ lineno : lineno
52+ } ;
5053} ;
5154
5255Diagram . prototype . addSignal = function ( signal ) {
5356 this . signals . push ( signal ) ;
5457} ;
5558
56- Diagram . Actor = function ( alias , name , index ) {
59+ Diagram . Actor = function ( alias , name , index , lineno ) {
5760 this . alias = alias ;
5861 this . name = name ;
5962 this . index = index ;
63+ this . lineno = lineno ;
6064} ;
6165
62- Diagram . Signal = function ( actorA , signaltype , actorB , message ) {
66+ Diagram . Signal = function ( actorA , signaltype , actorB , message , lineno ) {
6367 this . type = "Signal" ;
6468 this . actorA = actorA ;
6569 this . actorB = actorB ;
6670 this . linetype = signaltype & 3 ;
6771 this . arrowtype = ( signaltype >> 2 ) & 3 ;
68- this . message = message ;
72+ this . message = message ;
73+ this . lineno = lineno ;
6974} ;
7075
7176Diagram . Signal . prototype . isSelf = function ( ) {
7277 return this . actorA . index == this . actorB . index ;
7378} ;
7479
75- Diagram . Note = function ( actor , placement , message ) {
80+ Diagram . Note = function ( actor , placement , message , lineno ) {
7681 this . type = "Note" ;
7782 this . actor = actor ;
7883 this . placement = placement ;
7984 this . message = message ;
85+ this . lineno = lineno ;
8086
8187 if ( this . hasManyActors ( ) && actor [ 0 ] == actor [ 1 ] ) {
8288 throw new Error ( "Note should be over two different actors" ) ;
0 commit comments