Add lexer for the Logtalk programming language
Does the optimizer in the regular expression implementation do a job as good as hand-optimized regular expressions?
Yes.
Requested changes applied.
This should be ready for merging. Let me know if there's any issue remaining.
@pmoura I apologize - I'm still getting used to this github review interface, so I left comments that you never saw. They should be visible now.
There can be no space(s) between a predicate name and its open parenthesis. For example, assertz(...) is call to the standard built-in predicate assertz/1. assertz ( is a syntax error (unless the atom assertz is declared as a prefix operator, which is highly unlikely).
Fair enough for that bit :]
W.r.t. states, my understanding (please correct me if I'm wrong) is that a directive pops to :basic, which then allows it to be followed by e.g. another directive. So, the fix you hint is that is not necessary to mix :directives into :root as we're already mixing :basic? Which would suggest that we could simply replace :basic with :root.
I'm not sure of the fix, but it's dangerous to pop from root, since the state stack can never be empty.
I'm not sure of the fix, but it's dangerous to pop from root, since the state stack can never be empty.
I believe that's now fixed: :directives is no longer mixed into :root. The included comprehensive sample file is highlighted correctly without any errors.
P.S. Should I squash all commits into a single one for merging?