summaryrefslogtreecommitdiff
path: root/third_party/re2/src/doc/mksyntaxgo
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/re2/src/doc/mksyntaxgo')
-rwxr-xr-xthird_party/re2/src/doc/mksyntaxgo42
1 files changed, 42 insertions, 0 deletions
diff --git a/third_party/re2/src/doc/mksyntaxgo b/third_party/re2/src/doc/mksyntaxgo
new file mode 100755
index 000000000..d30d28146
--- /dev/null
+++ b/third_party/re2/src/doc/mksyntaxgo
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+set -e
+out=$GOROOT/src/regexp/syntax/doc.go
+cp syntax.txt $out
+sam -d $out <<'!'
+,x g/NOT SUPPORTED/d
+/^Unicode character class/,$d
+,s/[«»]//g
+,x g/^Possessive repetitions:/d
+,x g/\\C/d
+,x g/Flag syntax/d
+,s/.=(true|false)/flag &/g
+,s/^Flags:/ Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z). The flags are:\n/
+,s/\n\n\n+/\n\n/g
+,x/(^.* .*\n)+/ | awk -F' ' '{printf(" %-14s %s\n", $1, $2)}'
+1,2c
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// DO NOT EDIT. This file is generated by mksyntaxgo from the RE2 distribution.
+
+/*
+Package syntax parses regular expressions into parse trees and compiles
+parse trees into programs. Most clients of regular expressions will use the
+facilities of package regexp (such as Compile and Match) instead of this package.
+
+Syntax
+
+The regular expression syntax understood by this package when parsing with the Perl flag is as follows.
+Parts of the syntax can be disabled by passing alternate flags to Parse.
+
+.
+$a
+Unicode character classes are those in unicode.Categories and unicode.Scripts.
+*/
+package syntax
+.
+w
+q
+!