From 23feacad052f9f2cf461c2262839671c24c98ad1 Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 8 Jan 2019 22:03:53 +1100 Subject: [PATCH 1/2] Note non-standard JSON grammar in tutorial Closes #305. --- docs/json_tutorial.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/json_tutorial.md b/docs/json_tutorial.md index 96e76fb..6dbc6b4 100644 --- a/docs/json_tutorial.md +++ b/docs/json_tutorial.md @@ -79,7 +79,10 @@ By the way, if you're curious what these terminals signify, they are roughly equ Lark will accept this, if you really want to complicate your life :) -(You can find the original definitions in [common.lark](/lark/grammars/common.lark).) +You can find the original definitions in [common.lark](/lark/grammars/common.lark). +They're a bit looser than [json.org](https://json.org/) - accepting `\f` as whitespace, +`.1` as a number, unicode digits, and unescaped control characters in strings - but +strict standards-compliance would make for a somewhat longer tutorial. Notice that terminals are written in UPPER-CASE, while rules are written in lower-case. I'll touch more on the differences between rules and terminals later. From 225845b3310c06b316753e37dafb56aa3f932481 Mon Sep 17 00:00:00 2001 From: Erez Shinan Date: Sat, 12 Jan 2019 15:06:15 +0200 Subject: [PATCH 2/2] Fixed message --- docs/json_tutorial.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/json_tutorial.md b/docs/json_tutorial.md index 6dbc6b4..ca1db73 100644 --- a/docs/json_tutorial.md +++ b/docs/json_tutorial.md @@ -80,9 +80,7 @@ By the way, if you're curious what these terminals signify, they are roughly equ Lark will accept this, if you really want to complicate your life :) You can find the original definitions in [common.lark](/lark/grammars/common.lark). -They're a bit looser than [json.org](https://json.org/) - accepting `\f` as whitespace, -`.1` as a number, unicode digits, and unescaped control characters in strings - but -strict standards-compliance would make for a somewhat longer tutorial. +They're don't strictly adhere to [json.org](https://json.org/) - but our purpose here is to accept json, not validate it. Notice that terminals are written in UPPER-CASE, while rules are written in lower-case. I'll touch more on the differences between rules and terminals later.