interscript 2.4.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/docs/demo/20191118-interscript-demo-cast.gif +0 -0
- data/exe/codemod-imp-to-isc +5 -0
- data/exe/diagnose_parse_failures +47 -0
- data/exe/interscript +2 -1
- data/exe/verify_isc_deep +211 -0
- data/exe/verify_isc_equivalence +128 -0
- data/interscript.gemspec +27 -20
- data/lib/interscript/command.rb +21 -12
- data/lib/interscript/compiler/javascript.rb +34 -35
- data/lib/interscript/compiler/json_ir.rb +214 -0
- data/lib/interscript/compiler/python.rb +354 -0
- data/lib/interscript/compiler/ruby.rb +23 -22
- data/lib/interscript/compiler.rb +20 -3
- data/lib/interscript/detector.rb +14 -7
- data/lib/interscript/dsl/aliases.rb +1 -1
- data/lib/interscript/dsl/document.rb +6 -3
- data/lib/interscript/dsl/group/parallel.rb +1 -1
- data/lib/interscript/dsl/group.rb +18 -9
- data/lib/interscript/dsl/items.rb +28 -16
- data/lib/interscript/dsl/metadata.rb +19 -18
- data/lib/interscript/dsl/stage.rb +1 -1
- data/lib/interscript/dsl/symbol_mm.rb +4 -2
- data/lib/interscript/dsl/tests.rb +1 -1
- data/lib/interscript/dsl.rb +21 -13
- data/lib/interscript/interpreter.rb +32 -21
- data/lib/interscript/isc/codemod.rb +791 -0
- data/lib/interscript/isc/document_builder.rb +354 -0
- data/lib/interscript/isc/generator.rb +191 -0
- data/lib/interscript/isc/grammar/concerns/aliases.rb +29 -0
- data/lib/interscript/isc/grammar/concerns/dependencies.rb +23 -0
- data/lib/interscript/isc/grammar/concerns/items.rb +176 -0
- data/lib/interscript/isc/grammar/concerns/metadata.rb +142 -0
- data/lib/interscript/isc/grammar/concerns/primitives.rb +112 -0
- data/lib/interscript/isc/grammar/concerns/stages.rb +129 -0
- data/lib/interscript/isc/grammar/concerns/system.rb +37 -0
- data/lib/interscript/isc/grammar/concerns/tests.rb +31 -0
- data/lib/interscript/isc/grammar/concerns.rb +18 -0
- data/lib/interscript/isc/grammar/core.rb +23 -0
- data/lib/interscript/isc/grammar/isc.artifact.json +1 -0
- data/lib/interscript/isc/grammar/isc.parg +196 -0
- data/lib/interscript/isc/grammar.rb +12 -0
- data/lib/interscript/isc/items.rb +185 -0
- data/lib/interscript/isc/model/alias.rb +20 -0
- data/lib/interscript/isc/model/constraint.rb +20 -0
- data/lib/interscript/isc/model/dependency.rb +19 -0
- data/lib/interscript/isc/model/document.rb +31 -0
- data/lib/interscript/isc/model/item.rb +50 -0
- data/lib/interscript/isc/model/rule.rb +23 -0
- data/lib/interscript/isc/model/stage.rb +20 -0
- data/lib/interscript/isc/model/stage_item.rb +33 -0
- data/lib/interscript/isc/model/test.rb +21 -0
- data/lib/interscript/isc/model.rb +19 -0
- data/lib/interscript/isc/node_adapter.rb +310 -0
- data/lib/interscript/isc/normalizer.rb +127 -0
- data/lib/interscript/isc/parser.rb +78 -0
- data/lib/interscript/isc/serializer.rb +248 -0
- data/lib/interscript/isc/transform.rb +138 -0
- data/lib/interscript/isc/yaml_bridge.rb +236 -0
- data/lib/interscript/isc.rb +30 -0
- data/lib/interscript/ml/byt5_onnx.rb +102 -0
- data/lib/interscript/ml/imf.rb +182 -0
- data/lib/interscript/ml/model.rb +52 -0
- data/lib/interscript/ml/provisioning.rb +189 -0
- data/lib/interscript/ml/translator.rb +38 -0
- data/lib/interscript/ml/vocab.rb +48 -0
- data/lib/interscript/ml.rb +25 -0
- data/lib/interscript/node/alias_def.rb +5 -5
- data/lib/interscript/node/dependency.rb +7 -7
- data/lib/interscript/node/document.rb +10 -10
- data/lib/interscript/node/group.rb +11 -9
- data/lib/interscript/node/item/alias.rb +14 -10
- data/lib/interscript/node/item/any.rb +14 -7
- data/lib/interscript/node/item/capture.rb +14 -9
- data/lib/interscript/node/item/group.rb +22 -17
- data/lib/interscript/node/item/repeat.rb +3 -3
- data/lib/interscript/node/item/stage.rb +4 -5
- data/lib/interscript/node/item/string.rb +18 -13
- data/lib/interscript/node/item.rb +27 -17
- data/lib/interscript/node/metadata.rb +6 -5
- data/lib/interscript/node/rule/funcall.rb +4 -5
- data/lib/interscript/node/rule/run.rb +4 -5
- data/lib/interscript/node/rule/sub.rb +55 -55
- data/lib/interscript/node/rule.rb +6 -5
- data/lib/interscript/node/stage.rb +11 -14
- data/lib/interscript/node/tests.rb +6 -6
- data/lib/interscript/node.rb +14 -17
- data/lib/interscript/stdlib/functions/rababa_adapter.rb +56 -0
- data/lib/interscript/stdlib/functions/secryst_adapter.rb +37 -0
- data/lib/interscript/stdlib/functions.rb +49 -0
- data/lib/interscript/stdlib.rb +25 -95
- data/lib/interscript/utils/helpers.rb +8 -5
- data/lib/interscript/utils/regexp_converter.rb +143 -144
- data/lib/interscript/version.rb +1 -1
- data/lib/interscript/visualize/json.rb +12 -13
- data/lib/interscript/visualize/nodes.rb +13 -13
- data/lib/interscript/visualize.rb +18 -18
- data/lib/interscript.rb +59 -45
- metadata +88 -31
- data/.github/workflows/assets.yml +0 -91
- data/.github/workflows/rake.yml +0 -52
- data/.github/workflows/release.yml +0 -68
- data/.gitignore +0 -79
- data/.rspec +0 -3
- data/Gemfile +0 -38
- data/Rakefile +0 -139
- data/bin/console +0 -10
- data/bin/interscript +0 -5
- data/bin/maps_analyze_staging +0 -168
- data/bin/maps_debug_compilers +0 -58
- data/bin/maps_debug_ordering +0 -88
- data/bin/maps_debug_ruby_compile +0 -24
- data/bin/maps_debug_step_by_step +0 -44
- data/bin/maps_optimize_order +0 -112
- data/bin/maps_v1_analyze_regexps +0 -45
- data/bin/maps_v1_to_v2 +0 -426
- data/bin/set_version +0 -16
- data/bin/setup +0 -8
- data/requirements.txt +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.1.0","grammar":"InterscriptIsc","shape":"parsanol-tree/v2","binding_version":1,"entries":{"isc":{"root":"isc_source","grammar":{"atoms":[{"Entity":{"atom":25}},{"Entity":{"atom":8}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09]"}},{"Re":{"pattern":"[\\x0a]"}},{"Re":{"pattern":"[\\x0b]"}},{"Re":{"pattern":"[\\x0c]"}},{"Re":{"pattern":"[\\x0d]"}},{"Alternative":{"atoms":[2,3,4,5,6,7]}},{"Entity":{"atom":23}},{"Str":{"pattern":"#"}},{"Entity":{"atom":17}},{"Re":{"pattern":"[\\x0d]"}},{"Re":{"pattern":"[\\x0a]"}},{"Sequence":{"atoms":[12,13]}},{"Re":{"pattern":"[\\x0a]"}},{"Re":{"pattern":"[\\x0d]"}},{"Alternative":{"atoms":[14,15,16]}},{"Lookahead":{"atom":11,"positive":false}},{"Entity":{"atom":20}},{"Re":{"pattern":"[\\x00-\\u{10ffff}]"}},{"Sequence":{"atoms":[18,19]}},{"Repetition":{"atom":21,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[10,22]}},{"Alternative":{"atoms":[1,9]}},{"Repetition":{"atom":24,"min":1,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":0,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":868}},{"Str":{"pattern":"system"}},{"Entity":{"atom":25}},{"Entity":{"atom":97}},{"Entity":{"atom":85}},{"Str":{"pattern":"\""}},{"Entity":{"atom":82}},{"Entity":{"atom":71}},{"Str":{"pattern":"\\"}},{"Entity":{"atom":38}},{"Str":{"pattern":"n"}},{"Named":{"name":"newline","atom":37}},{"Entity":{"atom":41}},{"Str":{"pattern":"r"}},{"Named":{"name":"carriage_return","atom":40}},{"Entity":{"atom":44}},{"Str":{"pattern":"t"}},{"Named":{"name":"tab","atom":43}},{"Entity":{"atom":47}},{"Str":{"pattern":"\""}},{"Named":{"name":"dquote","atom":46}},{"Entity":{"atom":50}},{"Str":{"pattern":"\\"}},{"Named":{"name":"backslash","atom":49}},{"Entity":{"atom":60}},{"Str":{"pattern":"u"}},{"Entity":{"atom":57}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[\\x41-\\x46]"}},{"Re":{"pattern":"[\\x61-\\x66]"}},{"Alternative":{"atoms":[54,55,56]}},{"Repetition":{"atom":53,"min":4,"max":4,"tag":"Repetition"}},{"Named":{"name":"unicode","atom":58}},{"Sequence":{"atoms":[52,59]}},{"Entity":{"atom":66}},{"Str":{"pattern":"U"}},{"Entity":{"atom":57}},{"Repetition":{"atom":63,"min":4,"max":8,"tag":"Repetition"}},{"Named":{"name":"unicode","atom":64}},{"Sequence":{"atoms":[62,65]}},{"Entity":{"atom":69}},{"Str":{"pattern":"U"}},{"Named":{"name":"u_lone","atom":68}},{"Alternative":{"atoms":[36,39,42,45,48,51,61,67]}},{"Sequence":{"atoms":[35,70]}},{"Entity":{"atom":79}},{"Str":{"pattern":"\\"}},{"Str":{"pattern":"\""}},{"Alternative":{"atoms":[73,74]}},{"Lookahead":{"atom":75,"positive":false}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[76,77]}},{"Repetition":{"atom":78,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"run","atom":72}},{"Alternative":{"atoms":[34,80]}},{"Repetition":{"atom":81,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"string","atom":33}},{"Str":{"pattern":"\""}},{"Sequence":{"atoms":[32,83,84]}},{"Entity":{"atom":96}},{"Str":{"pattern":"'"}},{"Entity":{"atom":93}},{"Str":{"pattern":"'"}},{"Lookahead":{"atom":89,"positive":false}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[90,91]}},{"Repetition":{"atom":92,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"string","atom":88}},{"Str":{"pattern":"'"}},{"Sequence":{"atoms":[87,94,95]}},{"Alternative":{"atoms":[31,86]}},{"Named":{"name":"system_code","atom":30}},{"Entity":{"atom":25}},{"Repetition":{"atom":99,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Entity":{"atom":8}},{"Entity":{"atom":23}},{"Alternative":{"atoms":[103,104]}},{"Repetition":{"atom":105,"min":0,"max":null,"tag":"Repetition"}},{"Repetition":{"atom":102,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":860}},{"Entity":{"atom":25}},{"Repetition":{"atom":109,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":322}},{"Str":{"pattern":"metadata"}},{"Entity":{"atom":25}},{"Repetition":{"atom":113,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":116,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":317}},{"Entity":{"atom":316}},{"Entity":{"atom":25}},{"Repetition":{"atom":120,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":143}},{"Str":{"pattern":"description"}},{"Entity":{"atom":25}},{"Repetition":{"atom":124,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":127,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":138}},{"Str":{"pattern":"\\"}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[130,131]}},{"Str":{"pattern":"}"}},{"Lookahead":{"atom":133,"positive":false}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[134,135]}},{"Alternative":{"atoms":[132,136]}},{"Repetition":{"atom":137,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"description","atom":129}},{"Entity":{"atom":106}},{"Repetition":{"atom":140,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[123,125,126,128,139,141,142]}},{"Entity":{"atom":183}},{"Str":{"pattern":"relations"}},{"Entity":{"atom":25}},{"Repetition":{"atom":146,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":149,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":177}},{"Entity":{"atom":25}},{"Repetition":{"atom":152,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":162}},{"Str":{"pattern":"supersedes"}},{"Str":{"pattern":"superseded_by"}},{"Str":{"pattern":"based_on"}},{"Str":{"pattern":"basis_for"}},{"Str":{"pattern":"alias_of"}},{"Str":{"pattern":"adopted_from"}},{"Str":{"pattern":"related_to"}},{"Alternative":{"atoms":[155,156,157,158,159,160,161]}},{"Named":{"name":"type","atom":154}},{"Entity":{"atom":25}},{"Entity":{"atom":97}},{"Named":{"name":"system","atom":165}},{"Entity":{"atom":173}},{"Entity":{"atom":25}},{"Str":{"pattern":"note"}},{"Entity":{"atom":25}},{"Entity":{"atom":97}},{"Named":{"name":"note","atom":171}},{"Sequence":{"atoms":[168,169,170,172]}},{"Repetition":{"atom":167,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":25}},{"Repetition":{"atom":175,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[153,163,164,166,174,176]}},{"Repetition":{"atom":151,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"relations","atom":178}},{"Entity":{"atom":106}},{"Repetition":{"atom":180,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[145,147,148,150,179,181,182]}},{"Entity":{"atom":192}},{"Str":{"pattern":"system_status"}},{"Entity":{"atom":25}},{"Str":{"pattern":"current"}},{"Str":{"pattern":"former"}},{"Str":{"pattern":"inactive"}},{"Alternative":{"atoms":[187,188,189]}},{"Named":{"name":"system_status","atom":190}},{"Sequence":{"atoms":[185,186,191]}},{"Entity":{"atom":201}},{"Str":{"pattern":"code_status"}},{"Entity":{"atom":25}},{"Str":{"pattern":"preferred"}},{"Str":{"pattern":"proposed"}},{"Str":{"pattern":"deprecated"}},{"Alternative":{"atoms":[196,197,198]}},{"Named":{"name":"code_status","atom":199}},{"Sequence":{"atoms":[194,195,200]}},{"Entity":{"atom":218}},{"Str":{"pattern":"specification"}},{"Entity":{"atom":25}},{"Entity":{"atom":207}},{"Entity":{"atom":97}},{"Named":{"name":"specification","atom":206}},{"Entity":{"atom":212}},{"Str":{"pattern":","}},{"Entity":{"atom":25}},{"Repetition":{"atom":210,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[209,211]}},{"Entity":{"atom":207}},{"Sequence":{"atoms":[208,213]}},{"Repetition":{"atom":214,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[205,215]}},{"Named":{"name":"specification","atom":216}},{"Sequence":{"atoms":[203,204,217]}},{"Entity":{"atom":242}},{"Str":{"pattern":"notes"}},{"Entity":{"atom":25}},{"Repetition":{"atom":221,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":224,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":236}},{"Entity":{"atom":25}},{"Repetition":{"atom":227,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"note"}},{"Entity":{"atom":25}},{"Repetition":{"atom":230,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":97}},{"Named":{"name":"note","atom":232}},{"Entity":{"atom":25}},{"Repetition":{"atom":234,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[228,229,231,233,235]}},{"Repetition":{"atom":226,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"notes","atom":237}},{"Entity":{"atom":106}},{"Repetition":{"atom":239,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[220,222,223,225,238,240,241]}},{"Entity":{"atom":256}},{"Str":{"pattern":"provenance"}},{"Entity":{"atom":25}},{"Repetition":{"atom":245,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":249}},{"Entity":{"atom":97}},{"Named":{"name":"provenance","atom":248}},{"Entity":{"atom":212}},{"Entity":{"atom":249}},{"Sequence":{"atoms":[250,251]}},{"Repetition":{"atom":252,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[247,253]}},{"Named":{"name":"provenance","atom":254}},{"Sequence":{"atoms":[244,246,255]}},{"Entity":{"atom":312}},{"Entity":{"atom":272}},{"Entity":{"atom":263}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[_]"}},{"Alternative":{"atoms":[260,261,262]}},{"Entity":{"atom":269}},{"Re":{"pattern":"[\\x41-\\x5a]"}},{"Re":{"pattern":"[\\x61-\\x7a]"}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Re":{"pattern":"[_]"}},{"Alternative":{"atoms":[265,266,267,268]}},{"Repetition":{"atom":264,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[259,270]}},{"Named":{"name":"identifier","atom":271}},{"Named":{"name":"field_name","atom":258}},{"Entity":{"atom":282}},{"Entity":{"atom":279}},{"Re":{"pattern":"[ ]"}},{"Re":{"pattern":"[\\x09]"}},{"Alternative":{"atoms":[276,277]}},{"Repetition":{"atom":278,"min":1,"max":null,"tag":"Repetition"}},{"Entity":{"atom":23}},{"Alternative":{"atoms":[275,280]}},{"Repetition":{"atom":281,"min":0,"max":null,"tag":"Repetition"}},{"Entity":{"atom":296}},{"Entity":{"atom":97}},{"Entity":{"atom":294}},{"Re":{"pattern":"[\\x0a]"}},{"Lookahead":{"atom":286,"positive":false}},{"Str":{"pattern":"}"}},{"Lookahead":{"atom":288,"positive":false}},{"Str":{"pattern":"{"}},{"Lookahead":{"atom":290,"positive":false}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[287,289,291,292]}},{"Repetition":{"atom":293,"min":1,"max":null,"tag":"Repetition"}},{"Named":{"name":"raw","atom":285}},{"Alternative":{"atoms":[284,295]}},{"Named":{"name":"field_value","atom":283}},{"Entity":{"atom":307}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":300,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":138}},{"Named":{"name":"field_block","atom":302}},{"Entity":{"atom":106}},{"Repetition":{"atom":304,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[299,301,303,305,306]}},{"Entity":{"atom":310}},{"Entity":{"atom":17}},{"Lookahead":{"atom":309,"positive":true}},{"Alternative":{"atoms":[297,298,308]}},{"Sequence":{"atoms":[273,274,311]}},{"Alternative":{"atoms":[122,144,184,193,202,219,243,257]}},{"Entity":{"atom":25}},{"Repetition":{"atom":314,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[121,313,315]}},{"Repetition":{"atom":119,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"metadata","atom":118}},{"Entity":{"atom":106}},{"Repetition":{"atom":319,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[112,114,115,117,318,320,321]}},{"Entity":{"atom":569}},{"Str":{"pattern":"aliases"}},{"Entity":{"atom":25}},{"Repetition":{"atom":325,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":328,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":564}},{"Entity":{"atom":563}},{"Entity":{"atom":25}},{"Repetition":{"atom":332,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":272}},{"Named":{"name":"name","atom":334}},{"Entity":{"atom":25}},{"Repetition":{"atom":336,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"="}},{"Entity":{"atom":25}},{"Repetition":{"atom":339,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":559}},{"Entity":{"atom":557}},{"Entity":{"atom":97}},{"Entity":{"atom":346}},{"Str":{"pattern":"none"}},{"Named":{"name":"none","atom":345}},{"Entity":{"atom":355}},{"Str":{"pattern":"boundary"}},{"Str":{"pattern":"line_start"}},{"Str":{"pattern":"line_end"}},{"Str":{"pattern":"word_boundary"}},{"Str":{"pattern":"space"}},{"Str":{"pattern":"non_boundary"}},{"Alternative":{"atoms":[348,349,350,351,352,353]}},{"Named":{"name":"primitive","atom":354}},{"Entity":{"atom":358}},{"Str":{"pattern":"any_character"}},{"Named":{"name":"any_char","atom":357}},{"Entity":{"atom":556}},{"Str":{"pattern":"any"}},{"Str":{"pattern":"("}},{"Entity":{"atom":106}},{"Repetition":{"atom":362,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":551}},{"Entity":{"atom":375}},{"Entity":{"atom":97}},{"Named":{"name":"lo","atom":366}},{"Entity":{"atom":106}},{"Repetition":{"atom":368,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":".."}},{"Entity":{"atom":106}},{"Repetition":{"atom":371,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":97}},{"Named":{"name":"hi","atom":373}},{"Sequence":{"atoms":[367,369,370,372,374]}},{"Entity":{"atom":542}},{"Entity":{"atom":97}},{"Named":{"name":"single","atom":377}},{"Str":{"pattern":"["}},{"Entity":{"atom":106}},{"Repetition":{"atom":380,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":383}},{"Entity":{"atom":529}},{"Entity":{"atom":392}},{"Entity":{"atom":106}},{"Repetition":{"atom":385,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"+"}},{"Entity":{"atom":106}},{"Repetition":{"atom":388,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[386,387,389]}},{"Entity":{"atom":25}},{"Alternative":{"atoms":[390,391]}},{"Entity":{"atom":400}},{"Str":{"pattern":"to"}},{"Str":{"pattern":"before"}},{"Str":{"pattern":"after"}},{"Str":{"pattern":"not_before"}},{"Str":{"pattern":"not_after"}},{"Str":{"pattern":"}"}},{"Alternative":{"atoms":[394,395,396,397,398,399]}},{"Lookahead":{"atom":393,"positive":false}},{"Entity":{"atom":407}},{"Entity":{"atom":272}},{"Entity":{"atom":106}},{"Repetition":{"atom":404,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"="}},{"Sequence":{"atoms":[403,405,406]}},{"Lookahead":{"atom":402,"positive":false}},{"Entity":{"atom":413}},{"Str":{"pattern":"\""}},{"Str":{"pattern":"'"}},{"Entity":{"atom":263}},{"Alternative":{"atoms":[410,411,412]}},{"Lookahead":{"atom":409,"positive":true}},{"Entity":{"atom":525}},{"Entity":{"atom":430}},{"Str":{"pattern":"capture"}},{"Str":{"pattern":"("}},{"Entity":{"atom":106}},{"Repetition":{"atom":419,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":425}},{"Sequence":{"atoms":[384,401,408,414,415]}},{"Repetition":{"atom":422,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[342,423]}},{"Named":{"name":"concatenation","atom":424}},{"Named":{"name":"capture_inner","atom":421}},{"Entity":{"atom":106}},{"Repetition":{"atom":427,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[417,418,420,426,428,429]}},{"Entity":{"atom":441}},{"Str":{"pattern":"maybe"}},{"Str":{"pattern":"("}},{"Entity":{"atom":106}},{"Repetition":{"atom":434,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":425}},{"Named":{"name":"maybe_inner","atom":436}},{"Entity":{"atom":106}},{"Repetition":{"atom":438,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[432,433,435,437,439,440]}},{"Entity":{"atom":452}},{"Str":{"pattern":"some"}},{"Str":{"pattern":"("}},{"Entity":{"atom":106}},{"Repetition":{"atom":445,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":425}},{"Named":{"name":"some_inner","atom":447}},{"Entity":{"atom":106}},{"Repetition":{"atom":449,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[443,444,446,448,450,451]}},{"Entity":{"atom":461}},{"Str":{"pattern":"upcase"}},{"Str":{"pattern":"downcase"}},{"Str":{"pattern":"title_case"}},{"Str":{"pattern":"reverse"}},{"Str":{"pattern":"strip"}},{"Str":{"pattern":"swapcase"}},{"Alternative":{"atoms":[454,455,456,457,458,459]}},{"Named":{"name":"function","atom":460}},{"Entity":{"atom":476}},{"Entity":{"atom":475}},{"Str":{"pattern":"ref"}},{"Str":{"pattern":"("}},{"Entity":{"atom":106}},{"Repetition":{"atom":466,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":471}},{"Entity":{"atom":470}},{"Re":{"pattern":"[\\x30-\\x39]"}},{"Named":{"name":"digit","atom":469}},{"Entity":{"atom":106}},{"Repetition":{"atom":472,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[464,465,467,468,473,474]}},{"Named":{"name":"ref","atom":463}},{"Entity":{"atom":524}},{"Entity":{"atom":513}},{"Str":{"pattern":"parallel"}},{"Str":{"pattern":"sequence"}},{"Str":{"pattern":"stage"}},{"Str":{"pattern":"compose"}},{"Str":{"pattern":"separate"}},{"Str":{"pattern":"system"}},{"Str":{"pattern":"metadata"}},{"Str":{"pattern":"aliases"}},{"Str":{"pattern":"tests"}},{"Str":{"pattern":"notes"}},{"Str":{"pattern":"description"}},{"Str":{"pattern":"any_character"}},{"Str":{"pattern":"authority"}},{"Str":{"pattern":"dependency"}},{"Str":{"pattern":"run"}},{"Str":{"pattern":"sub"}},{"Str":{"pattern":"before"}},{"Str":{"pattern":"after"}},{"Str":{"pattern":"not_before"}},{"Str":{"pattern":"not_after"}},{"Str":{"pattern":"any"}},{"Str":{"pattern":"none"}},{"Str":{"pattern":"boundary"}},{"Str":{"pattern":"line_start"}},{"Str":{"pattern":"line_end"}},{"Str":{"pattern":"word_boundary"}},{"Str":{"pattern":"downcase"}},{"Str":{"pattern":"upcase"}},{"Str":{"pattern":"title_case"}},{"Str":{"pattern":"capture"}},{"Str":{"pattern":"maybe"}},{"Str":{"pattern":"some"}},{"Str":{"pattern":"ref"}},{"Str":{"pattern":"name"}},{"Alternative":{"atoms":[479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512]}},{"Lookahead":{"atom":478,"positive":false}},{"Entity":{"atom":272}},{"Str":{"pattern":"."}},{"Entity":{"atom":272}},{"Named":{"name":"qualified_name","atom":517}},{"Sequence":{"atoms":[516,518]}},{"Repetition":{"atom":519,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Lookahead":{"atom":521,"positive":false}},{"Sequence":{"atoms":[514,515,520,522]}},{"Named":{"name":"alias","atom":523}},{"Alternative":{"atoms":[343,344,347,356,359,416,431,442,453,462,477]}},{"Sequence":{"atoms":[384,401,408,414,415]}},{"Repetition":{"atom":526,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[342,527]}},{"Named":{"name":"concatenation","atom":528}},{"Entity":{"atom":212}},{"Entity":{"atom":25}},{"Alternative":{"atoms":[530,531]}},{"Entity":{"atom":383}},{"Sequence":{"atoms":[532,533]}},{"Repetition":{"atom":534,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[382,535]}},{"Named":{"name":"list","atom":536}},{"Entity":{"atom":106}},{"Repetition":{"atom":538,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"]"}},{"Sequence":{"atoms":[379,381,537,539,540]}},{"Alternative":{"atoms":[378,541]}},{"Entity":{"atom":550}},{"Entity":{"atom":355}},{"Lookahead":{"atom":544,"positive":false}},{"Entity":{"atom":513}},{"Lookahead":{"atom":546,"positive":false}},{"Entity":{"atom":272}},{"Sequence":{"atoms":[545,547,548]}},{"Named":{"name":"alias_ref","atom":549}},{"Alternative":{"atoms":[365,376,543]}},{"Named":{"name":"any","atom":364}},{"Entity":{"atom":106}},{"Repetition":{"atom":553,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[360,361,363,552,554,555]}},{"Alternative":{"atoms":[343,344,347,356,359,416,431,442,453,462,477]}},{"Sequence":{"atoms":[342,527]}},{"Named":{"name":"concatenation","atom":558}},{"Named":{"name":"value","atom":341}},{"Entity":{"atom":25}},{"Repetition":{"atom":561,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[333,335,337,338,340,560,562]}},{"Repetition":{"atom":331,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"aliases","atom":330}},{"Entity":{"atom":106}},{"Repetition":{"atom":566,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[324,326,327,329,565,567,568]}},{"Entity":{"atom":608}},{"Str":{"pattern":"tests"}},{"Entity":{"atom":25}},{"Repetition":{"atom":572,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":575,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":603}},{"Entity":{"atom":602}},{"Entity":{"atom":25}},{"Repetition":{"atom":579,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":97}},{"Named":{"name":"input","atom":581}},{"Entity":{"atom":589}},{"Entity":{"atom":25}},{"Repetition":{"atom":584,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"->"}},{"Entity":{"atom":25}},{"Repetition":{"atom":587,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[585,586,588]}},{"Entity":{"atom":97}},{"Named":{"name":"expected","atom":590}},{"Entity":{"atom":598}},{"Entity":{"atom":25}},{"Str":{"pattern":"note"}},{"Entity":{"atom":25}},{"Entity":{"atom":97}},{"Named":{"name":"note","atom":596}},{"Sequence":{"atoms":[593,594,595,597]}},{"Repetition":{"atom":592,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":25}},{"Repetition":{"atom":600,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[580,582,583,591,599,601]}},{"Repetition":{"atom":578,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"tests","atom":577}},{"Entity":{"atom":106}},{"Repetition":{"atom":605,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[571,573,574,576,604,606,607]}},{"Entity":{"atom":842}},{"Str":{"pattern":"stage"}},{"Entity":{"atom":616}},{"Str":{"pattern":"("}},{"Entity":{"atom":272}},{"Named":{"name":"stage_name","atom":613}},{"Str":{"pattern":")"}},{"Sequence":{"atoms":[612,614,615]}},{"Entity":{"atom":621}},{"Entity":{"atom":25}},{"Entity":{"atom":272}},{"Named":{"name":"stage_name","atom":619}},{"Sequence":{"atoms":[618,620]}},{"Alternative":{"atoms":[611,617]}},{"Entity":{"atom":106}},{"Repetition":{"atom":623,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":626,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":837}},{"Entity":{"atom":836}},{"Entity":{"atom":106}},{"Repetition":{"atom":630,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":734}},{"Str":{"pattern":"sequence"}},{"Entity":{"atom":106}},{"Repetition":{"atom":634,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":637,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":729}},{"Entity":{"atom":728}},{"Entity":{"atom":106}},{"Repetition":{"atom":641,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":709}},{"Entity":{"atom":694}},{"Str":{"pattern":"sub"}},{"Entity":{"atom":106}},{"Repetition":{"atom":646,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":649,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"from"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"from","atom":653}},{"Entity":{"atom":106}},{"Repetition":{"atom":655,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"to"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"to","atom":659}},{"Entity":{"atom":25}},{"Entity":{"atom":687}},{"Entity":{"atom":668}},{"Str":{"pattern":"after"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"after","atom":666}},{"Sequence":{"atoms":[664,665,667]}},{"Entity":{"atom":674}},{"Str":{"pattern":"before"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"before","atom":672}},{"Sequence":{"atoms":[670,671,673]}},{"Entity":{"atom":680}},{"Str":{"pattern":"not_before"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"not_before","atom":678}},{"Sequence":{"atoms":[676,677,679]}},{"Entity":{"atom":686}},{"Str":{"pattern":"not_after"}},{"Entity":{"atom":25}},{"Entity":{"atom":559}},{"Named":{"name":"not_after","atom":684}},{"Sequence":{"atoms":[682,683,685]}},{"Alternative":{"atoms":[663,669,675,681]}},{"Sequence":{"atoms":[661,662]}},{"Repetition":{"atom":688,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"constraints","atom":689}},{"Entity":{"atom":106}},{"Repetition":{"atom":691,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[645,647,648,650,651,652,654,656,657,658,660,690,692,693]}},{"Entity":{"atom":708}},{"Str":{"pattern":"sub"}},{"Entity":{"atom":25}},{"Entity":{"atom":557}},{"Named":{"name":"from","atom":698}},{"Entity":{"atom":25}},{"Entity":{"atom":557}},{"Named":{"name":"to","atom":701}},{"Entity":{"atom":25}},{"Entity":{"atom":687}},{"Sequence":{"atoms":[703,704]}},{"Repetition":{"atom":705,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"constraints","atom":706}},{"Sequence":{"atoms":[696,697,699,700,702,707]}},{"Alternative":{"atoms":[644,695]}},{"Entity":{"atom":724}},{"Str":{"pattern":"#"}},{"Re":{"pattern":"[\\x0a]"}},{"Lookahead":{"atom":712,"positive":false}},{"Entity":{"atom":20}},{"Sequence":{"atoms":[713,714]}},{"Repetition":{"atom":715,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[711,716]}},{"Named":{"name":"comment","atom":717}},{"Entity":{"atom":513}},{"Lookahead":{"atom":719,"positive":false}},{"Entity":{"atom":272}},{"Sequence":{"atoms":[720,721]}},{"Named":{"name":"noop","atom":722}},{"Alternative":{"atoms":[718,723]}},{"Alternative":{"atoms":[643,710]}},{"Entity":{"atom":106}},{"Repetition":{"atom":726,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[642,725,727]}},{"Repetition":{"atom":640,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"sequence","atom":639}},{"Entity":{"atom":106}},{"Repetition":{"atom":731,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[633,635,636,638,730,732,733]}},{"Entity":{"atom":747}},{"Str":{"pattern":"parallel"}},{"Entity":{"atom":106}},{"Repetition":{"atom":737,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"{"}},{"Entity":{"atom":106}},{"Repetition":{"atom":740,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":729}},{"Named":{"name":"parallel","atom":742}},{"Entity":{"atom":106}},{"Repetition":{"atom":744,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[736,738,739,741,743,745,746]}},{"Entity":{"atom":766}},{"Str":{"pattern":"run"}},{"Entity":{"atom":25}},{"Entity":{"atom":758}},{"Str":{"pattern":"map."}},{"Entity":{"atom":272}},{"Named":{"name":"dep","atom":753}},{"Str":{"pattern":".stage."}},{"Entity":{"atom":272}},{"Named":{"name":"stage","atom":756}},{"Sequence":{"atoms":[752,754,755,757]}},{"Entity":{"atom":764}},{"Str":{"pattern":"stage."}},{"Entity":{"atom":272}},{"Named":{"name":"stage","atom":761}},{"Sequence":{"atoms":[760,762]}},{"Named":{"name":"run_stage_only","atom":763}},{"Alternative":{"atoms":[751,759]}},{"Sequence":{"atoms":[749,750,765]}},{"Entity":{"atom":778}},{"Str":{"pattern":"separate"}},{"Named":{"name":"separate","atom":768}},{"Entity":{"atom":776}},{"Entity":{"atom":25}},{"Str":{"pattern":"separator"}},{"Entity":{"atom":25}},{"Entity":{"atom":557}},{"Named":{"name":"separator","atom":774}},{"Sequence":{"atoms":[771,772,773,775]}},{"Repetition":{"atom":770,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[769,777]}},{"Entity":{"atom":813}},{"Entity":{"atom":784}},{"Str":{"pattern":"downcase"}},{"Str":{"pattern":"upcase"}},{"Alternative":{"atoms":[781,782]}},{"Named":{"name":"case","atom":783}},{"Entity":{"atom":812}},{"Str":{"pattern":"title_case"}},{"Named":{"name":"case","atom":786}},{"Entity":{"atom":810}},{"Entity":{"atom":25}},{"Entity":{"atom":808}},{"Entity":{"atom":803}},{"Entity":{"atom":802}},{"Entity":{"atom":272}},{"Named":{"name":"kwarg_name","atom":793}},{"Entity":{"atom":106}},{"Repetition":{"atom":795,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":":"}},{"Entity":{"atom":106}},{"Repetition":{"atom":798,"min":0,"max":1,"tag":"Maybe"}},{"Entity":{"atom":97}},{"Named":{"name":"kwarg_value","atom":800}},{"Sequence":{"atoms":[794,796,797,799,801]}},{"Named":{"name":"kwarg","atom":792}},{"Entity":{"atom":212}},{"Entity":{"atom":803}},{"Sequence":{"atoms":[804,805]}},{"Repetition":{"atom":806,"min":0,"max":null,"tag":"Repetition"}},{"Sequence":{"atoms":[791,807]}},{"Named":{"name":"case_kwargs","atom":790}},{"Sequence":{"atoms":[789,809]}},{"Repetition":{"atom":788,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[787,811]}},{"Alternative":{"atoms":[780,785]}},{"Entity":{"atom":818}},{"Str":{"pattern":"compose"}},{"Str":{"pattern":"decompose"}},{"Alternative":{"atoms":[815,816]}},{"Named":{"name":"compose","atom":817}},{"Entity":{"atom":828}},{"Str":{"pattern":"rababa"}},{"Named":{"name":"funcall_name","atom":820}},{"Entity":{"atom":826}},{"Entity":{"atom":25}},{"Entity":{"atom":808}},{"Named":{"name":"funcall_kwargs","atom":824}},{"Sequence":{"atoms":[823,825]}},{"Repetition":{"atom":822,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[821,827]}},{"Entity":{"atom":831}},{"Entity":{"atom":709}},{"Named":{"name":"bare_rule","atom":830}},{"Entity":{"atom":724}},{"Alternative":{"atoms":[632,735,748,767,779,814,819,829,832]}},{"Entity":{"atom":106}},{"Repetition":{"atom":834,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[631,833,835]}},{"Repetition":{"atom":629,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"stage","atom":628}},{"Entity":{"atom":106}},{"Repetition":{"atom":839,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Sequence":{"atoms":[610,622,624,625,627,838,840,841]}},{"Entity":{"atom":856}},{"Str":{"pattern":"dependency"}},{"Entity":{"atom":25}},{"Entity":{"atom":97}},{"Named":{"name":"target","atom":846}},{"Entity":{"atom":854}},{"Entity":{"atom":25}},{"Str":{"pattern":"as"}},{"Entity":{"atom":25}},{"Entity":{"atom":272}},{"Named":{"name":"alias","atom":852}},{"Sequence":{"atoms":[849,850,851,853]}},{"Repetition":{"atom":848,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[844,845,847,855]}},{"Alternative":{"atoms":[111,323,570,609,843]}},{"Entity":{"atom":25}},{"Repetition":{"atom":858,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[110,857,859]}},{"Repetition":{"atom":108,"min":0,"max":null,"tag":"Repetition"}},{"Named":{"name":"body","atom":861}},{"Entity":{"atom":106}},{"Repetition":{"atom":863,"min":0,"max":1,"tag":"Maybe"}},{"Str":{"pattern":"}"}},{"Entity":{"atom":25}},{"Repetition":{"atom":866,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[28,29,98,100,101,107,862,864,865,867]}},{"Named":{"name":"system","atom":27}},{"Entity":{"atom":25}},{"Repetition":{"atom":870,"min":0,"max":1,"tag":"Maybe"}},{"Sequence":{"atoms":[26,869,871]}}],"root":872},"bindings":[]}},"preprocess":{},"tables":{},"lint":{"order_warnings":["rule newline: branches 1 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 2 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 2 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 2 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 2 and 32 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 3 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 3 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 3 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 3 and 32 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 4 and 30 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 5 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 5 and 32 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 6 and 16 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 6 and 32 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 7 and 31 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 8 and 12 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 8 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 8 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 8 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 9 and 29 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 10 and 19 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 10 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 10 and 22 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 10 and 34 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 11 and 14 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 11 and 27 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 12 and 13 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 12 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 12 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 13 and 18 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 13 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 14 and 27 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 15 and 33 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 16 and 32 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 17 and 23 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 18 and 21 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 19 and 20 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 19 and 22 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 19 and 34 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 20 and 22 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 20 and 34 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 22 and 34 are order-dependent (shared first bytes; ordered choice is decisive)","rule keyword: branches 24 and 25 are order-dependent (shared first bytes; ordered choice is decisive)","rule relation_type: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule relation_type: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule relation_type: branches 5 and 6 are order-dependent (shared first bytes; ordered choice is decisive)","rule md_field_value: branches 1 and 2 are order-dependent (first set not statically known)","rule item_sep: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule any_arg: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule any_arg: branches 1 and 3 are order-dependent (first set not statically known)","rule any_arg: branches 2 and 3 are order-dependent (first set not statically known)","rule cont_stop: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 1 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 2 and 3 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 2 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 3 and 8 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 3 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 3 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 4 and 5 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 4 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 5 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 6 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 7 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 8 and 9 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 8 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 9 and 10 are order-dependent (shared first bytes; ordered choice is decisive)","rule item_atom: branches 9 and 11 are order-dependent (first set not statically known)","rule item_atom: branches 10 and 11 are order-dependent (first set not statically known)","rule constraint: branches 3 and 4 are order-dependent (shared first bytes; ordered choice is decisive)","rule rule: branches 1 and 2 are order-dependent (shared first bytes; ordered choice is decisive)","rule comment_item: branches 1 and 2 are order-dependent (first set not statically known)"]},"default_entry":"isc","render":{},"derive":{},"tests":[],"docs":{},"source":"# Interscript ISC grammar — parsanol grammar language (PG).\n#\n# Line-oriented port of lib/interscript/isc/grammar/concerns/*.rb.\n# The capture tree must reproduce the Ruby-DSL parser's tree exactly:\n# - repetitions are ABNF prefixes (1*x, *x)\n# - negation is !x, positive lookahead is &x\n# - captures at use sites (rule_ref as name) nest inner captures\n# the same way parslet .as does\n#\n# Consumed by the interscript gem (artifact parse) and parsanol npm.\n\ngrammar InterscriptIsc version \"0.1.0\" {\n\n # -- lexical primitives -------------------------------------------------\n\n chr = %x00-10FFFF\n space_char = %x20 / %x09 / %x0A / %x0B / %x0C / %x0D\n newline = %x0D.0A / %x0A / %x0D\n line_comment = \"#\" *(!(newline) chr)\n whitespace = 1*(space_char / line_comment)\n ws = *(space_char / line_comment)\n inline_space = 1*(%x20 / %x09)\n inline_ws = *(inline_space / line_comment)\n hexd = %x30-39 / %x41-46 / %x61-66\n digit = %x30-39\n\n ident_first = %x41-5A / %x61-7A / %x5F\n ident_rest = %x41-5A / %x61-7A / %x30-39 / %x5F\n identifier = (ident_first 0*ident_rest) as identifier\n\n keyword = \"parallel\" / \"sequence\" / \"stage\" / \"compose\" / \"separate\" / \"system\" / \"metadata\" / \"aliases\" / \"tests\" / \"notes\" / \"description\" / \"any_character\" / \"authority\" / \"dependency\" / \"run\" / \"sub\" / \"before\" / \"after\" / \"not_before\" / \"not_after\" / \"any\" / \"none\" / \"boundary\" / \"line_start\" / \"line_end\" / \"word_boundary\" / \"downcase\" / \"upcase\" / \"title_case\" / \"capture\" / \"maybe\" / \"some\" / \"ref\" / \"name\"\n\n # -- string literals ----------------------------------------------------\n\n esc_nl = (\"n\") as newline\n esc_cr = (\"r\") as carriage_return\n esc_tab = (\"t\") as tab\n esc_dq = \"\\\"\" as dquote\n esc_bs = \"\\\\\" as backslash\n esc_uni4 = \"u\" (4hexd) as unicode\n esc_uni8 = \"U\" (4*8hexd) as unicode\n esc_u_lone = \"U\" as u_lone\n escape_sequence = \"\\\\\" (esc_nl / esc_cr / esc_tab / esc_dq / esc_bs / esc_uni4 / esc_uni8 / esc_u_lone)\n\n raw_run = 1*(!(\"\\\\\" / \"\\\"\") chr)\n dq_parts = *(escape_sequence / (raw_run as run))\n double_quoted = \"\\\"\" (dq_parts as string) \"\\\"\"\n sq_body = *(!\"'\" chr)\n single_quoted = \"'\" (sq_body as string) \"'\"\n quoted_string = double_quoted / single_quoted\n\n arrow = [whitespace] \"->\" [whitespace]\n comma_ws = \",\" [whitespace]\n\n # -- metadata -----------------------------------------------------------\n\n md_authority = \"authority\" whitespace ((quoted_string) as authority)\n md_source_spelling = \"source_spelling\" whitespace ((quoted_string) as source_spelling)\n md_target_spelling = \"target_spelling\" whitespace ((quoted_string) as target_spelling)\n md_identifying = \"identifying\" whitespace ((quoted_string) as identifying)\n md_name = \"name\" whitespace ((quoted_string) as name)\n md_spec_value = quoted_string as specification\n md_specification = \"specification\" whitespace ((md_spec_value *(comma_ws md_spec_value)) as specification)\n md_description = \"description\" [whitespace] \"{\" [ws] (raw_text as description) [ws] \"}\"\n md_system_status = \"system_status\" whitespace ((\"current\" / \"former\" / \"inactive\") as system_status)\n md_code_status = \"code_status\" whitespace ((\"preferred\" / \"proposed\" / \"deprecated\") as code_status)\n\n relation_type = \"supersedes\" / \"superseded_by\" / \"based_on\" / \"basis_for\" / \"alias_of\" / \"adopted_from\" / \"related_to\"\n relation_note = whitespace \"note\" whitespace (quoted_string as note)\n relation_item = [whitespace] (relation_type as type) whitespace (quoted_string as system) [(relation_note)] [whitespace]\n md_relations = \"relations\" [whitespace] \"{\" [ws] ((*(relation_item)) as relations) [ws] \"}\"\n\n note_item = [whitespace] \"note\" [whitespace] (quoted_string as note) [whitespace]\n md_notes = \"notes\" [whitespace] \"{\" [ws] ((*(note_item)) as notes) [ws] \"}\"\n\n md_provenance_value = quoted_string as provenance\n md_provenance = \"provenance\" [whitespace] ((md_provenance_value *(comma_ws md_provenance_value)) as provenance)\n\n md_empty_field = &(newline)\n md_raw_field_value = 1*(!%x0A !\"}\" !\"{\" chr)\n md_field_value = quoted_string / (md_raw_field_value as raw)\n md_field_block = \"{\" [ws] (raw_text as field_block) [ws] \"}\"\n md_generic_field = (identifier as field_name) inline_ws ((md_field_value as field_value) / md_field_block / md_empty_field)\n\n metadata_field = [whitespace] (md_description / md_relations / md_system_status / md_code_status / md_specification / md_notes / md_provenance / md_generic_field) [whitespace]\n md_items = *(metadata_field)\n metadata_block = \"metadata\" [whitespace] \"{\" [ws] (md_items as metadata) [ws] \"}\"\n\n raw_text = *(\"\\\\\" chr / (!\"}\" chr))\n\n # -- aliases ------------------------------------------------------------\n\n alias_decl = [whitespace] (identifier as name) [whitespace] \"=\" [whitespace] (item as value) [whitespace]\n alias_items = *(alias_decl)\n aliases_block = \"aliases\" [whitespace] \"{\" [ws] (alias_items as aliases) [ws] \"}\"\n\n # -- dependencies -------------------------------------------------------\n\n dep_alias = whitespace \"as\" whitespace (identifier as alias)\n dependency_decl = \"dependency\" whitespace (quoted_string as target) [(dep_alias)]\n\n # -- item expressions ---------------------------------------------------\n\n zw_primitive = ((\"boundary\") / (\"line_start\") / (\"line_end\") / (\"word_boundary\") / (\"space\") / (\"non_boundary\")) as primitive\n fn_lit = ((\"upcase\") / (\"downcase\") / (\"title_case\") / (\"reverse\") / (\"strip\") / (\"swapcase\")) as function\n any_char_lit = (\"any_character\") as any_char\n none_lit = (\"none\") as none\n\n digit_cap = digit as digit\n capture_reference_body = \"ref\" \"(\" [ws] digit_cap [ws] \")\"\n capture_reference = capture_reference_body as ref\n\n item_ref = identifier \".\" (identifier as qualified_name)\n alias_reference = (!(keyword) identifier [(\".\" (identifier as qualified_name))] !\"{\" ) as alias\n\n item_seq = item_atom\n item_sep = ([ws] \"+\" [ws]) / whitespace\n item_cont = &item_atom\n\n range_arg = (quoted_string as lo) [ws] \"..\" [ws] (quoted_string as hi)\n list_item = item\n list_items = (list_item *((comma_ws / whitespace) list_item))\n set_arg = ((quoted_string as single)) / (\"[\" [ws] ((list_item *((comma_ws / whitespace) list_item)) as list) [ws] \"]\")\n alias_arg = (!zw_primitive !(keyword) identifier) as alias_ref\n any_arg = range_arg / set_arg / alias_arg\n any_ctor = \"any\" \"(\" [ws] (any_arg as any) [ws] \")\"\n capture_ctor = \"capture\" \"(\" [ws] (item as capture_inner) [ws] \")\"\n maybe_ctor = \"maybe\" \"(\" [ws] (item as maybe_inner) [ws] \")\"\n some_ctor = \"some\" \"(\" [ws] (item as some_inner) [ws] \")\"\n\n item_atom_start = \"\\\"\" / \"'\" / ident_first\n cont_stop = \"to\" / \"before\" / \"after\" / \"not_before\" / \"not_after\" / \"}\"\n alias_decl_stop = identifier [ws] \"=\"\n item_atom = quoted_string / none_lit / zw_primitive / any_char_lit / any_ctor / capture_ctor / maybe_ctor / some_ctor / fn_lit / capture_reference / alias_reference\n item = (item_atom 0*(item_sep !cont_stop !(alias_decl_stop) &item_atom_start item_atom)) as concatenation\n\n # -- rules and stages ---------------------------------------------------\n\n constraint_after = \"after\" whitespace (item as after)\n constraint_before = \"before\" whitespace (item as before)\n constraint_not_before = \"not_before\" whitespace (item as not_before)\n constraint_not_after = \"not_after\" whitespace (item as not_after)\n constraint = constraint_after / constraint_before / constraint_not_before / constraint_not_after\n constraints = *(whitespace constraint)\n\n compact_rule = \"sub\" whitespace (item_atom as from) whitespace (item_atom as to) ((*(whitespace constraint)) as constraints)\n\n block_rule = \"sub\" [ws] \"{\" [ws] \"from\" whitespace (item as from) [ws] \"to\" whitespace (item as to) ((*(whitespace constraint)) as constraints) [ws] \"}\"\n\n rule = block_rule / compact_rule\n\n comment_item = ((\"#\" *(!%x0A chr)) as comment) / ((!(keyword) identifier) as noop)\n rule_line = [ws] (rule / comment_item) [ws]\n rule_items = *(rule_line)\n sequence_block = \"sequence\" [ws] \"{\" [ws] (rule_items as sequence) [ws] \"}\"\n parallel_block = \"parallel\" [ws] \"{\" [ws] (rule_items as parallel) [ws] \"}\"\n\n separator_part = whitespace \"separator\" whitespace (item_atom as separator)\n separate_directive = (\"separate\") as separate [(separator_part)]\n case_directive = ((\"downcase\") / (\"upcase\")) as case\n case_kwargs_part = whitespace (kwarg_list as case_kwargs)\n title_case_directive = (\"title_case\") as case [(case_kwargs_part)]\n string_case_directive = case_directive / title_case_directive\n compose_directive = ((\"compose\") / (\"decompose\")) as compose\n kwarg = (identifier as kwarg_name) [ws] \":\" [ws] ((quoted_string) as kwarg_value)\n kwarg_item = (kwarg) as kwarg\n kwarg_list = (kwarg_item *(comma_ws kwarg_item))\n funcall_kwargs_part = whitespace (kwarg_list as funcall_kwargs)\n rababa_directive = (\"rababa\") as funcall_name [(funcall_kwargs_part)]\n run_dep = \"map.\" (identifier as dep) \".stage.\" (identifier as stage)\n run_stage_only = (\"stage.\" (identifier as stage)) as run_stage_only\n run_rule = \"run\" whitespace ((run_dep) / run_stage_only)\n\n bare_rule = (rule) as bare_rule\n stage_item = [ws] (sequence_block / parallel_block / run_rule / separate_directive / string_case_directive / compose_directive / rababa_directive / bare_rule / comment_item) [ws]\n stage_items = *(stage_item)\n stage_name_paren = \"(\" (identifier as stage_name) \")\"\n stage_name_ws = whitespace (identifier as stage_name)\n stage_block = \"stage\" (stage_name_paren / stage_name_ws) [ws] \"{\" [ws] (stage_items as stage) [ws] \"}\"\n\n # -- tests ---------------------------------------------------------------\n\n test_note = whitespace \"note\" whitespace (quoted_string as note)\n test_line = [whitespace] (quoted_string as input) arrow (quoted_string as expected) [(test_note)] [whitespace]\n test_items = *(test_line)\n tests_block = \"tests\" [whitespace] \"{\" [ws] (test_items as tests) [ws] \"}\"\n\n # -- system --------------------------------------------------------------\n\n block_item = [whitespace] (metadata_block / aliases_block / tests_block / stage_block / dependency_decl) [whitespace]\n body_items = *(block_item)\n system_block = \"system\" whitespace ((quoted_string) as system_code) [whitespace] \"{\" [ws] ((*(block_item)) as body) [ws] \"}\" [whitespace]\n isc_source = [whitespace] ((system_block) as system) [whitespace]\n\n entry isc: isc_source\n}\n","checksum":"sha256:ae411976ee55f727a1ebbf22820cff8000c1d858eb1d4008305ef0b7e48403ad"}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Interscript ISC grammar — parsanol grammar language (PG).
|
|
2
|
+
#
|
|
3
|
+
# Line-oriented port of lib/interscript/isc/grammar/concerns/*.rb.
|
|
4
|
+
# The capture tree must reproduce the Ruby-DSL parser's tree exactly:
|
|
5
|
+
# - repetitions are ABNF prefixes (1*x, *x)
|
|
6
|
+
# - negation is !x, positive lookahead is &x
|
|
7
|
+
# - captures at use sites (rule_ref as name) nest inner captures
|
|
8
|
+
# the same way parslet .as does
|
|
9
|
+
#
|
|
10
|
+
# Consumed by the interscript gem (artifact parse) and parsanol npm.
|
|
11
|
+
|
|
12
|
+
grammar InterscriptIsc version "0.1.0" {
|
|
13
|
+
|
|
14
|
+
# -- lexical primitives -------------------------------------------------
|
|
15
|
+
|
|
16
|
+
chr = %x00-10FFFF
|
|
17
|
+
space_char = %x20 / %x09 / %x0A / %x0B / %x0C / %x0D
|
|
18
|
+
newline = %x0D.0A / %x0A / %x0D
|
|
19
|
+
line_comment = "#" *(!(newline) chr)
|
|
20
|
+
whitespace = 1*(space_char / line_comment)
|
|
21
|
+
ws = *(space_char / line_comment)
|
|
22
|
+
inline_space = 1*(%x20 / %x09)
|
|
23
|
+
inline_ws = *(inline_space / line_comment)
|
|
24
|
+
hexd = %x30-39 / %x41-46 / %x61-66
|
|
25
|
+
digit = %x30-39
|
|
26
|
+
|
|
27
|
+
ident_first = %x41-5A / %x61-7A / %x5F
|
|
28
|
+
ident_rest = %x41-5A / %x61-7A / %x30-39 / %x5F
|
|
29
|
+
identifier = (ident_first 0*ident_rest) as identifier
|
|
30
|
+
|
|
31
|
+
keyword = "parallel" / "sequence" / "stage" / "compose" / "separate" / "system" / "metadata" / "aliases" / "tests" / "notes" / "description" / "any_character" / "authority" / "dependency" / "run" / "sub" / "before" / "after" / "not_before" / "not_after" / "any" / "none" / "boundary" / "line_start" / "line_end" / "word_boundary" / "downcase" / "upcase" / "title_case" / "capture" / "maybe" / "some" / "ref" / "name"
|
|
32
|
+
|
|
33
|
+
# -- string literals ----------------------------------------------------
|
|
34
|
+
|
|
35
|
+
esc_nl = ("n") as newline
|
|
36
|
+
esc_cr = ("r") as carriage_return
|
|
37
|
+
esc_tab = ("t") as tab
|
|
38
|
+
esc_dq = "\"" as dquote
|
|
39
|
+
esc_bs = "\\" as backslash
|
|
40
|
+
esc_uni4 = "u" (4hexd) as unicode
|
|
41
|
+
esc_uni8 = "U" (4*8hexd) as unicode
|
|
42
|
+
esc_u_lone = "U" as u_lone
|
|
43
|
+
escape_sequence = "\\" (esc_nl / esc_cr / esc_tab / esc_dq / esc_bs / esc_uni4 / esc_uni8 / esc_u_lone)
|
|
44
|
+
|
|
45
|
+
raw_run = 1*(!("\\" / "\"") chr)
|
|
46
|
+
dq_parts = *(escape_sequence / (raw_run as run))
|
|
47
|
+
double_quoted = "\"" (dq_parts as string) "\""
|
|
48
|
+
sq_body = *(!"'" chr)
|
|
49
|
+
single_quoted = "'" (sq_body as string) "'"
|
|
50
|
+
quoted_string = double_quoted / single_quoted
|
|
51
|
+
|
|
52
|
+
arrow = [whitespace] "->" [whitespace]
|
|
53
|
+
comma_ws = "," [whitespace]
|
|
54
|
+
|
|
55
|
+
# -- metadata -----------------------------------------------------------
|
|
56
|
+
|
|
57
|
+
md_authority = "authority" whitespace ((quoted_string) as authority)
|
|
58
|
+
md_source_spelling = "source_spelling" whitespace ((quoted_string) as source_spelling)
|
|
59
|
+
md_target_spelling = "target_spelling" whitespace ((quoted_string) as target_spelling)
|
|
60
|
+
md_identifying = "identifying" whitespace ((quoted_string) as identifying)
|
|
61
|
+
md_name = "name" whitespace ((quoted_string) as name)
|
|
62
|
+
md_spec_value = quoted_string as specification
|
|
63
|
+
md_specification = "specification" whitespace ((md_spec_value *(comma_ws md_spec_value)) as specification)
|
|
64
|
+
md_description = "description" [whitespace] "{" [ws] (raw_text as description) [ws] "}"
|
|
65
|
+
md_system_status = "system_status" whitespace (("current" / "former" / "inactive") as system_status)
|
|
66
|
+
md_code_status = "code_status" whitespace (("preferred" / "proposed" / "deprecated") as code_status)
|
|
67
|
+
|
|
68
|
+
relation_type = "supersedes" / "superseded_by" / "based_on" / "basis_for" / "alias_of" / "adopted_from" / "related_to"
|
|
69
|
+
relation_note = whitespace "note" whitespace (quoted_string as note)
|
|
70
|
+
relation_item = [whitespace] (relation_type as type) whitespace (quoted_string as system) [(relation_note)] [whitespace]
|
|
71
|
+
md_relations = "relations" [whitespace] "{" [ws] ((*(relation_item)) as relations) [ws] "}"
|
|
72
|
+
|
|
73
|
+
note_item = [whitespace] "note" [whitespace] (quoted_string as note) [whitespace]
|
|
74
|
+
md_notes = "notes" [whitespace] "{" [ws] ((*(note_item)) as notes) [ws] "}"
|
|
75
|
+
|
|
76
|
+
md_provenance_value = quoted_string as provenance
|
|
77
|
+
md_provenance = "provenance" [whitespace] ((md_provenance_value *(comma_ws md_provenance_value)) as provenance)
|
|
78
|
+
|
|
79
|
+
md_empty_field = &(newline)
|
|
80
|
+
md_raw_field_value = 1*(!%x0A !"}" !"{" chr)
|
|
81
|
+
md_field_value = quoted_string / (md_raw_field_value as raw)
|
|
82
|
+
md_field_block = "{" [ws] (raw_text as field_block) [ws] "}"
|
|
83
|
+
md_generic_field = (identifier as field_name) inline_ws ((md_field_value as field_value) / md_field_block / md_empty_field)
|
|
84
|
+
|
|
85
|
+
metadata_field = [whitespace] (md_description / md_relations / md_system_status / md_code_status / md_specification / md_notes / md_provenance / md_generic_field) [whitespace]
|
|
86
|
+
md_items = *(metadata_field)
|
|
87
|
+
metadata_block = "metadata" [whitespace] "{" [ws] (md_items as metadata) [ws] "}"
|
|
88
|
+
|
|
89
|
+
raw_text = *("\\" chr / (!"}" chr))
|
|
90
|
+
|
|
91
|
+
# -- aliases ------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
alias_decl = [whitespace] (identifier as name) [whitespace] "=" [whitespace] (item as value) [whitespace]
|
|
94
|
+
alias_items = *(alias_decl)
|
|
95
|
+
aliases_block = "aliases" [whitespace] "{" [ws] (alias_items as aliases) [ws] "}"
|
|
96
|
+
|
|
97
|
+
# -- dependencies -------------------------------------------------------
|
|
98
|
+
|
|
99
|
+
dep_alias = whitespace "as" whitespace (identifier as alias)
|
|
100
|
+
dependency_decl = "dependency" whitespace (quoted_string as target) [(dep_alias)]
|
|
101
|
+
|
|
102
|
+
# -- item expressions ---------------------------------------------------
|
|
103
|
+
|
|
104
|
+
zw_primitive = (("boundary") / ("line_start") / ("line_end") / ("word_boundary") / ("space") / ("non_boundary")) as primitive
|
|
105
|
+
fn_lit = (("upcase") / ("downcase") / ("title_case") / ("reverse") / ("strip") / ("swapcase")) as function
|
|
106
|
+
any_char_lit = ("any_character") as any_char
|
|
107
|
+
none_lit = ("none") as none
|
|
108
|
+
|
|
109
|
+
digit_cap = digit as digit
|
|
110
|
+
capture_reference_body = "ref" "(" [ws] digit_cap [ws] ")"
|
|
111
|
+
capture_reference = capture_reference_body as ref
|
|
112
|
+
|
|
113
|
+
item_ref = identifier "." (identifier as qualified_name)
|
|
114
|
+
alias_reference = (!(keyword) identifier [("." (identifier as qualified_name))] !"{" ) as alias
|
|
115
|
+
|
|
116
|
+
item_seq = item_atom
|
|
117
|
+
item_sep = ([ws] "+" [ws]) / whitespace
|
|
118
|
+
item_cont = &item_atom
|
|
119
|
+
|
|
120
|
+
range_arg = (quoted_string as lo) [ws] ".." [ws] (quoted_string as hi)
|
|
121
|
+
list_item = item
|
|
122
|
+
list_items = (list_item *((comma_ws / whitespace) list_item))
|
|
123
|
+
set_arg = ((quoted_string as single)) / ("[" [ws] ((list_item *((comma_ws / whitespace) list_item)) as list) [ws] "]")
|
|
124
|
+
alias_arg = (!zw_primitive !(keyword) identifier) as alias_ref
|
|
125
|
+
any_arg = range_arg / set_arg / alias_arg
|
|
126
|
+
any_ctor = "any" "(" [ws] (any_arg as any) [ws] ")"
|
|
127
|
+
capture_ctor = "capture" "(" [ws] (item as capture_inner) [ws] ")"
|
|
128
|
+
maybe_ctor = "maybe" "(" [ws] (item as maybe_inner) [ws] ")"
|
|
129
|
+
some_ctor = "some" "(" [ws] (item as some_inner) [ws] ")"
|
|
130
|
+
|
|
131
|
+
item_atom_start = "\"" / "'" / ident_first
|
|
132
|
+
cont_stop = "to" / "before" / "after" / "not_before" / "not_after" / "}"
|
|
133
|
+
alias_decl_stop = identifier [ws] "="
|
|
134
|
+
item_atom = quoted_string / none_lit / zw_primitive / any_char_lit / any_ctor / capture_ctor / maybe_ctor / some_ctor / fn_lit / capture_reference / alias_reference
|
|
135
|
+
item = (item_atom 0*(item_sep !cont_stop !(alias_decl_stop) &item_atom_start item_atom)) as concatenation
|
|
136
|
+
|
|
137
|
+
# -- rules and stages ---------------------------------------------------
|
|
138
|
+
|
|
139
|
+
constraint_after = "after" whitespace (item as after)
|
|
140
|
+
constraint_before = "before" whitespace (item as before)
|
|
141
|
+
constraint_not_before = "not_before" whitespace (item as not_before)
|
|
142
|
+
constraint_not_after = "not_after" whitespace (item as not_after)
|
|
143
|
+
constraint = constraint_after / constraint_before / constraint_not_before / constraint_not_after
|
|
144
|
+
constraints = *(whitespace constraint)
|
|
145
|
+
|
|
146
|
+
compact_rule = "sub" whitespace (item_atom as from) whitespace (item_atom as to) ((*(whitespace constraint)) as constraints)
|
|
147
|
+
|
|
148
|
+
block_rule = "sub" [ws] "{" [ws] "from" whitespace (item as from) [ws] "to" whitespace (item as to) ((*(whitespace constraint)) as constraints) [ws] "}"
|
|
149
|
+
|
|
150
|
+
rule = block_rule / compact_rule
|
|
151
|
+
|
|
152
|
+
comment_item = (("#" *(!%x0A chr)) as comment) / ((!(keyword) identifier) as noop)
|
|
153
|
+
rule_line = [ws] (rule / comment_item) [ws]
|
|
154
|
+
rule_items = *(rule_line)
|
|
155
|
+
sequence_block = "sequence" [ws] "{" [ws] (rule_items as sequence) [ws] "}"
|
|
156
|
+
parallel_block = "parallel" [ws] "{" [ws] (rule_items as parallel) [ws] "}"
|
|
157
|
+
|
|
158
|
+
separator_part = whitespace "separator" whitespace (item_atom as separator)
|
|
159
|
+
separate_directive = ("separate") as separate [(separator_part)]
|
|
160
|
+
case_directive = (("downcase") / ("upcase")) as case
|
|
161
|
+
case_kwargs_part = whitespace (kwarg_list as case_kwargs)
|
|
162
|
+
title_case_directive = ("title_case") as case [(case_kwargs_part)]
|
|
163
|
+
string_case_directive = case_directive / title_case_directive
|
|
164
|
+
compose_directive = (("compose") / ("decompose")) as compose
|
|
165
|
+
kwarg = (identifier as kwarg_name) [ws] ":" [ws] ((quoted_string) as kwarg_value)
|
|
166
|
+
kwarg_item = (kwarg) as kwarg
|
|
167
|
+
kwarg_list = (kwarg_item *(comma_ws kwarg_item))
|
|
168
|
+
funcall_kwargs_part = whitespace (kwarg_list as funcall_kwargs)
|
|
169
|
+
rababa_directive = ("rababa") as funcall_name [(funcall_kwargs_part)]
|
|
170
|
+
run_dep = "map." (identifier as dep) ".stage." (identifier as stage)
|
|
171
|
+
run_stage_only = ("stage." (identifier as stage)) as run_stage_only
|
|
172
|
+
run_rule = "run" whitespace ((run_dep) / run_stage_only)
|
|
173
|
+
|
|
174
|
+
bare_rule = (rule) as bare_rule
|
|
175
|
+
stage_item = [ws] (sequence_block / parallel_block / run_rule / separate_directive / string_case_directive / compose_directive / rababa_directive / bare_rule / comment_item) [ws]
|
|
176
|
+
stage_items = *(stage_item)
|
|
177
|
+
stage_name_paren = "(" (identifier as stage_name) ")"
|
|
178
|
+
stage_name_ws = whitespace (identifier as stage_name)
|
|
179
|
+
stage_block = "stage" (stage_name_paren / stage_name_ws) [ws] "{" [ws] (stage_items as stage) [ws] "}"
|
|
180
|
+
|
|
181
|
+
# -- tests ---------------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
test_note = whitespace "note" whitespace (quoted_string as note)
|
|
184
|
+
test_line = [whitespace] (quoted_string as input) arrow (quoted_string as expected) [(test_note)] [whitespace]
|
|
185
|
+
test_items = *(test_line)
|
|
186
|
+
tests_block = "tests" [whitespace] "{" [ws] (test_items as tests) [ws] "}"
|
|
187
|
+
|
|
188
|
+
# -- system --------------------------------------------------------------
|
|
189
|
+
|
|
190
|
+
block_item = [whitespace] (metadata_block / aliases_block / tests_block / stage_block / dependency_decl) [whitespace]
|
|
191
|
+
body_items = *(block_item)
|
|
192
|
+
system_block = "system" whitespace ((quoted_string) as system_code) [whitespace] "{" [ws] ((*(block_item)) as body) [ws] "}" [whitespace]
|
|
193
|
+
isc_source = [whitespace] ((system_block) as system) [whitespace]
|
|
194
|
+
|
|
195
|
+
entry isc: isc_source
|
|
196
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Interscript
|
|
4
|
+
module Isc
|
|
5
|
+
module Items
|
|
6
|
+
# String-like value carried through the transform. We don't subclass
|
|
7
|
+
# String because we want to distinguish a literal string atom from
|
|
8
|
+
# a Concat.
|
|
9
|
+
class StringValue
|
|
10
|
+
attr_reader :value
|
|
11
|
+
|
|
12
|
+
def initialize(value)
|
|
13
|
+
@value = value
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def to_s
|
|
17
|
+
@value
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def ==(other)
|
|
21
|
+
other.is_a?(StringValue) && other.value == @value
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def inspect
|
|
25
|
+
"StringValue(#{@value.inspect})"
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class None
|
|
30
|
+
def to_s
|
|
31
|
+
""
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def inspect
|
|
35
|
+
"None"
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
class Primitive
|
|
40
|
+
attr_reader :name
|
|
41
|
+
|
|
42
|
+
def initialize(name)
|
|
43
|
+
@name = name
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def inspect
|
|
47
|
+
"Primitive(#{@name})"
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Function call: upcase, downcase, etc. Used as `to` value in sub rules.
|
|
52
|
+
class Function
|
|
53
|
+
attr_reader :name
|
|
54
|
+
|
|
55
|
+
def initialize(name)
|
|
56
|
+
@name = name
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def inspect
|
|
60
|
+
"Function(#{@name})"
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class AliasRef
|
|
65
|
+
attr_reader :name, :map
|
|
66
|
+
|
|
67
|
+
def initialize(name, map: nil)
|
|
68
|
+
@name = name
|
|
69
|
+
@map = map
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def inspect
|
|
73
|
+
"AliasRef(#{@name})"
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
class Capture
|
|
78
|
+
attr_reader :index
|
|
79
|
+
|
|
80
|
+
def initialize(index)
|
|
81
|
+
@index = index
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def inspect
|
|
85
|
+
"Capture(\\#{@index})"
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
# Wraps a sub-expression that captures its match for later reference via ref(N).
|
|
90
|
+
class CaptureGroup
|
|
91
|
+
attr_reader :inner
|
|
92
|
+
|
|
93
|
+
def initialize(inner)
|
|
94
|
+
@inner = inner
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def inspect
|
|
98
|
+
"CaptureGroup(#{@inner.inspect})"
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Wraps an optional sub-expression (matches zero or one time).
|
|
103
|
+
class Maybe
|
|
104
|
+
attr_reader :inner
|
|
105
|
+
|
|
106
|
+
def initialize(inner)
|
|
107
|
+
@inner = inner
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
def inspect
|
|
111
|
+
"Maybe(#{@inner.inspect})"
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Wraps a one-or-more sub-expression (greedy).
|
|
116
|
+
class Some
|
|
117
|
+
attr_reader :inner
|
|
118
|
+
|
|
119
|
+
def initialize(inner)
|
|
120
|
+
@inner = inner
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
def inspect
|
|
124
|
+
"Some(#{@inner.inspect})"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
class Range
|
|
129
|
+
attr_reader :lo, :hi
|
|
130
|
+
|
|
131
|
+
def initialize(lo, hi)
|
|
132
|
+
@lo = lo
|
|
133
|
+
@hi = hi
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def inspect
|
|
137
|
+
"Range(#{@lo}..#{@hi})"
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
class Set
|
|
142
|
+
attr_reader :chars
|
|
143
|
+
|
|
144
|
+
def initialize(chars)
|
|
145
|
+
@chars = chars.to_a
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def self.from_string(s)
|
|
149
|
+
new(s.chars)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def self.from_strings(arr)
|
|
153
|
+
new(arr.flat_map(&:chars))
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def inspect
|
|
157
|
+
"Set(#{@chars.join})"
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
class Concat
|
|
162
|
+
attr_reader :parts
|
|
163
|
+
|
|
164
|
+
def initialize(parts)
|
|
165
|
+
@parts = parts
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def self.from_parts(arr)
|
|
169
|
+
flattened = arr.flat_map do |p|
|
|
170
|
+
p.is_a?(Concat) ? p.parts : [p]
|
|
171
|
+
end
|
|
172
|
+
case flattened.size
|
|
173
|
+
when 0 then None.new
|
|
174
|
+
when 1 then flattened.first
|
|
175
|
+
else new(flattened)
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def inspect
|
|
180
|
+
"Concat(#{@parts.map(&:inspect).join(", ")})"
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
require "interscript/isc/model/item"
|
|
5
|
+
|
|
6
|
+
module Interscript
|
|
7
|
+
module Isc
|
|
8
|
+
module Model
|
|
9
|
+
class Alias < Lutaml::Model::Serializable
|
|
10
|
+
attribute :name, :string
|
|
11
|
+
attribute :value, Item
|
|
12
|
+
|
|
13
|
+
yaml do
|
|
14
|
+
map "name", to: :name
|
|
15
|
+
map "value", to: :value
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
require "interscript/isc/model/item"
|
|
5
|
+
|
|
6
|
+
module Interscript
|
|
7
|
+
module Isc
|
|
8
|
+
module Model
|
|
9
|
+
class Constraint < Lutaml::Model::Serializable
|
|
10
|
+
attribute :kind, :string
|
|
11
|
+
attribute :item, Item
|
|
12
|
+
|
|
13
|
+
yaml do
|
|
14
|
+
map "kind", to: :kind
|
|
15
|
+
map "item", to: :item
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Interscript
|
|
6
|
+
module Isc
|
|
7
|
+
module Model
|
|
8
|
+
class Dependency < Lutaml::Model::Serializable
|
|
9
|
+
attribute :target, :string
|
|
10
|
+
attribute :alias_name, :string
|
|
11
|
+
|
|
12
|
+
yaml do
|
|
13
|
+
map "target", to: :target
|
|
14
|
+
map "alias", to: :alias_name
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|