A bunch more questions!

2 views
Skip to first unread message

Ram Rachum

unread,
Jan 24, 2014, 11:42:34 AM1/24/14
to shp...@googlegroups.com
1. What does PASS do? I couldn't figure it out. 

2. I've noticed that Shpaml is written using regex and imperative code, rather than defined as a grammar and using a parser package, which smells like the smarter solution. Is this intentional? What do you think about implementing Shpaml using a parser?


Steve Howell

unread,
Jan 24, 2014, 2:39:12 PM1/24/14
to shp...@googlegroups.com
PASS does the same thing that "pass" does in Python; it basically allows you to specify an empty block without confusing the indentation scheme.

The design choices to use regexes and imperative code were very intentional.  It would be interesting to see a formal-grammar approach to the problem.  There would be some challenges due to the indentation awareness and fact that you're wrapping arbitrary HTML.



On Friday, January 24, 2014 11:42 AM, Ram Rachum <ram.r...@gmail.com> wrote:
1. What does PASS do? I couldn't figure it out. 

2. I've noticed that Shpaml is written using regex and imperative code, rather than defined as a grammar and using a parser package, which smells like the smarter solution. Is this intentional? What do you think about implementing Shpaml using a parser?


--
You received this message because you are subscribed to the Google Groups "shpaml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shpaml+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Ram Rachum

unread,
Jan 24, 2014, 2:42:51 PM1/24/14
to shp...@googlegroups.com
On Fri, Jan 24, 2014 at 9:39 PM, Steve Howell <show...@yahoo.com> wrote:
PASS does the same thing that "pass" does in Python; it basically allows you to specify an empty block without confusing the indentation scheme.

Out of curiosity, what is an empty block good for? How is it better than ending with || ?
 

The design choices to use regexes and imperative code were very intentional.  It would be interesting to see a formal-grammar approach to the problem.  There would be some challenges due to the indentation awareness and fact that you're wrapping arbitrary HTML.

I understand. 
 



On Friday, January 24, 2014 11:42 AM, Ram Rachum <ram.r...@gmail.com> wrote:
1. What does PASS do? I couldn't figure it out. 

2. I've noticed that Shpaml is written using regex and imperative code, rather than defined as a grammar and using a parser package, which smells like the smarter solution. Is this intentional? What do you think about implementing Shpaml using a parser?


--
You received this message because you are subscribed to the Google Groups "shpaml" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shpaml+un...@googlegroups.com.


--
You received this message because you are subscribed to a topic in the Google Groups "shpaml" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/shpaml/bcTIRXNzv2Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to shpaml+un...@googlegroups.com.

James Robert

unread,
Jan 24, 2014, 3:23:30 PM1/24/14
to shp...@googlegroups.com
Also, ending a line with || produces a block with no content (i.e., <div></div>) whereas using PASS results in a block with whitespace:

<div>
</div>

I'm not 100% sure, but I think the || notation was added later on in order to produce tags with no whitespace

Steve Howell

unread,
Jan 24, 2014, 7:00:34 PM1/24/14
to shp...@googlegroups.com
PASS did come first, and it was very analogous to Python's "pass".  In Python you should almost never have "pass" in your final code; it's usually just a placeholder while you're debugging or something.  Similar here.  There are strange edge cases where it's nice to have it to not have to reindent stuff.
Reply all
Reply to author
Forward
0 new messages