We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6d91087 commit 15219e6Copy full SHA for 15219e6
1 file changed
README.md
@@ -11,4 +11,20 @@ const parser = new SPEG();
11
parser.parse_grammar('GRAMMAR test a->"A";);
12
const ast = parser.parse_text('A');
13
console.log(ast);
14
-```
+```
15
+
16
+# Grammar example
17
+url.peg
18
19
+GRAMMAR url
20
21
+url -> scheme "://" host pathname search hash?;
22
+scheme -> "http" "s"?;
23
+host -> hostname port?;
24
+hostname -> segment ("." segment)*;
25
+segment -> [a-z0-9-]+;
26
+port -> ":" [0-9]+;
27
+pathname -> "/" [^ ?]*;
28
+search -> ("?" [^ #]*)?;
29
+hash -> "#" [^ ]*;
30
0 commit comments