Re: [Pyparsing] need help building parsing framework for disability access tool
Brought to you by:
ptmcg
From: Eric S.. J. <es...@es...> - 2012-09-16 18:02:13
|
found a couple of interesting problems. ----- Original Message ----- if you remember, only the first few lines were printing out. > > I get the below which is only the first few lines. why not the rest? > > i, j = ['script', [['url', ['/files/tw-sack.js']]], []] > i, j = ['script', [['url', ['/files/logic.js']]], []] > i, j = ['script', [['url', ['/files/ak_vacation.js']]], []] > i, j = ['script', [['body', ['onload=', '"doSomething()"']]], []] > i, j = ['title', [], ['Out-of-Office E-mail Setup']] > after a bunch of guessing, fiddling and reading, I figured out something from the debugging logs. > > Exception raised:Expected "[" (at char 1834), (line:77, col:20) [span[class label] once you've made changes to the above information, you must save it so it can take effect] I added the missing space after "span" and the problem went away. As a sidenote, while I don't think this space is technically required after a keyword or argument name, I think it's a good idea. Anyway, a new error showed up. File "/home/esj/projects/akasha/akasha_test/vacation_test.akasha", line 19 onload="doSomething()" ^ SyntaxError: invalid syntax [Finished in 0.1s with exit code 1] I've tried triple quoting it but no luck. I am not sure how to change the parser to handle this. remember that after the keyword, after all the arguments are complete, there is a free text region to the end defined as a]. The region may be triple quoted but probably won't be unless there's something that needs protecting or escaping. The free format text may also contain more keywords as in: [bold this is some [reveal special] text] Which has this whole recursive vibe going on. other generic problems [span [class label]I want the message to say:] there is no need for a space before or after a closing bracket see examples: [div [class center]] [textarea [class data] [reveal_raw message] [name message] [rows 7] [columns 50]] [div [class center] [button [name commit] [class button] [value save] [type submit]] ] ideas?? |