On Monday, November 28, 2016 at 10:54:48 AM UTC-6, Edward K. Ream wrote:

> Anyone who wants to understand the importers should read this post 
carefully...

> There probably are languages in which a pattern could match on a line 
*after* the close of a comment or string.

This got me thinking about the differences between line-oriented and 
character-oriented scanners.  There are surprisingly few.

*tl;dr:* Hehe.  Read the summary...

*Summary* 

- i.v2_gen_lines matches patterns *only *at the end of the previous line. 
This is a merely a useful *convenience*. Overrides (x.v2_gen_lines) could 
match patterns after every call to i.scan_dict.  This proves that *any* 
language can be handled correctly. 

- i.scan_dict (and i.scan_table) are character oriented. They are 
surprisingly similar to the scanning code in the old importers, except that 
they are faster and more elegant ;-)

- The new line-oriented api is the other reason (besides i.v2_gen_lines) 
that the new importers are line-oriented. The new importers only ever add 
whole lines to blocks. This eliminates *all *character-oriented fiddling, a 
huge simplification compared to the old importers.

EKR

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to