@@ -119,6 +119,7 @@ else if (str.endsWith("class") || str.endsWith("interface")){
119119 boolean isInterface = str .contains ("interface" );
120120 cls .setInterface (isInterface );
121121 addMembers (cls , s .substring (start , end ));
122+ cls .setPosition (i );
122123 classes .add (cls );
123124
124125
@@ -218,7 +219,7 @@ private static void addMembers(Class cls, String s){
218219 boolean isInterface = word .toString ().equals ("interface" );
219220 innerClass .setInterface (isInterface );
220221 addMembers (innerClass , s .substring (start , end ));
221-
222+ innerClass . setPosition ( nextWord . end );
222223 cls .addMember (innerClass );
223224 }
224225
@@ -283,6 +284,7 @@ private static void addMembers(Class cls, String s){
283284 }
284285 method .setPublic (isPublic );
285286 method .setDescription (comment .getDescription ());
287+ method .setPosition (word .end );
286288 cls .addMember (method );
287289
288290
@@ -386,6 +388,7 @@ else if (b<a || d<a){ //found property or class
386388 property .setType (type );
387389 property .setStatic (isStatic );
388390 property .setDefaultValue (defaultValue );
391+ property .setPosition (word .end );
389392 cls .addMember (property );
390393
391394
@@ -922,11 +925,13 @@ private static ArrayList<Class> getClasses(String s){
922925 cls .setNamespace (namespace );
923926 Comment comment = parseComment (fn .get ("comment" ).toString ());
924927 cls .setDescription (comment .getDescription ());
928+ cls .setPosition (i );
925929 classes .add (cls );
926930
927931
928932 //Add constructor
929933 Constructor contructor = new Constructor (functionName );
934+ contructor .setPosition (start );
930935 for (Parameter parameter : getParameters (params , comment .getAnnotations ())){
931936 contructor .addParameter (parameter );
932937 }
@@ -986,6 +991,7 @@ private static ArrayList<Method> getFunctions(String s){
986991 Method function = new Method (functionName );
987992 function .setDescription (comment .getDescription ());
988993 function .setPublic (fn .get ("isPublic" ).toBoolean ());
994+ function .setPosition (word .end );
989995 functions .add (function );
990996
991997
@@ -1269,6 +1275,7 @@ private static ArrayList<Config> parseConfig(String defaultConfig){
12691275 String key = prevWord .toString ().trim ();
12701276 Config config = new Config (key );
12711277 config .setDescription (parseComment (prevWord .lastComment ).getDescription ());
1278+ config .setPosition (prevWord .end );
12721279 arr .add (config );
12731280
12741281 //Get config value and update i
@@ -1286,6 +1293,7 @@ else if (str.endsWith(":")){
12861293 String key = str .substring (0 , str .length ()-1 );
12871294 Config config = new Config (key );
12881295 config .setDescription (parseComment (word .lastComment ).getDescription ());
1296+ config .setPosition (word .end );
12891297 arr .add (config );
12901298
12911299
@@ -1299,6 +1307,7 @@ else if (str.startsWith(":")){
12991307 String key = prevWord .toString ().trim ();
13001308 Config config = new Config (key );
13011309 config .setDescription (parseComment (prevWord .lastComment ).getDescription ());
1310+ config .setPosition (prevWord .end );
13021311 arr .add (config );
13031312
13041313
@@ -1328,6 +1337,7 @@ else if (str.contains(":")){
13281337
13291338 Config config = new Config (key );
13301339 config .setDescription (parseComment (word .lastComment ).getDescription ());
1340+ config .setPosition (word .end );
13311341 arr .add (config );
13321342
13331343 //Get config value and update i
0 commit comments