aboutsummaryrefslogtreecommitdiff
path: root/syntax
diff options
context:
space:
mode:
Diffstat (limited to 'syntax')
-rwxr-xr-xsyntax/SemWord.py19
-rw-r--r--syntax/def.peg3
2 files changed, 10 insertions, 12 deletions
diff --git a/syntax/SemWord.py b/syntax/SemWord.py
index 243c707..b501e03 100755
--- a/syntax/SemWord.py
+++ b/syntax/SemWord.py
@@ -6,16 +6,15 @@
from railroad import *
Diagram(
- Group(Choice(0,
- Sequence(
- NonTerminal("SEMPREFIX"),
- "<",
- NonTerminal("![<>] PRINTABLES"),
- ">",
- ),
- Sequence(
- NonTerminal("SEMPREFIX"),
- NonTerminal("CURIE"),
+ Group(Sequence(
+ NonTerminal("SEMPREFIX"),
+ Choice(0,
+ Sequence(
+ "<",
+ NonTerminal("![<>] PRINTABLES"),
+ ">",
+ ),
+ NonTerminal("CURIE")
)
)),
type="complex"
diff --git a/syntax/def.peg b/syntax/def.peg
index 0c99c80..9f260d7 100644
--- a/syntax/def.peg
+++ b/syntax/def.peg
@@ -62,8 +62,7 @@ BlockX <- LinkDefinition
/ Paragraph
PrefixDefinition <- '{' CuriePrefix '}' ':' _? SemWord NEWLINE
KeyWordX <- SemWord / Identifier / Class / Attribute / '-'
-SemWord <- SEMPREFIX '<' ![<>] PRINTABLES '>'
- / SEMPREFIX Curie
+SemWord <- SEMPREFIX ('<' ![<>] PRINTABLES '>' / Curie)
SEMPREFIX <- [.=]
# RDF CURIE