Henry,

It's the "for (var k:* in obj)" that got you.
I haven't implement typed vars within the a for (var... in ...) yet.
I'm doing that now.

- Don

On Jan 8, 2008, at 11:30 AM, Henry Minsky wrote:

I got a parser error in this code, apparently the type declaration for
"var s:*" is confusing it

class lzutils {

  public static function objAsString(obj:*):String {
  var s:* = "";
      for (var k:* in obj) {
          s+= k +": "+obj[k];
          s+=", ";
      }
      return s;
  }
}

lzl:
[echo] Compiling C:\users\hqm\openlaszlo\devildog/lps/includes/ lfc/LFC9.lzl
   [java] while compiling
C:\users\hqm\openlaszlo\devildog\WEB-INF\lps\lfc\core\LzDefs.js
   [java] while compiling
C:\users\hqm\openlaszlo\devildog\WEB-INF\lps\lfc\core\Library.lzs
   [java] Exception compiling scriptfile: Syntax error: the token ":
* in" was not expected at this position at line 107, column 19.
   [java] Was expecting one of: in, =, :, :, :
   [java] org.openlaszlo.sc.parser.ParseException: Syntax error: the
token ": * in" was not expected at this position at line 107, column
19.
   [java] Was expecting one of: in, =, :, :, :
   [java]       at
org.openlaszlo.sc.parser.Parser.generateParseException(Parser.java: 9375)
   [java]       at
org.openlaszlo.sc.parser.Parser.jj_consume_token(Parser.java:9250)
   [java]       at
org.openlaszlo.sc.parser.Parser.ForVarInStatement(Parser.java:3561)
   [java]       at
org.openlaszlo.sc.parser.Parser.IterationStatement(Parser.java:3039)
   [java]       at
org.openlaszlo.sc.parser.Parser.ToplevelStatement(Parser.java:2316)
[java] at org.openlaszlo.sc.parser.Parser.Statement(Parser.java: 2408) [java] at org.openlaszlo.sc.parser.Parser.StatementList(Parser.java:4861)
   [java]       at org.openlaszlo.sc.parser.Parser.Block(Parser.java:2647)
   [java]       at
org.openlaszlo.sc.parser.Parser.FunctionDeclaration(Parser.java:4223)
[java] at org.openlaszlo.sc.parser.Parser.ClassProperty(Parser.java:5215) [java] at org.openlaszlo.sc.parser.Parser.ClassDirective(Parser.java:5345)
   [java]       at
org.openlaszlo.sc.parser.Parser.ClassDefinition(Parser.java:5765)
   [java]       at
org.openlaszlo.sc.parser.Parser.ModifiedDefinition(Parser.java:4571)
[java] at org.openlaszlo.sc.parser.Parser.Directive(Parser.java: 4602) [java] at org.openlaszlo.sc.parser.Parser.Program(Parser.java: 4526) [java] at org.openlaszlo.sc.Compiler$Parser.parse0(Compiler.java: 469)


--
Henry Minsky
Software Architect
[EMAIL PROTECTED]


--

Don Anderson
Java/C/C++, Berkeley DB, systems consultant

voice: 617-547-7881
email: [EMAIL PROTECTED]
www: http://www.ddanderson.com




Reply via email to