Ticket #3734 (new task)

Opened 3 years ago

Improve the syntax documentation

Reported by: mooffie Owned by:
Priority: major Milestone: Future Releases
Component: mcedit Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

There are several features not documented well, or not documented at all:

[I'll edit this text from time to time to improve and extend it. Everybody: feel free to add comments and I'll incorporate them here. When we're finished we'll convert this to nroff format.]

Star

Matches any length of characters (except newline). To be exact, it matches any character which is not the next one in the pattern. This effectively makes it "non-greedy" and lets you do ${*} to match a shell variable.

Plus

Surprisingly, it does not mean "match 1 or more characters". TODO.

Braces

\{chars\} matches one character.

Brackets

\[chars\] matches 0 or more characters. It's greedy, which means that if chars contains any of the characters appearing later in the pattern then the match will fail. (TODO: what's the purpose of "if (p[1] == d) i--;" introduced in commit df20f28f2e2b614 ?)

Misc

  • Pressing C-s twice effectively reloads the syntax file (so you don't have to exit the editor, or MC itself, to test your syntax modifications).
Note: See TracTickets for help on using tickets.