Parsing html and xml can be hard. For example, the javascript in a <script> element might build a string that includes "</script>". It's hard to prevent a regex from ending its match at that point.
On Tuesday, November 19, 2024 at 10:33:18 AM UTC-5 Edward K. Ream wrote: > On Tue, Nov 19, 2024 at 7:57 AM Edward K. Ream <[email protected]> wrote: > > The colorizer would maintain a stack of *delegated modes*. For example, >> jedit would switch from "html mode" to "javascript" mode when it saw >> "delegate"="javascript". >> >> >> *Somehow*, the colorer must pop the stack when the javascript mode sees >> the ending `>`. >> > > Aha: The mode files can *tell* the colorizer when to pop the stack. > Something like: > > colorizer.end_delegated_mode() > > end_delegated_mode will pop the mode stack, but only if the mode stack > isn't empty. > > This scheme is easy and safe! > > Edward > -- 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 view this discussion visit https://groups.google.com/d/msgid/leo-editor/64b0d389-cb6a-4a71-9bf7-478592107257n%40googlegroups.com.
