summaryrefslogtreecommitdiff
path: root/regcomp.sym
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2019-09-26 16:23:33 -0600
committerKarl Williamson <khw@cpan.org>2019-09-27 11:20:34 -0600
commite21ef6928fa32f8c21414f00ec4a6cae741dec7a (patch)
tree82519389bfd72666c2cc6b15ad76ce1201851b94 /regcomp.sym
parent27c3e5ad94fad01593474ee3038849be74be86a0 (diff)
downloadperl-e21ef6928fa32f8c21414f00ec4a6cae741dec7a.tar.gz
regen/regcomp.pl, regcomp.sym: Comments
I spent some time in this code trying to understand some things, and as a result I'm commenting previously undocumented features. The comments about what an entry in regcomp.sym should look like are moved to that file, rather than the file that reads it. The former is most often touched, and they had gotten out-of-sync in the latter. Things now make more sense to me, and hopefully anyone using this in the future.
Diffstat (limited to 'regcomp.sym')
-rw-r--r--regcomp.sym23
1 files changed, 19 insertions, 4 deletions
diff --git a/regcomp.sym b/regcomp.sym
index c69e4c9452..31beb19553 100644
--- a/regcomp.sym
+++ b/regcomp.sym
@@ -11,14 +11,29 @@
# Note that the order in this file is important.
#
# Format for first section:
-# NAME \s+ TYPE, arg-description [num-args] [flags] [longjump] ; DESCRIPTION
+# NAME \s+ TYPE, arg-description [struct regnode suffix] [flags] [longjump] ; DESCRIPTION
+# arg-description is currently unused
+# suffix is appended to 'struct_regnode_' giving which one to use. If empty,
+# it means plain 'struct regnode'. If the regnode is a string one, this
+# should instead refer to the base regnode, without the char[1] element
+# of the structure
# flag <S> means is REGNODE_SIMPLE; flag <V> means is REGNODE_VARIES; <.> is
-# a placeholder
-# longjump is 1 if the (first) argument holds the next offset.
-#
+# a placeholder
+# longjump is 1 if the (first) argument holds the next offset (instead of the
+# usual 'next_offset' field
#
# run perl regen.pl after editing this file
+# +- suffix of which struct regnode to use e.g.,
+# | +- flags (S or V) struct regnode_1
+# un- | | +- longjmp (0, blank, or 1) blank means 0
+# Name Type used | | | ; comment
+# --------------------------------------------------------------------------
+# IFMATCH BRANCHJ, off 1 . 1 ; Succeeds if the following matches.
+# UNLESSM BRANCHJ, off 1 . 1 ; Fails if the following matches.
+# SUSPEND BRANCHJ, off 1 V 1 ; "Independent" sub-RE.
+# IFTHEN BRANCHJ, off 1 V 1 ; Switch, should be preceded by switcher.
+# GROUPP GROUPP, num 1 ; Whether the group matched.
#* Exit points