Problematic machine specification

Matt Mower matt.mo... at gmail.com
Mon Jan 1 18:14:41 UTC 2007


Hi folks.

I'm writing an app that needs to parse the output from svn diff
although not to any great degree of detail. For various reasons (blame
Zed!) I decided to use this as an opportunity to learn Ragel.

With a lot of help from Zed I have something that seems close but
isn't quite working. The problem section revolves around the contents
of a diff hunk. This looks something like:

@@ -205,3 +205,15 @@
 .hugeTag {
  font-size: 125%;
 }
+
+.asp_timestamp_col {
...

the first three lines after the line beginning @@... have a space
prefix (meaning a line common to both files), the next line has a '+'
prefix (meaning a new line). A hunk ends when you reach a line that
doesn't begin with " ", "+", or "-".

The problem is that the machine recognizes the first three lines of my
example (prefixed " ") but comes back with an error when it reaches
the first line prefixed "+". Looking at the diagram (diffBody.png
attached) for the diffBody machine it looks to me as if it should
correctly parse the example.

If anyone can help point out where I am going wrong that would be much
appreciated. I'm not sure if & how I can get it to log the state or
character being processed when the error was raised. That too would be
useful.

My application is being written in Objective-C. So far as I can tell
that doesn't significantly muddy the waters and the O-C bits seem to
be working.

Many thanks,

Matt

-- 
Matt Mower :: http://matt.blogs.it/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DiffParser.m.rl
Type: application/octet-stream
Size: 2098 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel/attachments/20070101/d7a8b028/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diffBody.png
Type: image/png
Size: 101358 bytes
Desc: not available
URL: <http://www.colm.net/pipermail/ragel/attachments/20070101/d7a8b028/attachment.png>


More information about the ragel-users mailing list