@@ -13,7 +13,7 @@ function Diagram() {
1313/* 
1414 * Return an existing actor with this alias, or creates a new one with alias and name. 
1515 */ 
16- Diagram . prototype . getActor  =  function ( alias ,  name )  { 
16+ Diagram . prototype . getActor  =  function ( alias ,  name ,   lineno )  { 
1717  alias  =  alias . trim ( ) ; 
1818
1919  var  i ; 
@@ -23,14 +23,14 @@ Diagram.prototype.getActor = function(alias, name) {
2323      return  actors [ i ] ; 
2424    } 
2525  } 
26-   i  =  actors . push ( new  Diagram . Actor ( alias ,  ( name  ||  alias ) ,  actors . length ) ) ; 
26+   i  =  actors . push ( new  Diagram . Actor ( alias ,  ( name  ||  alias ) ,  actors . length ,   lineno ) ) ; 
2727  return  actors [  i  -  1  ] ; 
2828} ; 
2929
3030/* 
3131 * Parses the input as either a alias, or a "name as alias", and returns the corresponding actor. 
3232 */ 
33- Diagram . prototype . getActorWithAlias  =  function ( input )  { 
33+ Diagram . prototype . getActorWithAlias  =  function ( input ,   lineno )  { 
3434  input  =  input . trim ( ) ; 
3535
3636  // We are lazy and do some of the parsing in javascript :(. TODO move into the .jison file. 
@@ -43,41 +43,47 @@ Diagram.prototype.getActorWithAlias = function(input) {
4343  }  else  { 
4444    name  =  alias  =  input ; 
4545  } 
46-   return  this . getActor ( alias ,  name ) ; 
46+   return  this . getActor ( alias ,  name ,   lineno ) ; 
4747} ; 
4848
49- Diagram . prototype . setTitle  =  function ( title )  { 
50-   this . title  =  title ; 
49+ Diagram . prototype . setTitle  =  function ( title ,  lineno )  { 
50+   this . title  =  { 
51+     message : title , 
52+     lineno : lineno 
53+   } ; 
5154} ; 
5255
5356Diagram . prototype . addSignal  =  function ( signal )  { 
5457  this . signals . push ( signal ) ; 
5558} ; 
5659
57- Diagram . Actor  =  function ( alias ,  name ,  index )  { 
58-   this . alias  =  alias ; 
59-   this . name   =  name ; 
60-   this . index  =  index ; 
60+ Diagram . Actor  =  function ( alias ,  name ,  index ,  lineno )  { 
61+   this . alias    =  alias ; 
62+   this . name     =  name ; 
63+   this . index    =  index ; 
64+   this . lineno   =  lineno ; 
6165} ; 
6266
63- Diagram . Signal  =  function ( actorA ,  signaltype ,  actorB ,  message )  { 
67+ Diagram . Signal  =  function ( actorA ,  signaltype ,  actorB ,  message ,   lineno )  { 
6468  this . type        =  'Signal' ; 
6569  this . actorA      =  actorA ; 
6670  this . actorB      =  actorB ; 
6771  this . linetype    =  signaltype  &  3 ; 
6872  this . arrowtype   =  ( signaltype  >>  2 )  &  3 ; 
6973  this . message     =  message ; 
74+   this . lineno      =  lineno ; 
7075} ; 
7176
7277Diagram . Signal . prototype . isSelf  =  function ( )  { 
7378  return  this . actorA . index  ==  this . actorB . index ; 
7479} ; 
7580
76- Diagram . Note  =  function ( actor ,  placement ,  message )  { 
81+ Diagram . Note  =  function ( actor ,  placement ,  message ,   lineno )  { 
7782  this . type       =  'Note' ; 
7883  this . actor      =  actor ; 
7984  this . placement  =  placement ; 
8085  this . message    =  message ; 
86+   this . lineno     =  lineno ; 
8187
8288  if  ( this . hasManyActors ( )  &&  actor [ 0 ]  ==  actor [ 1 ] )  { 
8389    throw  new  Error ( 'Note should be over two different actors' ) ; 
0 commit comments