1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

tools: update for new format.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-05-11 11:18:49 +09:30
parent 128966e3c0
commit 8ee57b9773
2 changed files with 10 additions and 10 deletions

View File

@ -67,15 +67,15 @@ parser.add_option("--message-fields",
# Example inputs:
# 1. type: 17 (`error`)
# 2. data:
# * [8:channel-id]
# * [4:len]
# * [len:data]
# * [`8`:`channel_id`]
# * [`4`:`len`]
# * [`len`:`data`]
#
# 1. type: PERM|NODE|3 (`required_node_feature_missing`)
message = None
havedata = None
typeline = re.compile('1\. type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[-A-Za-z_]+)`\)')
dataline = re.compile('\s+\* \[(?P<size>[-a-z0-9*+]+):(?P<name>[-a-z0-9_]+)\]')
typeline = re.compile('1\. type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z_]+)`\)')
dataline = re.compile('\s+\* \[`(?P<size>[_a-z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]')
for i,line in enumerate(fileinput.input(args)):
line = line.rstrip()

View File

@ -51,15 +51,15 @@ do
if [ -n "$CHECK" ]; then
# Eliminate the following:
# #-references eg. [Use of segwit](#use-of-segwit)
# quoted identifers eg. `htlc-id`
# field descriptions, eg. `* [num-htlcs*64:htlc-signature]'
# indented field names, eg. ' num_htlcs: 0'
# quoted identifers eg. `htlc_id`
# field descriptions, eg. `* [`num_htlcs*64`:`htlc_signature]'
# indented field names, eg. ' `num_htlcs`: 0'
# Short hex strings, eg '0x2bb038521914'
# long hex strings
# long base58 strings
WORDS=$(sed -e 's/\](#[-a-zA-Z0-9_]*)//g' \
-e 's/`[-a-zA-Z0-9_]*`//g' \
-e 's/\* \[[-_a-z0-9*]\+:[-_a-z0-9]\+\]//g' \
-e 's/`[a-zA-Z0-9_]*`//g' \
-e 's/\* \[`[_a-z0-9*]\+`://g' \
-e 's/0x[a-fA-F0-9]\+//g' \
-e 's/[a-fA-F0-9]\{20,\}//g' \
-e 's/^ .*_htlcs//g' \