# HG changeset patch # User lost # Date 1261287647 0 # Node ID 6363b9ebf8257d8254727312b102ecb5307babbc # Parent c7a41b4c89b3c1927420f2614b7317be65d32a97 Support files with line numbers in lwasm diff -r c7a41b4c89b3 -r 6363b9ebf825 ChangeLog --- a/ChangeLog Sat Dec 19 06:38:43 2009 +0000 +++ b/ChangeLog Sun Dec 20 05:40:47 2009 +0000 @@ -35,6 +35,8 @@ [ ] Added rejection for comment not starting at start of line but which looks like a symbol (single word ending in :, no space after ; or *) [LWASM] +[ ] Support input files with line numbers for compatibility with EDTASM + and others that use line numbers [LWASM] Version 2.5 diff -r c7a41b4c89b3 -r 6363b9ebf825 lwasm/parse.c --- a/lwasm/parse.c Sat Dec 19 06:38:43 2009 +0000 +++ b/lwasm/parse.c Sun Dec 20 05:40:47 2009 +0000 @@ -60,6 +60,18 @@ // also used by some pseudo ops on pass 2 if (as -> passnum == 1) l -> codeaddr = as -> addr; + + // check if there is a line number and ignore it if there is + if (isdigit(*p)) + { + for (p2 = p; *p2 && isdigit(*p2); p2++) + /* do nothing */ ; + + // we have a line number, skip it and the *first* + // whitespace character + if (!*p2 || isspace(*p2)) + p = p2 + 1; + } // if it's a comment, return (this doesn't cause a context change) if (*p == '*' || *p == ';')