comparison lwasm/parse.c @ 255:6363b9ebf825 2.x

Support files with line numbers in lwasm
author lost
date Sun, 20 Dec 2009 05:40:47 +0000
parents c7a41b4c89b3
children 6d09310438a4
comparison
equal deleted inserted replaced
254:c7a41b4c89b3 255:6363b9ebf825
58 58
59 // for output generation later but only on pass 1 59 // for output generation later but only on pass 1
60 // also used by some pseudo ops on pass 2 60 // also used by some pseudo ops on pass 2
61 if (as -> passnum == 1) 61 if (as -> passnum == 1)
62 l -> codeaddr = as -> addr; 62 l -> codeaddr = as -> addr;
63
64 // check if there is a line number and ignore it if there is
65 if (isdigit(*p))
66 {
67 for (p2 = p; *p2 && isdigit(*p2); p2++)
68 /* do nothing */ ;
69
70 // we have a line number, skip it and the *first*
71 // whitespace character
72 if (!*p2 || isspace(*p2))
73 p = p2 + 1;
74 }
63 75
64 // if it's a comment, return (this doesn't cause a context change) 76 // if it's a comment, return (this doesn't cause a context change)
65 if (*p == '*' || *p == ';') 77 if (*p == '*' || *p == ';')
66 return; 78 return;
67 79