From faf12aadbeaa2b6b55d0737a8afba0fd77b6e781 Mon Sep 17 00:00:00 2001
From: str4d
Date: Wed, 12 Jun 2013 02:12:44 +0000
Subject: [PATCH] More DataSpec tweaks
---
i2p2www/lexers.py | 4 +++-
i2p2www/pages/site/docs/spec/common-structures.html | 12 ++++++------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/i2p2www/lexers.py b/i2p2www/lexers.py
index 2b88c4e3..af74c905 100644
--- a/i2p2www/lexers.py
+++ b/i2p2www/lexers.py
@@ -31,12 +31,14 @@ class DataSpecLexer(RegexLexer):
],
'expression': [
(r'(\s*)(\))', bygroups(Text, Punctuation), '#pop'),
- (r'(\s*)(\+)', bygroups(Text, Punctuation)),
+ (r'(\s*)([+-])', bygroups(Text, Operator)),
+ (r'(\s*)(\$\w+)', bygroups(Text, Name.Tag)),
(r'(\s*)(\w+)', bygroups(Text, Name)),
],
'definition': [
(r'(\s*)([\w=;]+)(\s)(::)(\s)', bygroups(Text, Name.Tag, Text, Operator, Text)),
(r'(\s*)((?:[A-Z][a-z]+)+)', bygroups(Text, Name.Class)),
+ (r'(\s*)([A-Z]{2,})', bygroups(Text, Name.Constant)),
(r'(\s*)([\[\]])', bygroups(Text, Punctuation)),
(r'(\s*)(\$\w+)', bygroups(Text, Name.Tag)),
(r'(\s*)([0-9]+)(\+)?', bygroups(Text, Number, Punctuation)),
diff --git a/i2p2www/pages/site/docs/spec/common-structures.html b/i2p2www/pages/site/docs/spec/common-structures.html
index d727f2f0..b3dec1e1 100644
--- a/i2p2www/pages/site/docs/spec/common-structures.html
+++ b/i2p2www/pages/site/docs/spec/common-structures.html
@@ -234,20 +234,20 @@ A 2-byte size Integer followed by a series of String=String; pairs
{% endtrans %}
{% highlight lang='dataspec' %}
+----+----+----+----+----+----+----+----+
-| size |key string (len + data) | = |
+| size |key_string (len + data) | = |
+----+----+----+----+----+----+----+----+
-| val string (len + data) | ; | ...
+| val_string (len + data) | ; | ...
+----+----+----+----+----+----+----+
size :: Integer
length -> 2 bytes
Total number of bytes that follow
-key string :: String
+key_string :: String
A string (one byte length followed by UTF-8 encoded characters)
= :: A single byte containing '='
-val string :: String
+val_string :: String
A string (one byte length followed by UTF-8 encoded characters)
; :: A single byte containing ';'
@@ -329,7 +329,7 @@ signing_key :: SigningPublicKey
certificate :: Certificate
length -> >= 3 bytes
-Total length: 387+ bytes
+total length: 387+ bytes
{% endhighlight %}
{% trans %}Notes{% endtrans %}
@@ -378,7 +378,7 @@ signing_public_key :: SigningPublicKey
certificate :: Certificate
length -> >= 3 bytes
-Total length: 387+ bytes
+total length: 387+ bytes
{% endhighlight %}