From 811520dfd4d9e2275361b5109410227145c57051 Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Tue, 6 Dec 2022 00:53:06 +0300 Subject: [PATCH] support empty lines --- examples/test.txt | 7 +++++-- grammar.js | 9 +++++---- src/grammar.json | 40 ++++++++++++++++++++++++++++------------ src/parser.c | Bin 103120 -> 106395 bytes test/corpus/shape.txt | 16 ++++++++++++++++ 5 files changed, 54 insertions(+), 18 deletions(-) diff --git a/examples/test.txt b/examples/test.txt index 9ce0e87..82f991b 100644 --- a/examples/test.txt +++ b/examples/test.txt @@ -1,3 +1,6 @@ -foo.shape: 'oval' -foo.bar.baz.shape: oval + + +foo + +bar : Foo Bar; baz diff --git a/grammar.js b/grammar.js index c763775..6a514df 100644 --- a/grammar.js +++ b/grammar.js @@ -9,7 +9,8 @@ module.exports = grammar({ rules: { source_file: ($) => repeat($._definition), - _definition: ($) => choice($._root_attribute, $.connection, $.shape), + _definition: ($) => + choice($._end, $._root_attribute, $.connection, $.shape), connection: ($) => seq( @@ -108,8 +109,6 @@ module.exports = grammar({ _colon: ($) => seq(repeat(" "), ":", repeat(" ")), - _dash: ($) => token.immediate("-"), - _word: ($) => /[\w\d]+/, arrow: ($) => @@ -122,6 +121,8 @@ module.exports = grammar({ ) ), + _dash: ($) => token.immediate("-"), + _unquoted_string: ($) => token.immediate(/[^'"`\n;{]+/), string: ($) => @@ -132,7 +133,7 @@ module.exports = grammar({ ), _eof: ($) => choice("\n", "\0"), - _end: ($) => choice(";", $._eof), + _end: ($) => seq(repeat(" "), choice(";", $._eof)), dot: ($) => ".", }, diff --git a/src/grammar.json b/src/grammar.json index 9ac1350..18f3f3f 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -12,6 +12,10 @@ "_definition": { "type": "CHOICE", "members": [ + { + "type": "SYMBOL", + "name": "_end" + }, { "type": "SYMBOL", "name": "_root_attribute" @@ -520,13 +524,6 @@ } ] }, - "_dash": { - "type": "IMMEDIATE_TOKEN", - "content": { - "type": "STRING", - "value": "-" - } - }, "_word": { "type": "PATTERN", "value": "[\\w\\d]+" @@ -608,6 +605,13 @@ ] } }, + "_dash": { + "type": "IMMEDIATE_TOKEN", + "content": { + "type": "STRING", + "value": "-" + } + }, "_unquoted_string": { "type": "IMMEDIATE_TOKEN", "content": { @@ -703,15 +707,27 @@ ] }, "_end": { - "type": "CHOICE", + "type": "SEQ", "members": [ { - "type": "STRING", - "value": ";" + "type": "REPEAT", + "content": { + "type": "STRING", + "value": " " + } }, { - "type": "SYMBOL", - "name": "_eof" + "type": "CHOICE", + "members": [ + { + "type": "STRING", + "value": ";" + }, + { + "type": "SYMBOL", + "name": "_eof" + } + ] } ] }, diff --git a/src/parser.c b/src/parser.c index 671308393165d429bba4f3b91c4274990385576a..f5c642d6b7352b2fbf87abe8ffdbeec5a15cd1f9 100644 GIT binary patch literal 106395 zcmeHwdy^ZtvG4s`pMuA(vgDNI%bDRbj#IUf*NW<_B}co;aW0c$s9j28nIbnN*S3!1 z?|vKIcy!}6!{KTrtx{!|mS~`-@k68002;uji`Dt^>SEsc!)`O5Pq&NRZoc`ym$S`w zzWMUiAMf1xbn&8dF@LdG%`fgvrw<=LdoZ1T-ud^xS>pL}wt5MvcRsz`%wE2pbsj!= z(79O5Uar>L-Qv7+d9{6&qAeiPW`5E6UTn9E)yw-Y7W3uB{l#jrTg;Y=|DA8P zpWOL$zPebv0BJ~+&dJf^htG~49#8*z{PgtElgFK+XKANrM`y>=2Tz_oKI;_K*ruNx zJ%s|CT3Xua-@g0PlM`KN=+ci)9vz+PNH>8{kb zkB(2i33z>X^uv_Ca(euiXUC5p98XV*@68_2#1Ub*K2kBy85}-E_9wZKglY-vFgll-X*%nyUQU-J9hcQY)GI zYIdnodm?o?dp=)6YG0(DuUFgMX0}-EfHV-K1<)XIC=!2OTPV!%nlE0yQXIx2 zd3`xMU+k3FMOP4BES5@?0_(|YvswSB1TXwrs`TkMN2h-_pD(-`?`)2X*;dI{$jUzl zT<05Pv6)>guC^+RMB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@4Fs~%g0so{&Wf=uDyh2DD}2(vMKXT&Bokp?Kuh9>Cg)D>`m?>AwH@Dk)n zhqxE22JwS z^yIwdE_mMqw~*27Z~R_Q!F8$ibqvcPaBk(Ta4f>5c@wYRikrAIi&#EXXn!iy5Ubk2 z72C6=#9=Yb{{1#k%CX|2{^M;@MoAwOW9l-Jo0Y&=hM`)HLN@#1Rv6r)w?Q*f)O8(N zN|+1zhS1!CZgBrQ&<;V`#+`)t@5yP(!<>=Q0IUdVRLK|A68Dj_x$E$)b8tZSRGnwY z$A2NY;GyvDEfAT0CtQnkCmaPacio*}xsZSRy?7z9^-d(#BJ^NbAOoD^DIKyHxJ{W; zL>wOxi#rm3(o-_*1b=PT^dRZO^4B4ZAe{hZ6Zss^HXL6NXb5>AgJCZoBjWfFLu@r8 zK^}vAa9I%_8Aqy?qB?BFdSBuTZiQQKUk@F<`c@LfEFcMXW`}(Z6d}S>DDXL(wcG;^ z%vp&H3z#Og3YjS|J{_WuZ2%x>I#;f1Hvo3?63Fw#4aCLb2|R=uu!aZWwD8>n^qWn+ zU;Izd#>?uCd!acZDe_ncbpu(Fby>FO2n}g6LVdDWDJ50F4lq@z(myNEWxBWMU&W-noVpWuwsdu0!O2GxD-4Y`|An z$*4YgkJT{|M8K5>-quZUIimU(!8$yp424tX z5;{4Rv$3-xBfwt`W<3DG2pd%IMV{*m!W5#6sGd#()5Jw=bF&CgxMUO?+=9e#%tkOx zs5?ZK&tGn2C^3{m8>MgV$Fd&62`gQaWtb4c13LV_k8@@OJsl|^VMr>w>tVD;VME-N N6X)dv50f2z{vQUHk}LoK diff --git a/test/corpus/shape.txt b/test/corpus/shape.txt index 71aeeae..f0c175e 100644 --- a/test/corpus/shape.txt +++ b/test/corpus/shape.txt @@ -67,3 +67,19 @@ a: Foo Bar; b: Biz Baz (shape (identifier) (label)) ) +================================================================================ +It should skip white spaces +================================================================================ + +foo + +bar : Foo Bar; baz + +-------------------------------------------------------------------------------- + +(source_file + (shape (identifier)) + (shape (identifier) (label)) + (shape (identifier)) +) +