JSDOC/ScopeParser.vala
[gnome.introspection-doc-generator] / JSDOC / ScopeParser.vala
index 759df16..38e73ab 100644 (file)
@@ -845,22 +845,20 @@ namespace JSDOC {
            //assert token.getType() == Token.RP; // )
        }
        
-       parseFunctionDeclaration : function(scope) 
+       void parseFunctionDeclaration (Scope scope) 
        {
            //print("PARSE FUNCTION");
-           var symbol;
-           var token;
            
            var fnScope = false;
-           var identifier;
+           
            var b4braceNesting = this.braceNesting + 0;
            
            //this.logR("<B>PARSING FUNCTION</B>");
            
 
-           token = this.ts.nextTok();
+           var token = this.ts.nextTok();
            if (token.type == "NAME") {
-               if (this.mode == 'BUILDING_SYMBOL_TREE') {
+               if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                    // Get the name of the function and declare it in the current scope.
                    symbol = token.data;
                    if (scope.getIdentifier(symbol,token) != false) {
@@ -879,9 +877,9 @@ namespace JSDOC {
                 
            }
            
-           
+           Scope fnScope;
            //assert token.getType() == Token.LP;
-           if (this.mode == 'BUILDING_SYMBOL_TREE') {
+           if (this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                fnScope = new Scope(1, scope, token.n, '', token);
                
                //println("STORING SCOPE" + this.ts.cursor);
@@ -896,13 +894,13 @@ namespace JSDOC {
            //  print('FUNC-PARSE:' + JSON.stringify(token,null,4));
            // Parse function arguments.
            var args = token.items;
-           for (var argpos =0; argpos < args.length; argpos++) {
+           for (var argpos =0; argpos < args.size; argpos++) {
                 
-               token = args[argpos][0];
+               token = args.get(argpos).get(0);
                //print ("FUNC ARGS: " + token.toString())
                //assert token.getType() == Token.NAME ||
                //        token.getType() == Token.COMMA;
-               if (token.type == 'NAME' && this.mode == 'BUILDING_SYMBOL_TREE') {
+               if (token.type == "NAME" && this.mode == ScopeParserMode.BUILDING_SYMBOL_TREE) {
                    symbol = token.data;
                    identifier = fnScope.declareIdentifier(symbol,token);
                    if (symbol == "$super" && argpos == 0) {