├── .github
├── FUNDING.yml
├── dependabot.yml
└── workflows
│ └── main.yml
├── .gitignore
├── .vscode
├── extensions.json
└── settings.json
├── CHANGELOG.md
├── LICENSE
├── README.md
├── bolt
├── __init__.py
├── ast.py
├── codegen.py
├── commands.py
├── contrib
│ ├── __init__.py
│ ├── debug_codegen.py
│ ├── defer.py
│ └── sandbox.py
├── emit.py
├── helpers.py
├── loop_info.py
├── memo.py
├── module.py
├── parse.py
├── pattern.py
├── plugin.py
├── py.typed
├── resources
│ ├── __init__.py
│ └── commands.json
├── runtime.py
├── semantics.py
└── utils.py
├── examples
├── bolt_1_20
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_assets
│ ├── beet.yml
│ └── src
│ │ └── assets
│ │ └── demo
│ │ └── modules
│ │ └── foo.bolt
├── bolt_basic
│ ├── beet.yml
│ ├── random_data.json
│ └── src
│ │ └── data
│ │ └── demo
│ │ ├── functions
│ │ ├── attribute_rebind.mcfunction
│ │ ├── foo.mcfunction
│ │ ├── import_a.mcfunction
│ │ ├── import_b.mcfunction
│ │ ├── thing.mcfunction
│ │ └── utils.mcfunction
│ │ └── modules
│ │ └── utils.bolt
├── bolt_chained_comp
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_chicken
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ ├── functions
│ │ └── chicken.mcfunction
│ │ └── modules
│ │ └── utils.bolt
├── bolt_circular
│ ├── beet.yml
│ └── src
│ │ ├── bar.bolt
│ │ ├── foo.bolt
│ │ └── main.bolt
├── bolt_class
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── foo.mcfunction
│ │ └── pydantic.mcfunction
├── bolt_compile_cached
│ ├── beet.yml
│ ├── cached
│ │ └── slow.mcfunction
│ ├── compile_cached.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_custom_provider
│ ├── beet.yml
│ ├── custom_provider.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ ├── custom
│ │ └── stuff.bolt
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_debug
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── bar.mcfunction
│ │ └── foo.mcfunction
├── bolt_defer
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_docstring
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_flat
│ ├── beet.yml
│ └── demo
│ │ ├── __init__.py
│ │ ├── main.bolt
│ │ └── math.py
├── bolt_function_signature
│ ├── beet.yml
│ └── foo.mcfunction
├── bolt_generated
│ ├── beet.yml
│ ├── demo.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_json
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── minecraft
│ │ └── tags
│ │ └── functions
│ │ └── load.json
├── bolt_lazy
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── modules
│ │ ├── foo.bolt
│ │ ├── hello1.lazy.bolt
│ │ └── hello2.lazy.bolt
├── bolt_lectern_prelude
│ ├── beet.yml
│ └── source.txt
├── bolt_loop
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── foo.mcfunction
│ │ └── init.mcfunction
├── bolt_macro
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── bar.mcfunction
│ │ ├── foo.mcfunction
│ │ └── redirect.mcfunction
├── bolt_macro_perf
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── export.mcfunction
│ │ ├── func1.mcfunction
│ │ ├── func2.mcfunction
│ │ └── lib.mcfunction
├── bolt_memo
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── bar.mcfunction
│ │ ├── foo.mcfunction
│ │ └── vars.mcfunction
├── bolt_memo2
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_memo3
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_memo4
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_merge
│ ├── beet.yml
│ ├── pack_1
│ │ └── data
│ │ │ └── pack_1
│ │ │ └── functions
│ │ │ ├── bob.mcfunction
│ │ │ └── utils.mcfunction
│ └── pack_2
│ │ └── data
│ │ └── pack_2
│ │ └── functions
│ │ └── carol.mcfunction
├── bolt_nested_location
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ ├── demo
│ │ └── functions
│ │ │ └── foo.mcfunction
│ │ └── ref
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_nesting
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_order
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── hello
│ │ └── modules
│ │ ├── entry_point.bolt
│ │ └── main.bolt
├── bolt_overgen
│ ├── beet.yml
│ ├── overgen.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ ├── functions
│ │ └── foo.mcfunction
│ │ └── overgen
│ │ └── stuff.bolt
├── bolt_overlay
│ ├── beet.yml
│ └── src
│ │ ├── data
│ │ └── demo
│ │ │ ├── functions
│ │ │ └── foo.mcfunction
│ │ │ └── modules
│ │ │ └── vars.bolt
│ │ └── dummy_overlay
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_patchers
│ ├── beet.yml
│ ├── patchers.py
│ └── src
│ │ └── data
│ │ ├── demo
│ │ ├── functions
│ │ │ └── foo.mcfunction
│ │ └── patchers
│ │ │ └── arrow_recipes.bolt
│ │ └── minecraft
│ │ └── recipes
│ │ ├── arrow.json
│ │ ├── spectral_arrow.json
│ │ └── tipped_arrow.json
├── bolt_prelude
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ ├── demo
│ │ ├── functions
│ │ │ ├── bar.mcfunction
│ │ │ └── foo.mcfunction
│ │ └── modules
│ │ │ ├── macros.bolt
│ │ │ ├── other.bolt
│ │ │ └── prelude.bolt
│ │ └── no_idea
│ │ └── modules
│ │ ├── aaa.bolt
│ │ ├── bbb.bolt
│ │ └── prelude.bolt
├── bolt_proc_macro
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ ├── foo.mcfunction
│ │ └── util.mcfunction
├── bolt_sample_ui
│ ├── beet.yml
│ ├── sample_ui
│ │ ├── __init__.py
│ │ ├── generate.py
│ │ ├── modules
│ │ │ └── main.bolt
│ │ └── resources.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── ui_screens
│ │ └── foo.xml
├── bolt_shadow_global
│ ├── beet.yml
│ ├── demo.py
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_strip_final_newline
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_summon
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
├── bolt_too_many_statically_nested_blocks
│ ├── beet.yml
│ └── src
│ │ └── data
│ │ └── demo
│ │ └── functions
│ │ └── foo.mcfunction
└── bolt_type_annotations
│ ├── beet.yml
│ └── src
│ └── data
│ └── demo
│ └── functions
│ └── foo.mcfunction
├── package-lock.json
├── package.json
├── poetry.lock
├── pyproject.toml
├── setup.py
├── tests
├── __init__.py
├── conftest.py
├── resources
│ ├── bolt_examples.mcfunction
│ └── sandbox_examples.mcfunction
├── snapshots
│ ├── bolt__parse_0__0.txt
│ ├── bolt__parse_0__1.txt
│ ├── bolt__parse_100__0.txt
│ ├── bolt__parse_100__1.txt
│ ├── bolt__parse_101__0.txt
│ ├── bolt__parse_101__1.txt
│ ├── bolt__parse_102__0.txt
│ ├── bolt__parse_102__1.txt
│ ├── bolt__parse_103__0.txt
│ ├── bolt__parse_103__1.txt
│ ├── bolt__parse_104__0.txt
│ ├── bolt__parse_104__1.txt
│ ├── bolt__parse_105__0.txt
│ ├── bolt__parse_105__1.txt
│ ├── bolt__parse_106__0.txt
│ ├── bolt__parse_106__1.txt
│ ├── bolt__parse_107__0.txt
│ ├── bolt__parse_107__1.txt
│ ├── bolt__parse_108__0.txt
│ ├── bolt__parse_108__1.txt
│ ├── bolt__parse_109__0.txt
│ ├── bolt__parse_109__1.txt
│ ├── bolt__parse_10__0.txt
│ ├── bolt__parse_10__1.txt
│ ├── bolt__parse_110__0.txt
│ ├── bolt__parse_110__1.txt
│ ├── bolt__parse_111__0.txt
│ ├── bolt__parse_111__1.txt
│ ├── bolt__parse_112__0.txt
│ ├── bolt__parse_112__1.txt
│ ├── bolt__parse_113__0.txt
│ ├── bolt__parse_113__1.txt
│ ├── bolt__parse_114__0.txt
│ ├── bolt__parse_114__1.txt
│ ├── bolt__parse_115__0.txt
│ ├── bolt__parse_116__0.txt
│ ├── bolt__parse_117__0.txt
│ ├── bolt__parse_117__1.txt
│ ├── bolt__parse_118__0.txt
│ ├── bolt__parse_118__1.txt
│ ├── bolt__parse_119__0.txt
│ ├── bolt__parse_11__0.txt
│ ├── bolt__parse_11__1.txt
│ ├── bolt__parse_120__0.txt
│ ├── bolt__parse_120__1.txt
│ ├── bolt__parse_121__0.txt
│ ├── bolt__parse_122__0.txt
│ ├── bolt__parse_123__0.txt
│ ├── bolt__parse_124__0.txt
│ ├── bolt__parse_125__0.txt
│ ├── bolt__parse_126__0.txt
│ ├── bolt__parse_126__1.txt
│ ├── bolt__parse_127__0.txt
│ ├── bolt__parse_127__1.txt
│ ├── bolt__parse_128__0.txt
│ ├── bolt__parse_128__1.txt
│ ├── bolt__parse_129__0.txt
│ ├── bolt__parse_129__1.txt
│ ├── bolt__parse_12__0.txt
│ ├── bolt__parse_12__1.txt
│ ├── bolt__parse_130__0.txt
│ ├── bolt__parse_130__1.txt
│ ├── bolt__parse_131__0.txt
│ ├── bolt__parse_131__1.txt
│ ├── bolt__parse_132__0.txt
│ ├── bolt__parse_132__1.txt
│ ├── bolt__parse_133__0.txt
│ ├── bolt__parse_133__1.txt
│ ├── bolt__parse_134__0.txt
│ ├── bolt__parse_134__1.txt
│ ├── bolt__parse_135__0.txt
│ ├── bolt__parse_135__1.txt
│ ├── bolt__parse_136__0.txt
│ ├── bolt__parse_136__1.txt
│ ├── bolt__parse_137__0.txt
│ ├── bolt__parse_137__1.txt
│ ├── bolt__parse_138__0.txt
│ ├── bolt__parse_138__1.txt
│ ├── bolt__parse_139__0.txt
│ ├── bolt__parse_139__1.txt
│ ├── bolt__parse_13__0.txt
│ ├── bolt__parse_13__1.txt
│ ├── bolt__parse_140__0.txt
│ ├── bolt__parse_140__1.txt
│ ├── bolt__parse_141__0.txt
│ ├── bolt__parse_141__1.txt
│ ├── bolt__parse_142__0.txt
│ ├── bolt__parse_142__1.txt
│ ├── bolt__parse_143__0.txt
│ ├── bolt__parse_143__1.txt
│ ├── bolt__parse_144__0.txt
│ ├── bolt__parse_144__1.txt
│ ├── bolt__parse_145__0.txt
│ ├── bolt__parse_145__1.txt
│ ├── bolt__parse_146__0.txt
│ ├── bolt__parse_147__0.txt
│ ├── bolt__parse_148__0.txt
│ ├── bolt__parse_149__0.txt
│ ├── bolt__parse_14__0.txt
│ ├── bolt__parse_14__1.txt
│ ├── bolt__parse_150__0.txt
│ ├── bolt__parse_150__1.txt
│ ├── bolt__parse_151__0.txt
│ ├── bolt__parse_151__1.txt
│ ├── bolt__parse_152__0.txt
│ ├── bolt__parse_152__1.txt
│ ├── bolt__parse_153__0.txt
│ ├── bolt__parse_153__1.txt
│ ├── bolt__parse_154__0.txt
│ ├── bolt__parse_154__1.txt
│ ├── bolt__parse_155__0.txt
│ ├── bolt__parse_156__0.txt
│ ├── bolt__parse_156__1.txt
│ ├── bolt__parse_157__0.txt
│ ├── bolt__parse_158__0.txt
│ ├── bolt__parse_159__0.txt
│ ├── bolt__parse_15__0.txt
│ ├── bolt__parse_15__1.txt
│ ├── bolt__parse_160__0.txt
│ ├── bolt__parse_160__1.txt
│ ├── bolt__parse_161__0.txt
│ ├── bolt__parse_161__1.txt
│ ├── bolt__parse_162__0.txt
│ ├── bolt__parse_162__1.txt
│ ├── bolt__parse_163__0.txt
│ ├── bolt__parse_163__1.txt
│ ├── bolt__parse_164__0.txt
│ ├── bolt__parse_164__1.txt
│ ├── bolt__parse_165__0.txt
│ ├── bolt__parse_165__1.txt
│ ├── bolt__parse_166__0.txt
│ ├── bolt__parse_166__1.txt
│ ├── bolt__parse_167__0.txt
│ ├── bolt__parse_167__1.txt
│ ├── bolt__parse_168__0.txt
│ ├── bolt__parse_168__1.txt
│ ├── bolt__parse_169__0.txt
│ ├── bolt__parse_169__1.txt
│ ├── bolt__parse_16__0.txt
│ ├── bolt__parse_16__1.txt
│ ├── bolt__parse_170__0.txt
│ ├── bolt__parse_170__1.txt
│ ├── bolt__parse_171__0.txt
│ ├── bolt__parse_171__1.txt
│ ├── bolt__parse_172__0.txt
│ ├── bolt__parse_173__0.txt
│ ├── bolt__parse_174__0.txt
│ ├── bolt__parse_174__1.txt
│ ├── bolt__parse_175__0.txt
│ ├── bolt__parse_175__1.txt
│ ├── bolt__parse_176__0.txt
│ ├── bolt__parse_176__1.txt
│ ├── bolt__parse_177__0.txt
│ ├── bolt__parse_178__0.txt
│ ├── bolt__parse_179__0.txt
│ ├── bolt__parse_17__0.txt
│ ├── bolt__parse_17__1.txt
│ ├── bolt__parse_180__0.txt
│ ├── bolt__parse_181__0.txt
│ ├── bolt__parse_181__1.txt
│ ├── bolt__parse_182__0.txt
│ ├── bolt__parse_182__1.txt
│ ├── bolt__parse_183__0.txt
│ ├── bolt__parse_184__0.txt
│ ├── bolt__parse_184__1.txt
│ ├── bolt__parse_185__0.txt
│ ├── bolt__parse_185__1.txt
│ ├── bolt__parse_186__0.txt
│ ├── bolt__parse_186__1.txt
│ ├── bolt__parse_187__0.txt
│ ├── bolt__parse_188__0.txt
│ ├── bolt__parse_189__0.txt
│ ├── bolt__parse_18__0.txt
│ ├── bolt__parse_190__0.txt
│ ├── bolt__parse_191__0.txt
│ ├── bolt__parse_192__0.txt
│ ├── bolt__parse_192__1.txt
│ ├── bolt__parse_193__0.txt
│ ├── bolt__parse_193__1.txt
│ ├── bolt__parse_194__0.txt
│ ├── bolt__parse_194__1.txt
│ ├── bolt__parse_195__0.txt
│ ├── bolt__parse_196__0.txt
│ ├── bolt__parse_196__1.txt
│ ├── bolt__parse_197__0.txt
│ ├── bolt__parse_197__1.txt
│ ├── bolt__parse_198__0.txt
│ ├── bolt__parse_198__1.txt
│ ├── bolt__parse_199__0.txt
│ ├── bolt__parse_199__1.txt
│ ├── bolt__parse_19__0.txt
│ ├── bolt__parse_1__0.txt
│ ├── bolt__parse_1__1.txt
│ ├── bolt__parse_200__0.txt
│ ├── bolt__parse_201__0.txt
│ ├── bolt__parse_201__1.txt
│ ├── bolt__parse_202__0.txt
│ ├── bolt__parse_202__1.txt
│ ├── bolt__parse_203__0.txt
│ ├── bolt__parse_203__1.txt
│ ├── bolt__parse_204__0.txt
│ ├── bolt__parse_205__0.txt
│ ├── bolt__parse_205__1.txt
│ ├── bolt__parse_206__0.txt
│ ├── bolt__parse_206__1.txt
│ ├── bolt__parse_207__0.txt
│ ├── bolt__parse_207__1.txt
│ ├── bolt__parse_208__0.txt
│ ├── bolt__parse_208__1.txt
│ ├── bolt__parse_209__0.txt
│ ├── bolt__parse_209__1.txt
│ ├── bolt__parse_20__0.txt
│ ├── bolt__parse_20__1.txt
│ ├── bolt__parse_210__0.txt
│ ├── bolt__parse_210__1.txt
│ ├── bolt__parse_211__0.txt
│ ├── bolt__parse_211__1.txt
│ ├── bolt__parse_212__0.txt
│ ├── bolt__parse_213__0.txt
│ ├── bolt__parse_214__0.txt
│ ├── bolt__parse_215__0.txt
│ ├── bolt__parse_215__1.txt
│ ├── bolt__parse_216__0.txt
│ ├── bolt__parse_216__1.txt
│ ├── bolt__parse_217__0.txt
│ ├── bolt__parse_217__1.txt
│ ├── bolt__parse_218__0.txt
│ ├── bolt__parse_218__1.txt
│ ├── bolt__parse_219__0.txt
│ ├── bolt__parse_219__1.txt
│ ├── bolt__parse_21__0.txt
│ ├── bolt__parse_21__1.txt
│ ├── bolt__parse_220__0.txt
│ ├── bolt__parse_220__1.txt
│ ├── bolt__parse_221__0.txt
│ ├── bolt__parse_221__1.txt
│ ├── bolt__parse_222__0.txt
│ ├── bolt__parse_223__0.txt
│ ├── bolt__parse_224__0.txt
│ ├── bolt__parse_225__0.txt
│ ├── bolt__parse_226__0.txt
│ ├── bolt__parse_226__1.txt
│ ├── bolt__parse_227__0.txt
│ ├── bolt__parse_227__1.txt
│ ├── bolt__parse_228__0.txt
│ ├── bolt__parse_228__1.txt
│ ├── bolt__parse_229__0.txt
│ ├── bolt__parse_229__1.txt
│ ├── bolt__parse_22__0.txt
│ ├── bolt__parse_22__1.txt
│ ├── bolt__parse_230__0.txt
│ ├── bolt__parse_231__0.txt
│ ├── bolt__parse_231__1.txt
│ ├── bolt__parse_232__0.txt
│ ├── bolt__parse_233__0.txt
│ ├── bolt__parse_233__1.txt
│ ├── bolt__parse_234__0.txt
│ ├── bolt__parse_234__1.txt
│ ├── bolt__parse_235__0.txt
│ ├── bolt__parse_235__1.txt
│ ├── bolt__parse_236__0.txt
│ ├── bolt__parse_237__0.txt
│ ├── bolt__parse_237__1.txt
│ ├── bolt__parse_238__0.txt
│ ├── bolt__parse_238__1.txt
│ ├── bolt__parse_239__0.txt
│ ├── bolt__parse_239__1.txt
│ ├── bolt__parse_23__0.txt
│ ├── bolt__parse_23__1.txt
│ ├── bolt__parse_240__0.txt
│ ├── bolt__parse_241__0.txt
│ ├── bolt__parse_241__1.txt
│ ├── bolt__parse_242__0.txt
│ ├── bolt__parse_243__0.txt
│ ├── bolt__parse_243__1.txt
│ ├── bolt__parse_244__0.txt
│ ├── bolt__parse_244__1.txt
│ ├── bolt__parse_245__0.txt
│ ├── bolt__parse_245__1.txt
│ ├── bolt__parse_246__0.txt
│ ├── bolt__parse_246__1.txt
│ ├── bolt__parse_247__0.txt
│ ├── bolt__parse_247__1.txt
│ ├── bolt__parse_248__0.txt
│ ├── bolt__parse_248__1.txt
│ ├── bolt__parse_249__0.txt
│ ├── bolt__parse_249__1.txt
│ ├── bolt__parse_24__0.txt
│ ├── bolt__parse_24__1.txt
│ ├── bolt__parse_250__0.txt
│ ├── bolt__parse_250__1.txt
│ ├── bolt__parse_251__0.txt
│ ├── bolt__parse_251__1.txt
│ ├── bolt__parse_252__0.txt
│ ├── bolt__parse_253__0.txt
│ ├── bolt__parse_254__0.txt
│ ├── bolt__parse_254__1.txt
│ ├── bolt__parse_255__0.txt
│ ├── bolt__parse_255__1.txt
│ ├── bolt__parse_256__0.txt
│ ├── bolt__parse_257__0.txt
│ ├── bolt__parse_258__0.txt
│ ├── bolt__parse_259__0.txt
│ ├── bolt__parse_259__1.txt
│ ├── bolt__parse_25__0.txt
│ ├── bolt__parse_25__1.txt
│ ├── bolt__parse_260__0.txt
│ ├── bolt__parse_261__0.txt
│ ├── bolt__parse_262__0.txt
│ ├── bolt__parse_262__1.txt
│ ├── bolt__parse_263__0.txt
│ ├── bolt__parse_263__1.txt
│ ├── bolt__parse_264__0.txt
│ ├── bolt__parse_264__1.txt
│ ├── bolt__parse_265__0.txt
│ ├── bolt__parse_265__1.txt
│ ├── bolt__parse_266__0.txt
│ ├── bolt__parse_267__0.txt
│ ├── bolt__parse_268__0.txt
│ ├── bolt__parse_269__0.txt
│ ├── bolt__parse_26__0.txt
│ ├── bolt__parse_26__1.txt
│ ├── bolt__parse_270__0.txt
│ ├── bolt__parse_271__0.txt
│ ├── bolt__parse_272__0.txt
│ ├── bolt__parse_273__0.txt
│ ├── bolt__parse_273__1.txt
│ ├── bolt__parse_274__0.txt
│ ├── bolt__parse_274__1.txt
│ ├── bolt__parse_275__0.txt
│ ├── bolt__parse_275__1.txt
│ ├── bolt__parse_276__0.txt
│ ├── bolt__parse_276__1.txt
│ ├── bolt__parse_277__0.txt
│ ├── bolt__parse_278__0.txt
│ ├── bolt__parse_278__1.txt
│ ├── bolt__parse_279__0.txt
│ ├── bolt__parse_279__1.txt
│ ├── bolt__parse_27__0.txt
│ ├── bolt__parse_280__0.txt
│ ├── bolt__parse_280__1.txt
│ ├── bolt__parse_281__0.txt
│ ├── bolt__parse_281__1.txt
│ ├── bolt__parse_282__0.txt
│ ├── bolt__parse_282__1.txt
│ ├── bolt__parse_283__0.txt
│ ├── bolt__parse_283__1.txt
│ ├── bolt__parse_284__0.txt
│ ├── bolt__parse_284__1.txt
│ ├── bolt__parse_285__0.txt
│ ├── bolt__parse_285__1.txt
│ ├── bolt__parse_286__0.txt
│ ├── bolt__parse_286__1.txt
│ ├── bolt__parse_287__0.txt
│ ├── bolt__parse_287__1.txt
│ ├── bolt__parse_288__0.txt
│ ├── bolt__parse_288__1.txt
│ ├── bolt__parse_289__0.txt
│ ├── bolt__parse_289__1.txt
│ ├── bolt__parse_28__0.txt
│ ├── bolt__parse_290__0.txt
│ ├── bolt__parse_290__1.txt
│ ├── bolt__parse_291__0.txt
│ ├── bolt__parse_291__1.txt
│ ├── bolt__parse_292__0.txt
│ ├── bolt__parse_292__1.txt
│ ├── bolt__parse_293__0.txt
│ ├── bolt__parse_293__1.txt
│ ├── bolt__parse_294__0.txt
│ ├── bolt__parse_294__1.txt
│ ├── bolt__parse_295__0.txt
│ ├── bolt__parse_296__0.txt
│ ├── bolt__parse_297__0.txt
│ ├── bolt__parse_298__0.txt
│ ├── bolt__parse_299__0.txt
│ ├── bolt__parse_29__0.txt
│ ├── bolt__parse_29__1.txt
│ ├── bolt__parse_2__0.txt
│ ├── bolt__parse_2__1.txt
│ ├── bolt__parse_300__0.txt
│ ├── bolt__parse_301__0.txt
│ ├── bolt__parse_302__0.txt
│ ├── bolt__parse_303__0.txt
│ ├── bolt__parse_304__0.txt
│ ├── bolt__parse_305__0.txt
│ ├── bolt__parse_306__0.txt
│ ├── bolt__parse_307__0.txt
│ ├── bolt__parse_308__0.txt
│ ├── bolt__parse_309__0.txt
│ ├── bolt__parse_30__0.txt
│ ├── bolt__parse_310__0.txt
│ ├── bolt__parse_311__0.txt
│ ├── bolt__parse_312__0.txt
│ ├── bolt__parse_313__0.txt
│ ├── bolt__parse_313__1.txt
│ ├── bolt__parse_314__0.txt
│ ├── bolt__parse_314__1.txt
│ ├── bolt__parse_315__0.txt
│ ├── bolt__parse_315__1.txt
│ ├── bolt__parse_316__0.txt
│ ├── bolt__parse_316__1.txt
│ ├── bolt__parse_317__0.txt
│ ├── bolt__parse_317__1.txt
│ ├── bolt__parse_318__0.txt
│ ├── bolt__parse_318__1.txt
│ ├── bolt__parse_319__0.txt
│ ├── bolt__parse_319__1.txt
│ ├── bolt__parse_31__0.txt
│ ├── bolt__parse_320__0.txt
│ ├── bolt__parse_320__1.txt
│ ├── bolt__parse_321__0.txt
│ ├── bolt__parse_321__1.txt
│ ├── bolt__parse_322__0.txt
│ ├── bolt__parse_322__1.txt
│ ├── bolt__parse_323__0.txt
│ ├── bolt__parse_323__1.txt
│ ├── bolt__parse_324__0.txt
│ ├── bolt__parse_324__1.txt
│ ├── bolt__parse_325__0.txt
│ ├── bolt__parse_326__0.txt
│ ├── bolt__parse_327__0.txt
│ ├── bolt__parse_327__1.txt
│ ├── bolt__parse_328__0.txt
│ ├── bolt__parse_328__1.txt
│ ├── bolt__parse_329__0.txt
│ ├── bolt__parse_329__1.txt
│ ├── bolt__parse_32__0.txt
│ ├── bolt__parse_32__1.txt
│ ├── bolt__parse_330__0.txt
│ ├── bolt__parse_330__1.txt
│ ├── bolt__parse_331__0.txt
│ ├── bolt__parse_331__1.txt
│ ├── bolt__parse_332__0.txt
│ ├── bolt__parse_332__1.txt
│ ├── bolt__parse_333__0.txt
│ ├── bolt__parse_333__1.txt
│ ├── bolt__parse_334__0.txt
│ ├── bolt__parse_334__1.txt
│ ├── bolt__parse_335__0.txt
│ ├── bolt__parse_336__0.txt
│ ├── bolt__parse_336__1.txt
│ ├── bolt__parse_337__0.txt
│ ├── bolt__parse_337__1.txt
│ ├── bolt__parse_338__0.txt
│ ├── bolt__parse_338__1.txt
│ ├── bolt__parse_339__0.txt
│ ├── bolt__parse_33__0.txt
│ ├── bolt__parse_33__1.txt
│ ├── bolt__parse_340__0.txt
│ ├── bolt__parse_340__1.txt
│ ├── bolt__parse_341__0.txt
│ ├── bolt__parse_341__1.txt
│ ├── bolt__parse_342__0.txt
│ ├── bolt__parse_343__0.txt
│ ├── bolt__parse_343__1.txt
│ ├── bolt__parse_344__0.txt
│ ├── bolt__parse_344__1.txt
│ ├── bolt__parse_345__0.txt
│ ├── bolt__parse_345__1.txt
│ ├── bolt__parse_346__0.txt
│ ├── bolt__parse_346__1.txt
│ ├── bolt__parse_347__0.txt
│ ├── bolt__parse_348__0.txt
│ ├── bolt__parse_349__0.txt
│ ├── bolt__parse_34__0.txt
│ ├── bolt__parse_34__1.txt
│ ├── bolt__parse_350__0.txt
│ ├── bolt__parse_351__0.txt
│ ├── bolt__parse_352__0.txt
│ ├── bolt__parse_353__0.txt
│ ├── bolt__parse_354__0.txt
│ ├── bolt__parse_354__1.txt
│ ├── bolt__parse_355__0.txt
│ ├── bolt__parse_355__1.txt
│ ├── bolt__parse_356__0.txt
│ ├── bolt__parse_356__1.txt
│ ├── bolt__parse_357__0.txt
│ ├── bolt__parse_357__1.txt
│ ├── bolt__parse_358__0.txt
│ ├── bolt__parse_359__0.txt
│ ├── bolt__parse_359__1.txt
│ ├── bolt__parse_35__0.txt
│ ├── bolt__parse_35__1.txt
│ ├── bolt__parse_360__0.txt
│ ├── bolt__parse_360__1.txt
│ ├── bolt__parse_361__0.txt
│ ├── bolt__parse_362__0.txt
│ ├── bolt__parse_362__1.txt
│ ├── bolt__parse_363__0.txt
│ ├── bolt__parse_363__1.txt
│ ├── bolt__parse_364__0.txt
│ ├── bolt__parse_365__0.txt
│ ├── bolt__parse_365__1.txt
│ ├── bolt__parse_366__0.txt
│ ├── bolt__parse_366__1.txt
│ ├── bolt__parse_367__0.txt
│ ├── bolt__parse_367__1.txt
│ ├── bolt__parse_368__0.txt
│ ├── bolt__parse_369__0.txt
│ ├── bolt__parse_369__1.txt
│ ├── bolt__parse_36__0.txt
│ ├── bolt__parse_370__0.txt
│ ├── bolt__parse_370__1.txt
│ ├── bolt__parse_371__0.txt
│ ├── bolt__parse_371__1.txt
│ ├── bolt__parse_372__0.txt
│ ├── bolt__parse_372__1.txt
│ ├── bolt__parse_373__0.txt
│ ├── bolt__parse_373__1.txt
│ ├── bolt__parse_374__0.txt
│ ├── bolt__parse_374__1.txt
│ ├── bolt__parse_375__0.txt
│ ├── bolt__parse_375__1.txt
│ ├── bolt__parse_376__0.txt
│ ├── bolt__parse_376__1.txt
│ ├── bolt__parse_377__0.txt
│ ├── bolt__parse_377__1.txt
│ ├── bolt__parse_378__0.txt
│ ├── bolt__parse_378__1.txt
│ ├── bolt__parse_379__0.txt
│ ├── bolt__parse_379__1.txt
│ ├── bolt__parse_37__0.txt
│ ├── bolt__parse_380__0.txt
│ ├── bolt__parse_380__1.txt
│ ├── bolt__parse_38__0.txt
│ ├── bolt__parse_39__0.txt
│ ├── bolt__parse_3__0.txt
│ ├── bolt__parse_3__1.txt
│ ├── bolt__parse_40__0.txt
│ ├── bolt__parse_41__0.txt
│ ├── bolt__parse_41__1.txt
│ ├── bolt__parse_42__0.txt
│ ├── bolt__parse_42__1.txt
│ ├── bolt__parse_43__0.txt
│ ├── bolt__parse_43__1.txt
│ ├── bolt__parse_44__0.txt
│ ├── bolt__parse_44__1.txt
│ ├── bolt__parse_45__0.txt
│ ├── bolt__parse_45__1.txt
│ ├── bolt__parse_46__0.txt
│ ├── bolt__parse_46__1.txt
│ ├── bolt__parse_47__0.txt
│ ├── bolt__parse_47__1.txt
│ ├── bolt__parse_48__0.txt
│ ├── bolt__parse_49__0.txt
│ ├── bolt__parse_49__1.txt
│ ├── bolt__parse_4__0.txt
│ ├── bolt__parse_4__1.txt
│ ├── bolt__parse_50__0.txt
│ ├── bolt__parse_50__1.txt
│ ├── bolt__parse_51__0.txt
│ ├── bolt__parse_51__1.txt
│ ├── bolt__parse_52__0.txt
│ ├── bolt__parse_53__0.txt
│ ├── bolt__parse_53__1.txt
│ ├── bolt__parse_54__0.txt
│ ├── bolt__parse_55__0.txt
│ ├── bolt__parse_55__1.txt
│ ├── bolt__parse_56__0.txt
│ ├── bolt__parse_57__0.txt
│ ├── bolt__parse_57__1.txt
│ ├── bolt__parse_58__0.txt
│ ├── bolt__parse_59__0.txt
│ ├── bolt__parse_5__0.txt
│ ├── bolt__parse_5__1.txt
│ ├── bolt__parse_60__0.txt
│ ├── bolt__parse_61__0.txt
│ ├── bolt__parse_62__0.txt
│ ├── bolt__parse_62__1.txt
│ ├── bolt__parse_63__0.txt
│ ├── bolt__parse_63__1.txt
│ ├── bolt__parse_64__0.txt
│ ├── bolt__parse_64__1.txt
│ ├── bolt__parse_65__0.txt
│ ├── bolt__parse_65__1.txt
│ ├── bolt__parse_66__0.txt
│ ├── bolt__parse_66__1.txt
│ ├── bolt__parse_67__0.txt
│ ├── bolt__parse_67__1.txt
│ ├── bolt__parse_68__0.txt
│ ├── bolt__parse_68__1.txt
│ ├── bolt__parse_69__0.txt
│ ├── bolt__parse_69__1.txt
│ ├── bolt__parse_6__0.txt
│ ├── bolt__parse_6__1.txt
│ ├── bolt__parse_70__0.txt
│ ├── bolt__parse_70__1.txt
│ ├── bolt__parse_71__0.txt
│ ├── bolt__parse_71__1.txt
│ ├── bolt__parse_72__0.txt
│ ├── bolt__parse_72__1.txt
│ ├── bolt__parse_73__0.txt
│ ├── bolt__parse_74__0.txt
│ ├── bolt__parse_75__0.txt
│ ├── bolt__parse_76__0.txt
│ ├── bolt__parse_77__0.txt
│ ├── bolt__parse_77__1.txt
│ ├── bolt__parse_78__0.txt
│ ├── bolt__parse_79__0.txt
│ ├── bolt__parse_7__0.txt
│ ├── bolt__parse_7__1.txt
│ ├── bolt__parse_80__0.txt
│ ├── bolt__parse_81__0.txt
│ ├── bolt__parse_81__1.txt
│ ├── bolt__parse_82__0.txt
│ ├── bolt__parse_82__1.txt
│ ├── bolt__parse_83__0.txt
│ ├── bolt__parse_84__0.txt
│ ├── bolt__parse_84__1.txt
│ ├── bolt__parse_85__0.txt
│ ├── bolt__parse_86__0.txt
│ ├── bolt__parse_87__0.txt
│ ├── bolt__parse_87__1.txt
│ ├── bolt__parse_88__0.txt
│ ├── bolt__parse_89__0.txt
│ ├── bolt__parse_89__1.txt
│ ├── bolt__parse_8__0.txt
│ ├── bolt__parse_8__1.txt
│ ├── bolt__parse_90__0.txt
│ ├── bolt__parse_91__0.txt
│ ├── bolt__parse_91__1.txt
│ ├── bolt__parse_92__0.txt
│ ├── bolt__parse_92__1.txt
│ ├── bolt__parse_93__0.txt
│ ├── bolt__parse_93__1.txt
│ ├── bolt__parse_94__0.txt
│ ├── bolt__parse_94__1.txt
│ ├── bolt__parse_95__0.txt
│ ├── bolt__parse_95__1.txt
│ ├── bolt__parse_96__0.txt
│ ├── bolt__parse_96__1.txt
│ ├── bolt__parse_97__0.txt
│ ├── bolt__parse_97__1.txt
│ ├── bolt__parse_98__0.txt
│ ├── bolt__parse_99__0.txt
│ ├── bolt__parse_9__0.txt
│ ├── bolt__parse_9__1.txt
│ ├── examples__build_bolt_1_20__0.pack.md
│ ├── examples__build_bolt_assets__0.pack.md
│ ├── examples__build_bolt_basic__0.pack.md
│ ├── examples__build_bolt_chained_comp__0.pack.md
│ ├── examples__build_bolt_chicken__0.pack.md
│ ├── examples__build_bolt_circular__0.pack.md
│ ├── examples__build_bolt_class__0.pack.md
│ ├── examples__build_bolt_compile_cached__0.pack.md
│ ├── examples__build_bolt_custom_provider__0.pack.md
│ ├── examples__build_bolt_debug__0.pack.md
│ ├── examples__build_bolt_defer__0.pack.md
│ ├── examples__build_bolt_docstring__0.pack.md
│ ├── examples__build_bolt_flat__0.pack.md
│ ├── examples__build_bolt_function_signature__0.pack.md
│ ├── examples__build_bolt_generated__0.pack.md
│ ├── examples__build_bolt_json__0.pack.md
│ ├── examples__build_bolt_lazy__0.pack.md
│ ├── examples__build_bolt_lectern_prelude__0.pack.md
│ ├── examples__build_bolt_loop__0.pack.md
│ ├── examples__build_bolt_macro__0.pack.md
│ ├── examples__build_bolt_macro_perf__0.pack.md
│ ├── examples__build_bolt_memo2__0.pack.md
│ ├── examples__build_bolt_memo3__0.pack.md
│ ├── examples__build_bolt_memo4__0.pack.md
│ ├── examples__build_bolt_memo__0.pack.md
│ ├── examples__build_bolt_merge__0.pack.md
│ ├── examples__build_bolt_nested_location__0.pack.md
│ ├── examples__build_bolt_nesting__0.pack.md
│ ├── examples__build_bolt_order__0.pack.md
│ ├── examples__build_bolt_overgen__0.pack.md
│ ├── examples__build_bolt_overlay__0.pack.md
│ ├── examples__build_bolt_patchers__0.pack.md
│ ├── examples__build_bolt_prelude__0.pack.md
│ ├── examples__build_bolt_proc_macro__0.pack.md
│ ├── examples__build_bolt_sample_ui__0.pack.md
│ ├── examples__build_bolt_shadow_global__0.pack.md
│ ├── examples__build_bolt_strip_final_newline__0.pack.md
│ ├── examples__build_bolt_summon__0.pack.md
│ ├── examples__build_bolt_too_many_statically_nested_blocks__0.pack.md
│ ├── examples__build_bolt_type_annotations__0.pack.md
│ ├── sandbox__run_0__0.txt
│ ├── sandbox__run_1__0.txt
│ ├── sandbox__run_2__0.txt
│ ├── sandbox__run_3__0.txt
│ ├── sandbox__run_4__0.txt
│ ├── sandbox__run_5__0.txt
│ ├── sandbox__run_6__0.txt
│ ├── sandbox__run_7__0.txt
│ ├── sandbox__run_8__0.txt
│ └── spec__prototypes__0.json
├── test_bolt.py
├── test_examples.py
├── test_sandbox.py
├── test_semantics.py
└── test_spec.py
└── typings
└── pathspec.py
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github:
2 | - vberlier
3 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 |
3 | updates:
4 | - package-ecosystem: "pip"
5 | directory: "/"
6 | schedule:
7 | interval: "weekly"
8 |
9 | - package-ecosystem: "npm"
10 | directory: "/"
11 | schedule:
12 | interval: "weekly"
13 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "ms-python.python",
4 | "ms-python.vscode-pylance",
5 | "ms-python.black-formatter",
6 | "tamasfe.even-better-toml"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "python.languageServer": "Pylance",
3 | "[python]": {
4 | "editor.tabSize": 4,
5 | "editor.formatOnSave": true,
6 | "editor.formatOnType": false,
7 | "editor.formatOnPaste": false,
8 | "editor.codeActionsOnSave": {
9 | "source.organizeImports": "explicit"
10 | },
11 | "editor.defaultFormatter": "ms-python.black-formatter"
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/bolt/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "0.49.2"
2 |
3 |
4 | from .ast import *
5 | from .codegen import *
6 | from .emit import *
7 | from .helpers import *
8 | from .loop_info import *
9 | from .memo import *
10 | from .module import *
11 | from .parse import *
12 | from .plugin import *
13 | from .runtime import *
14 | from .semantics import *
15 |
--------------------------------------------------------------------------------
/bolt/contrib/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/bolt/contrib/__init__.py
--------------------------------------------------------------------------------
/bolt/plugin.py:
--------------------------------------------------------------------------------
1 | __all__ = [
2 | "bolt",
3 | "beet_default",
4 | ]
5 |
6 |
7 | from beet import Context, ListOption, configurable
8 | from pydantic.v1 import BaseModel
9 |
10 | from .runtime import Runtime
11 |
12 |
13 | class BoltOptions(BaseModel):
14 | entrypoint: ListOption[str] = ListOption()
15 | prelude: ListOption[str] = ListOption()
16 |
17 |
18 | def beet_default(ctx: Context):
19 | ctx.require(bolt)
20 |
21 |
22 | @configurable(validator=BoltOptions)
23 | def bolt(ctx: Context, opts: BoltOptions):
24 | """Plugin for configuring bolt."""
25 | runtime = ctx.inject(Runtime)
26 | runtime.evaluate.add_entrypoint(opts.entrypoint.entries())
27 | runtime.modules.add_prelude(opts.prelude.entries())
28 |
--------------------------------------------------------------------------------
/bolt/py.typed:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/bolt/py.typed
--------------------------------------------------------------------------------
/bolt/resources/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/bolt/resources/__init__.py
--------------------------------------------------------------------------------
/examples/bolt_1_20/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_1_20/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | def f():
2 | execute if entity @e[type=pig] run return 123
3 | n = 77
4 | execute return n
5 | return 99999
6 |
7 | say f()
8 |
9 | execute function ./thing:
10 | return 42
11 |
12 | return 0
13 |
--------------------------------------------------------------------------------
/examples/bolt_assets/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | resource_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 | meta:
8 | bolt:
9 | entrypoint: "*"
10 |
--------------------------------------------------------------------------------
/examples/bolt_assets/src/assets/demo/modules/foo.bolt:
--------------------------------------------------------------------------------
1 | model minecraft:block/stone {"parent": "block/cube"}
2 |
--------------------------------------------------------------------------------
/examples/bolt_basic/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: [src]
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_basic/random_data.json:
--------------------------------------------------------------------------------
1 | {
2 | "value": 42
3 | }
4 |
--------------------------------------------------------------------------------
/examples/bolt_basic/src/data/demo/functions/import_a.mcfunction:
--------------------------------------------------------------------------------
1 | from bolt import Runtime
2 |
3 | runtime = ctx.inject(Runtime)
4 |
5 | foo = 42
6 |
7 | def callback():
8 | return foo
9 |
10 | def loga(f):
11 | runtime.modules.current.namespace["bar"] *= 2
12 | say __name__
13 | say runtime.modules.current_path
14 | say f()
15 |
16 | from ./import_b import logb
17 |
18 | logb(callback)
19 |
--------------------------------------------------------------------------------
/examples/bolt_basic/src/data/demo/functions/import_b.mcfunction:
--------------------------------------------------------------------------------
1 | from bolt import Runtime
2 |
3 | runtime = ctx.inject(Runtime)
4 |
5 | bar = 7
6 |
7 | def callback():
8 | return bar
9 |
10 | def logb(f):
11 | runtime.modules.current.namespace["foo"] *= 2
12 | say __name__
13 | say runtime.modules.current_path
14 | say f()
15 |
16 | from ./import_a import loga
17 |
18 | loga(callback)
19 |
--------------------------------------------------------------------------------
/examples/bolt_basic/src/data/demo/functions/thing.mcfunction:
--------------------------------------------------------------------------------
1 | from mecha import Mecha
2 | from bolt import Runtime
3 |
4 | mc = ctx.inject(Mecha)
5 | runtime = ctx.inject(Runtime)
6 |
7 | def do_stuff(a, b):
8 | import math
9 | return a + math.cos(b)
10 |
11 | def call_recursive():
12 | if score @s loop_again matches 1 function runtime.modules.current_path
13 |
14 | def raw(cmd):
15 | runtime.commands.append(mc.parse(cmd, using="command"))
16 |
--------------------------------------------------------------------------------
/examples/bolt_basic/src/data/demo/functions/utils.mcfunction:
--------------------------------------------------------------------------------
1 | say this doesn't conflict with the demo:utils module
2 |
--------------------------------------------------------------------------------
/examples/bolt_basic/src/data/demo/modules/utils.bolt:
--------------------------------------------------------------------------------
1 | import json
2 |
3 | def something():
4 | say f"this is from {__name__}"
5 |
6 | def load_storage(storage_id, filename):
7 | path = ctx.directory / filename
8 | merge function_tag minecraft:load {"values": [generate_path("load_storage")]}
9 | append function generate_path("load_storage"):
10 | data merge storage storage_id json.loads(path.read_text())
11 | say json loaded!
12 |
--------------------------------------------------------------------------------
/examples/bolt_chained_comp/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_chicken/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: [src]
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_chicken/src/data/demo/functions/chicken.mcfunction:
--------------------------------------------------------------------------------
1 | from ./utils import summon_chicken_army
2 |
3 | say Go forth, my minions!
4 | summon_chicken_army(16)
5 |
--------------------------------------------------------------------------------
/examples/bolt_chicken/src/data/demo/modules/utils.bolt:
--------------------------------------------------------------------------------
1 | infinite_invisibility = {
2 | Id: 14,
3 | Duration: 999999,
4 | Amplifier: 1,
5 | ShowParticles: false,
6 | }
7 |
8 | def summon_chicken_army(n):
9 | for i in range(n):
10 | summon chicken ~i ~ ~ {
11 | Tags: [f"quack{i}"],
12 | IsChickenJockey: true,
13 | Passengers: [{
14 | id: zombie,
15 | IsBaby: true,
16 | ActiveEffects: [infinite_invisibility]
17 | }]
18 | }
19 |
--------------------------------------------------------------------------------
/examples/bolt_circular/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load:
5 | data/demo/modules: src
6 | pipeline:
7 | - mecha
8 | meta:
9 | bolt:
10 | entrypoint: "demo:main"
11 |
--------------------------------------------------------------------------------
/examples/bolt_circular/src/bar.bolt:
--------------------------------------------------------------------------------
1 | import ./foo as foo
2 |
3 | VALUE = 33
4 |
5 | def b():
6 | return foo.VALUE
7 |
--------------------------------------------------------------------------------
/examples/bolt_circular/src/foo.bolt:
--------------------------------------------------------------------------------
1 | import ./bar as bar
2 |
3 | VALUE = 42
4 |
5 | def a():
6 | return bar.VALUE
7 |
--------------------------------------------------------------------------------
/examples/bolt_circular/src/main.bolt:
--------------------------------------------------------------------------------
1 | from ./foo import a
2 | from ./bar import b
3 |
4 | function ./thing:
5 | say a()
6 | say b()
7 |
--------------------------------------------------------------------------------
/examples/bolt_class/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_class/src/data/demo/functions/pydantic.mcfunction:
--------------------------------------------------------------------------------
1 | from pydantic.v1 import BaseModel
2 |
3 | class Model(BaseModel, frozen=True):
4 | a: int
5 | b: str
6 |
7 | say Model(a="123", b="123").json()
8 |
--------------------------------------------------------------------------------
/examples/bolt_compile_cached/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 | - compile_cached
8 |
--------------------------------------------------------------------------------
/examples/bolt_compile_cached/cached/slow.mcfunction:
--------------------------------------------------------------------------------
1 | for i in range(10):
2 | say f"something slow {i}"
3 |
--------------------------------------------------------------------------------
/examples/bolt_compile_cached/compile_cached.py:
--------------------------------------------------------------------------------
1 | from beet import Context, sandbox, subproject
2 |
3 |
4 | def beet_default(ctx: Context):
5 | ctx.require(sandbox(compile_cached))
6 |
7 |
8 | def compile_cached(ctx: Context):
9 | cached_data_pack = ctx.cache["compile_cached"].directory / "data_pack"
10 |
11 | if cached_data_pack.is_dir():
12 | ctx.data.load(cached_data_pack)
13 | else:
14 | ctx.require(
15 | subproject(
16 | {
17 | "require": ["bolt"],
18 | "data_pack": {"load": {"data/demo/functions/cached": "cached"}},
19 | "pipeline": ["mecha"],
20 | }
21 | )
22 | )
23 | ctx.data.save(path=cached_data_pack, overwrite=True)
24 |
--------------------------------------------------------------------------------
/examples/bolt_compile_cached/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | say hello
2 |
--------------------------------------------------------------------------------
/examples/bolt_custom_provider/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - custom_provider
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 | - custom_provider.remove_custom_modules
8 |
--------------------------------------------------------------------------------
/examples/bolt_custom_provider/custom_provider.py:
--------------------------------------------------------------------------------
1 | from typing import ClassVar
2 |
3 | from beet import Context, NamespaceFileScope, TextFile
4 | from mecha import FileTypeCompilationUnitProvider, Mecha
5 |
6 |
7 | class Custom(TextFile):
8 | scope: ClassVar[NamespaceFileScope] = ("custom",)
9 | extension: ClassVar[str] = ".bolt"
10 |
11 |
12 | def beet_default(ctx: Context):
13 | ctx.data.extend_namespace.append(Custom)
14 |
15 | ctx.require("bolt")
16 |
17 | mc = ctx.inject(Mecha)
18 | mc.providers = [FileTypeCompilationUnitProvider([Custom])]
19 |
20 |
21 | def remove_custom_modules(ctx: Context):
22 | for pack in [ctx.data, *ctx.data.overlays.values()]:
23 | pack[Custom].clear()
24 |
--------------------------------------------------------------------------------
/examples/bolt_custom_provider/src/data/demo/custom/stuff.bolt:
--------------------------------------------------------------------------------
1 | function ~/abc:
2 | say 123
3 |
--------------------------------------------------------------------------------
/examples/bolt_custom_provider/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | value = 123
2 | print(value)
3 | say this should be left untouched
4 |
--------------------------------------------------------------------------------
/examples/bolt_debug/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt.contrib.debug_codegen
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_debug/src/data/demo/functions/bar.mcfunction:
--------------------------------------------------------------------------------
1 | say hello without anything fancy
2 |
--------------------------------------------------------------------------------
/examples/bolt_debug/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | def say_hello():
2 | say hello
3 |
4 | say_hello()
5 |
--------------------------------------------------------------------------------
/examples/bolt_defer/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_defer/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | from mecha import AstString
2 | from bolt.contrib.defer import Defer, AstDefer
3 |
4 | defer = ctx.inject(Defer)
5 |
6 | counter = 0
7 | def foo():
8 | global counter
9 | say counter
10 | counter += 1
11 |
12 | say start
13 | foo()
14 | foo()
15 | defer(foo)
16 | defer(foo)
17 | say end
18 |
19 | counter = 7
20 |
21 | @defer
22 | def bar():
23 | function ./bar:
24 | defer(foo)
25 | global counter
26 | counter *= 2
27 |
28 | def format_deferred_tag():
29 | return AstString(value=f"thing{counter}")
30 |
31 | tag @p add AstDefer(callback=format_deferred_tag)
32 |
--------------------------------------------------------------------------------
/examples/bolt_docstring/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_docstring/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | value = """
2 | hello
3 | world
4 | """
5 |
6 | say repr(value)
7 |
8 | def f():
9 | """My function"""
10 | return 42
11 |
12 | say f()
13 | say f.__doc__
14 |
15 | def g(a=123):
16 | """My other function"""
17 | return a
18 |
19 | say g()
20 | say g.__doc__
21 |
22 | class A:
23 | """This is a class.
24 |
25 | It doesn't do anything.
26 | """
27 |
28 | say repr(A.__doc__)
29 |
30 | value = r"""
31 | foo\n\nbar
32 | """
33 |
34 | say repr(value)
35 |
--------------------------------------------------------------------------------
/examples/bolt_flat/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load:
5 | data/demo/modules: "@demo"
6 | pipeline:
7 | - mecha
8 | meta:
9 | bolt:
10 | entrypoint: "demo:main"
11 |
--------------------------------------------------------------------------------
/examples/bolt_flat/demo/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/examples/bolt_flat/demo/__init__.py
--------------------------------------------------------------------------------
/examples/bolt_flat/demo/main.bolt:
--------------------------------------------------------------------------------
1 | from demo.math import add
2 |
3 | function ./foo:
4 | say add(2, 3)
5 |
6 | function ./oby:
7 | stat_list = [
8 | "damage",
9 | "attack_speed",
10 | "multishot",
11 | "piercing"
12 | ]
13 |
14 | if data storage firework:temp data.item.tag.aftermath.stats:
15 |
16 | for stat in stat_list:
17 | if data storage firework:temp f'data.item.tag.aftermath.stats.{stat}':
18 | say f'{stat}, present'
19 |
20 | unless data storage firework:temp data.item.tag.aftermath.stats:
21 | say 'hi'
22 |
--------------------------------------------------------------------------------
/examples/bolt_flat/demo/math.py:
--------------------------------------------------------------------------------
1 | def add(a: int, b: int) -> int:
2 | return a + b
3 |
--------------------------------------------------------------------------------
/examples/bolt_function_signature/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load:
5 | data/demo/functions/foo.mcfunction: "foo.mcfunction"
6 | pipeline:
7 | - mecha
8 |
--------------------------------------------------------------------------------
/examples/bolt_function_signature/foo.mcfunction:
--------------------------------------------------------------------------------
1 | def f():
2 | pass
3 |
4 | def f(a):
5 | pass
6 |
7 | def f(a=1):
8 | pass
9 |
10 | def f(a=1,):
11 | pass
12 |
13 | def f(a=1, /):
14 | pass
15 |
16 | def f(a, /, b):
17 | pass
18 |
19 | def f(a=1, /, b=2):
20 | pass
21 |
22 | def f(a=1, /, b=2, *args):
23 | pass
24 |
25 | def f(a, /, b, *, c):
26 | pass
27 |
28 | def f(a=1, /, b=2, *, c=3):
29 | pass
30 |
31 | def f(a=1, /, b=2, *, c=3, **kwargs):
32 | pass
33 |
34 | def f(a=1, /, b=2, *args, c=3, **kwargs):
35 | pass
36 |
--------------------------------------------------------------------------------
/examples/bolt_generated/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: [src]
5 | pipeline:
6 | - demo
7 | - mecha
8 |
--------------------------------------------------------------------------------
/examples/bolt_generated/demo.py:
--------------------------------------------------------------------------------
1 | from beet import Context, Function
2 |
3 | generated_code = """
4 | execute if score #smithed.core load.status matches 1 function ./0:
5 | data merge storage smithed:log {message:'["Could not find ",{"text":"#smithed.prevent_aggression 0.0.1","color":"red"}]',type:'ERROR'}
6 | function #smithed:core/pub/technical/tools/log
7 | """
8 |
9 |
10 | def beet_default(ctx: Context):
11 | ctx.data["demo:generated"] = Function(generated_code)
12 |
--------------------------------------------------------------------------------
/examples/bolt_generated/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | a = 123
2 | say a
3 |
--------------------------------------------------------------------------------
/examples/bolt_json/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - mecha.contrib.json_files
3 | - bolt
4 | data_pack:
5 | load: "src"
6 | pipeline:
7 | - mecha
8 |
--------------------------------------------------------------------------------
/examples/bolt_json/src/data/minecraft/tags/functions/load.json:
--------------------------------------------------------------------------------
1 | name = demo:foo
2 |
3 | {
4 | "values": [name]
5 | }
6 |
7 | function name:
8 | say hello
9 |
--------------------------------------------------------------------------------
/examples/bolt_lazy/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 | meta:
8 | bolt:
9 | entrypoint:
10 | - "*"
11 | - "!*.lazy"
12 |
--------------------------------------------------------------------------------
/examples/bolt_lazy/src/data/demo/modules/foo.bolt:
--------------------------------------------------------------------------------
1 | import ./hello1.lazy as _
2 |
--------------------------------------------------------------------------------
/examples/bolt_lazy/src/data/demo/modules/hello1.lazy.bolt:
--------------------------------------------------------------------------------
1 | function ./hello1:
2 | say hello1
3 |
--------------------------------------------------------------------------------
/examples/bolt_lazy/src/data/demo/modules/hello2.lazy.bolt:
--------------------------------------------------------------------------------
1 | function ./hello2:
2 | say hello2
3 |
--------------------------------------------------------------------------------
/examples/bolt_lectern_prelude/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | pipeline:
4 | - lectern
5 | - mecha
6 | meta:
7 | lectern:
8 | load: "source.txt"
9 | bolt:
10 | prelude: "demo:prelude"
11 |
--------------------------------------------------------------------------------
/examples/bolt_lectern_prelude/source.txt:
--------------------------------------------------------------------------------
1 | @module demo:prelude
2 | stuff = 123
3 |
4 | @function demo:foo
5 | say stuff
6 |
7 | @overlay dummy
8 | @module demo:prelude
9 | stuff = 456
10 |
11 | @function demo:foo
12 | say stuff
13 |
--------------------------------------------------------------------------------
/examples/bolt_loop/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_loop/src/data/demo/functions/init.mcfunction:
--------------------------------------------------------------------------------
1 | append function_tag minecraft:load {
2 | "values": [__name__]
3 | }
4 |
5 | scoreboard objectives add global dummy
6 |
--------------------------------------------------------------------------------
/examples/bolt_macro/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_macro/src/data/demo/functions/bar.mcfunction:
--------------------------------------------------------------------------------
1 | from ./foo import foo, setblock, do_twice, >>, execute, tellraw, !
2 |
3 | foo
4 | foo 4
5 | foo 3 double
6 | foo 3 hello @a[
7 | scores = {
8 | x = 42
9 | }
10 | ]
11 |
12 | setblock
13 | setblock stone
14 | setblock 1 2 3
15 | setblock 1 2 3 stone
16 |
17 | do_twice:
18 | say this is repeated twice
19 |
20 | >> Custom symbols work
21 | as @a run >> Even inside execute
22 | as @a >> Overload execute to allow implicit "run"
23 |
24 | tellraw @s from ./dummy_message
25 |
26 | ! @e !
27 |
28 | from ./foo import abc
29 | abc 42
30 |
--------------------------------------------------------------------------------
/examples/bolt_macro_perf/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_macro_perf/src/data/demo/functions/export.mcfunction:
--------------------------------------------------------------------------------
1 | # Importing macros doesn't cause a command tree update when there is no code below
2 |
3 | from ./lib import foo1, foo2
4 | from ./lib import foo3
5 |
--------------------------------------------------------------------------------
/examples/bolt_macro_perf/src/data/demo/functions/func1.mcfunction:
--------------------------------------------------------------------------------
1 | # Importing multiple macros in a row will update the command tree in a single batch
2 |
3 | from ./lib import foo1, foo2
4 | from ./lib import foo3
5 |
6 | foo1
7 | foo2
8 | foo3
9 |
--------------------------------------------------------------------------------
/examples/bolt_macro_perf/src/data/demo/functions/func2.mcfunction:
--------------------------------------------------------------------------------
1 | # If multiple scopes end up using the same set of macros they will share the same underlying command spec
2 |
3 | from ./export import foo1, foo2, foo3
4 |
5 | foo1
6 | foo2
7 | foo3
8 |
--------------------------------------------------------------------------------
/examples/bolt_macro_perf/src/data/demo/functions/lib.mcfunction:
--------------------------------------------------------------------------------
1 | # Defining multiple macros in a row will update the command tree in a single batch
2 |
3 | macro foo1:
4 | say foo1
5 |
6 | macro foo2:
7 | say foo2
8 |
9 | macro foo3:
10 | say foo3
11 |
12 | macro foo4:
13 | say foo4
14 |
--------------------------------------------------------------------------------
/examples/bolt_memo/beet.yml:
--------------------------------------------------------------------------------
1 | pipeline:
2 | - require:
3 | - bolt
4 | data_pack:
5 | load: "src"
6 | pipeline:
7 | - mecha
8 | - beet.contrib.rename_files
9 | - beet.contrib.find_replace
10 | meta:
11 | rename_files:
12 | data_pack:
13 | match: "demo:*"
14 | find: "demo:([a-z_/]+)"
15 | replace: 'demo:ref/\1'
16 | find_replace:
17 | data_pack:
18 | match: "demo:*"
19 | substitute:
20 | find: "demo:([a-z_/]+)"
21 | replace: 'demo:ref/\1'
22 | - require:
23 | - bolt
24 | data_pack:
25 | load: "src"
26 | pipeline:
27 | - mecha
28 |
--------------------------------------------------------------------------------
/examples/bolt_memo/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | memo:
2 | pass
3 |
4 | bop = 123
5 | memo bop, foo=bop, foo:
6 | thing = foo
7 | function ./ayy:
8 | say thing
9 | say foo
10 |
11 | a = (1, 2)
12 | a = (a, a)
13 | a = (a, a)
14 |
15 | memo a, a:
16 | say a
17 |
18 | say wat
19 |
20 | a = 1
21 | b = 2
22 | memo a, b:
23 | say (a + b)
24 | memo b:
25 | say b
26 |
--------------------------------------------------------------------------------
/examples/bolt_memo/src/data/demo/functions/vars.mcfunction:
--------------------------------------------------------------------------------
1 | g_uwu = 1
2 | memo:
3 | g_uwu = 5
4 | say g_uwu
5 |
6 | def ok():
7 | memo:
8 | value = 10
9 | global g_uwu
10 | g_uwu = value
11 |
12 | ok()
13 | say g_uwu
14 |
15 | def fib(n):
16 | if n <= 1:
17 | return n
18 | memo n:
19 | result = fib(n - 1) + fib(n - 2)
20 | return result
21 |
22 | for i in range(50):
23 | say f"fib({i}) = {fib(i)}"
24 |
--------------------------------------------------------------------------------
/examples/bolt_memo2/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_memo2/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | say ok
2 | memo:
3 | append function __name__:
4 | say wat
5 |
--------------------------------------------------------------------------------
/examples/bolt_memo3/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_memo3/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | n = 5
2 | execute function ~/{n}:
3 | say 1
4 | memo n:
5 | say 2
6 | append function ~/:
7 | say 3
8 |
--------------------------------------------------------------------------------
/examples/bolt_memo4/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_memo4/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | def stuff():
2 | memo:
3 | append function __name__:
4 | say something
5 |
6 | say before
7 | stuff()
8 | stuff()
9 | say after
10 |
11 | function ./bar:
12 | say bop
13 | stuff()
14 |
--------------------------------------------------------------------------------
/examples/bolt_merge/beet.yml:
--------------------------------------------------------------------------------
1 | data_pack:
2 | load: ["pack_1", "pack_2"]
3 | require:
4 | - bolt
5 | - mecha.contrib.messages
6 | - beet.contrib.auto_yaml
7 | pipeline:
8 | - mecha
9 |
--------------------------------------------------------------------------------
/examples/bolt_merge/pack_1/data/pack_1/functions/bob.mcfunction:
--------------------------------------------------------------------------------
1 | from pack_1:utils import hello
2 | hello("Bob")
3 |
--------------------------------------------------------------------------------
/examples/bolt_merge/pack_1/data/pack_1/functions/utils.mcfunction:
--------------------------------------------------------------------------------
1 | def hello(name):
2 | say f"Hello, {name}!"
3 | hello("Alice")
4 |
--------------------------------------------------------------------------------
/examples/bolt_merge/pack_2/data/pack_2/functions/carol.mcfunction:
--------------------------------------------------------------------------------
1 | from pack_1:utils import hello
2 | hello("Carol")
3 |
--------------------------------------------------------------------------------
/examples/bolt_nested_location/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_nested_location/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | execute function ~/thing1:
2 | as @a function ~/thing2:
3 | function ~/thing{3:03}/hello
4 | say ~/thing{123456789:x}/hello
5 |
6 | schedule function ~/blob 2s append:
7 | say (~/, ~/../{~/[:3]})
8 |
9 | function ./welp:
10 | if predicate ~/ say yes
11 |
12 | function ~/{"":_<2}
13 | function ~/foo{"bar":_^5}
14 |
--------------------------------------------------------------------------------
/examples/bolt_nesting/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_nesting/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | from contextlib import contextmanager
2 | from bolt import Runtime
3 |
4 | runtime = ctx.inject(Runtime)
5 | say runtime.nesting
6 |
7 | @contextmanager
8 | def stuff():
9 | if score foo temp matches 77:
10 | yield
11 |
12 | as @s say runtime.nesting
13 |
14 | name = ./thing
15 |
16 | with stuff():
17 | function name:
18 | say runtime.nesting
19 | say runtime.nesting
20 |
21 | say runtime.nesting
22 |
--------------------------------------------------------------------------------
/examples/bolt_order/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 | meta:
8 | bolt:
9 | entrypoint: hello:entry_point
10 |
--------------------------------------------------------------------------------
/examples/bolt_order/src/data/hello/modules/entry_point.bolt:
--------------------------------------------------------------------------------
1 | from hello:main import i_run_last
2 |
3 | i_run_last()
4 |
--------------------------------------------------------------------------------
/examples/bolt_order/src/data/hello/modules/main.bolt:
--------------------------------------------------------------------------------
1 | def i_run_last():
2 | print(2)
3 | append function hello:world:
4 | say second
5 |
6 | print(1)
7 | append function hello:world:
8 | say first
9 |
--------------------------------------------------------------------------------
/examples/bolt_overgen/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt.contrib.sandbox
3 | - overgen.define_custom_resources
4 | - overgen.define_compilation_unit_providers
5 | - overgen.define_module_globals
6 | data_pack:
7 | load: "src"
8 | pipeline:
9 | - mecha
10 | - overgen.remove_custom_resources
11 |
--------------------------------------------------------------------------------
/examples/bolt_overgen/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | value = "abc"
2 | print(value)
3 | say this should be left untouched
4 |
--------------------------------------------------------------------------------
/examples/bolt_overgen/src/data/demo/overgen/stuff.bolt:
--------------------------------------------------------------------------------
1 | declare_overlay_formats(
2 | min_inclusive=18,
3 | max_inclusive=19,
4 | )
5 |
6 | function ./foo:
7 | say stuff
8 |
--------------------------------------------------------------------------------
/examples/bolt_overlay/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_overlay/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | from ./vars import stuff
2 | say f"my {stuff}"
3 |
--------------------------------------------------------------------------------
/examples/bolt_overlay/src/data/demo/modules/vars.bolt:
--------------------------------------------------------------------------------
1 | stuff = 123
2 |
--------------------------------------------------------------------------------
/examples/bolt_overlay/src/dummy_overlay/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | from ./vars import stuff
2 | say (1 + 2)
3 | say stuff
4 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt.contrib.sandbox
3 | - patchers.define_custom_resources
4 | data_pack:
5 | load: "src"
6 | pipeline:
7 | - patchers.process_files
8 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | say this is not compiled
2 |
3 | value = 123
4 | print(value)
5 |
6 | # As long as you don't mc.compile(ctx.data) or include "mecha" in the pipeline
7 | # you can leverage mecha's compiler and the bolt runtime for other purposes
8 | # without affecting function files in the output pack.
9 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/src/data/demo/patchers/arrow_recipes.bolt:
--------------------------------------------------------------------------------
1 | targets = {
2 | recipes: "minecraft:*arrow"
3 | }
4 |
5 | def patch(name, recipe):
6 | if recipe.type == minecraft:crafting_shaped:
7 | result = recipe.result
8 |
9 | recipe.key."#" = {
10 | tag: minecraft:coals
11 | }
12 |
13 | if result.item == minecraft:arrow:
14 | del recipe.key["X"]
15 | recipe.pattern[0] = "#"
16 |
17 | result["count"] += 2 + (10 - 9) * 3
18 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/src/data/minecraft/recipes/arrow.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "minecraft:crafting_shaped",
3 | "category": "equipment",
4 | "key": {
5 | "#": {
6 | "item": "minecraft:stick"
7 | },
8 | "X": {
9 | "item": "minecraft:flint"
10 | },
11 | "Y": {
12 | "item": "minecraft:feather"
13 | }
14 | },
15 | "pattern": ["X", "#", "Y"],
16 | "result": {
17 | "count": 4,
18 | "item": "minecraft:arrow"
19 | },
20 | "show_notification": true
21 | }
22 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/src/data/minecraft/recipes/spectral_arrow.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "minecraft:crafting_shaped",
3 | "category": "equipment",
4 | "key": {
5 | "#": {
6 | "item": "minecraft:glowstone_dust"
7 | },
8 | "X": {
9 | "item": "minecraft:arrow"
10 | }
11 | },
12 | "pattern": [" # ", "#X#", " # "],
13 | "result": {
14 | "count": 2,
15 | "item": "minecraft:spectral_arrow"
16 | },
17 | "show_notification": true
18 | }
19 |
--------------------------------------------------------------------------------
/examples/bolt_patchers/src/data/minecraft/recipes/tipped_arrow.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "minecraft:crafting_special_tippedarrow",
3 | "category": "misc"
4 | }
5 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/demo/functions/bar.mcfunction:
--------------------------------------------------------------------------------
1 | dump_ast()
2 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | !!!
2 | greet anonymous()
3 | summon CALAMAR
4 | CALAMAR = None
5 |
6 | !!!
7 | alright_then()
8 | what about minecraft:becomeduck
9 |
10 | !!!
11 | dump_ast()
12 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/demo/modules/macros.bolt:
--------------------------------------------------------------------------------
1 | macro greet name=brigadier:string{"type": "word"}:
2 | say f"hello {name.value}"
3 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/demo/modules/other.bolt:
--------------------------------------------------------------------------------
1 | from bolt import Runtime
2 |
3 | CALAMAR = minecraft:squid
4 |
5 | def dump_ast():
6 | runtime = ctx.inject(Runtime)
7 | function generate_path():
8 | for line in runtime.modules.current.ast.dump().splitlines():
9 | raw f"# {line}"
10 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/demo/modules/prelude.bolt:
--------------------------------------------------------------------------------
1 | from ./macros import greet
2 | from ./other import CALAMAR, dump_ast
3 |
4 | macro !!!:
5 | say !!!
6 |
7 | def anonymous() -> str:
8 | return "anonymous"
9 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/no_idea/modules/aaa.bolt:
--------------------------------------------------------------------------------
1 | from ./bbb import okok
2 | from demo:macros import greet
3 |
4 | def alright_then():
5 | okok()
6 | greet steve
7 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/no_idea/modules/bbb.bolt:
--------------------------------------------------------------------------------
1 | def okok():
2 | say ok ok
3 |
--------------------------------------------------------------------------------
/examples/bolt_prelude/src/data/no_idea/modules/prelude.bolt:
--------------------------------------------------------------------------------
1 | from ./aaa import alright_then
2 |
3 | macro what about(stream):
4 | from mecha import delegate
5 | node = delegate("resource_location", stream)
6 | say repr(node)
7 |
--------------------------------------------------------------------------------
/examples/bolt_proc_macro/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_proc_macro/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | from ./util import repeat, lisp
2 |
3 | value = 3
4 |
5 | repeat 7:
6 | value += 1
7 |
8 | repeat 3:
9 | say value
10 |
11 | as @a run repeat 3:
12 | say value
13 |
14 | repeat until value < 5:
15 | say value
16 | value -= 1
17 |
18 | repeat until @a[scores={counter=10}]:
19 | scoreboard players add @r counter 1
20 |
21 | lisp foo
22 | lisp 123
23 | lisp (foo 123)
24 | lisp (foo 123 () (bar))
25 | lisp (
26 | (defun do_math (x y)
27 | (add x y))
28 | (defun do_more_math (x y)
29 | (mul (do_math x y) y))
30 | )
31 |
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - sample_ui.resources
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - sample_ui.generate
7 |
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/sample_ui/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/examples/bolt_sample_ui/sample_ui/__init__.py
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/sample_ui/generate.py:
--------------------------------------------------------------------------------
1 | from beet import Context, subproject
2 |
3 | from .resources import UiScreen
4 |
5 |
6 | def beet_default(ctx: Context):
7 | all_screens = {
8 | name: screen_file.text for name, screen_file in ctx.data[UiScreen].items()
9 | }
10 | ctx.data[UiScreen].clear()
11 |
12 | ctx.require(
13 | subproject(
14 | {
15 | "require": ["bolt"],
16 | "data_pack": {"load": {"data/sample_ui/modules": "@sample_ui/modules"}},
17 | "pipeline": ["mecha"],
18 | "meta": {
19 | "bolt": {"entrypoint": "sample_ui:main"},
20 | "sample_ui": {"all_screens": all_screens},
21 | },
22 | }
23 | )
24 | )
25 |
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/sample_ui/modules/main.bolt:
--------------------------------------------------------------------------------
1 | import xml.etree.ElementTree as ET
2 |
3 | for name, content in ctx.meta.sample_ui.all_screens.items():
4 | parser = ET.XMLPullParser(["start", "end"])
5 | parser.feed(content)
6 |
7 | function name:
8 | for event, elem in parser.read_events():
9 | say (event, elem.tag, elem.attrib)
10 |
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/sample_ui/resources.py:
--------------------------------------------------------------------------------
1 | from typing import ClassVar
2 |
3 | from beet import Context, NamespaceFileScope, TextFileBase
4 |
5 |
6 | class UiScreen(TextFileBase[str]):
7 | scope: ClassVar[NamespaceFileScope] = ("ui_screens",)
8 | extension: ClassVar[str] = ".xml"
9 |
10 |
11 | def beet_default(ctx: Context):
12 | ctx.data.extend_namespace.append(UiScreen)
13 |
--------------------------------------------------------------------------------
/examples/bolt_sample_ui/src/data/demo/ui_screens/foo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/bolt_shadow_global/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | - demo
4 | data_pack:
5 | load: [src]
6 | pipeline:
7 | - mecha
8 |
--------------------------------------------------------------------------------
/examples/bolt_shadow_global/demo.py:
--------------------------------------------------------------------------------
1 | from beet import Context
2 |
3 | from bolt import Runtime
4 |
5 |
6 | def beet_default(ctx: Context):
7 | runtime = ctx.inject(Runtime)
8 | runtime.expose("max", lambda *args: args)
9 |
--------------------------------------------------------------------------------
/examples/bolt_shadow_global/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | say max(1, 2, 3)
2 |
--------------------------------------------------------------------------------
/examples/bolt_strip_final_newline/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_strip_final_newline/src/data/demo/functions/foo.mcfunction:
--------------------------------------------------------------------------------
1 | scoreboard players operation foo set = bar set
--------------------------------------------------------------------------------
/examples/bolt_summon/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_too_many_statically_nested_blocks/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt.contrib.debug_codegen
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/examples/bolt_type_annotations/beet.yml:
--------------------------------------------------------------------------------
1 | require:
2 | - bolt
3 | data_pack:
4 | load: "src"
5 | pipeline:
6 | - mecha
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "scripts": {
3 | "watch": "poetry run pyright -w",
4 | "check": "poetry run pyright"
5 | },
6 | "devDependencies": {
7 | "pyright": "^1.1.293"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/setup.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python
2 |
3 | # This is a shim to allow GitHub to detect the package. The build is done with poetry.
4 |
5 | import setuptools
6 |
7 | if __name__ == "__main__":
8 | setuptools.setup(name="bolt")
9 |
--------------------------------------------------------------------------------
/tests/__init__.py:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mcbeet/bolt/cf98369e2f62e21e1e95d5f071d71e5b894b5612/tests/__init__.py
--------------------------------------------------------------------------------
/tests/conftest.py:
--------------------------------------------------------------------------------
1 | import pytest
2 | from beet import run_beet
3 |
4 |
5 | @pytest.fixture(scope="session")
6 | def ctx():
7 | with run_beet({"require": ["bolt"]}) as ctx:
8 | yield ctx
9 |
10 |
11 | @pytest.fixture(scope="session")
12 | def ctx_sandbox():
13 | with run_beet({"require": ["bolt.contrib.sandbox"]}) as ctx:
14 | yield ctx
15 |
--------------------------------------------------------------------------------
/tests/resources/sandbox_examples.mcfunction:
--------------------------------------------------------------------------------
1 | import sys
2 | ###
3 | def f():
4 | pass
5 | f.__code__
6 | ###
7 | def hello():
8 | return "world"
9 | say hello.__name__.capitalize()
10 | ###
11 | say ctx.data.functions.setdefault("demo:foo")
12 | ###
13 | print(f'foo {str.__name__} bar')
14 | ###
15 | "a{0.__class__}b".format(42)
16 | ###
17 | foo = "a{x.__class__}b".format_map({"x":42})
18 | ###
19 | say __name__.format()
20 | ###
21 | open("/etc/passwd")
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_0__0.txt:
--------------------------------------------------------------------------------
1 | 0
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=2, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=1, lineno=1, colno=2)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=1, lineno=1, colno=2)
15 | value: 0
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_0__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 0
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=2, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_100__0.txt:
--------------------------------------------------------------------------------
1 | say hello
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=9, lineno=1, colno=10)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=9, lineno=1, colno=10)
10 | identifier: 'say:message'
11 | arguments:
12 |
13 | location: SourceLocation(pos=4, lineno=1, colno=5)
14 | end_location: SourceLocation(pos=9, lineno=1, colno=10)
15 | fragments:
16 |
17 | location: SourceLocation(pos=4, lineno=1, colno=5)
18 | end_location: SourceLocation(pos=9, lineno=1, colno=10)
19 | value: 'hello'
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_100__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_105__0.txt:
--------------------------------------------------------------------------------
1 | f"hello"
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=8, lineno=1, colno=9)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=8, lineno=1, colno=9)
15 | fmt: 'hello'
16 | values:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_105__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 'hello'.format()
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_106__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 'world'
6 | foo = _bolt_var0
7 | _bolt_var1 = foo
8 | _bolt_var2 = 'hello {}'.format(_bolt_var1)
9 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
10 | ---
11 | output = _bolt_var4
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=29, lineno=3, colno=1)
17 | commands:
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_107__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 'world'
6 | foo = _bolt_var0
7 | _bolt_var1 = foo
8 | _bolt_var2 = 'hello {!r}'.format(_bolt_var1)
9 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
10 | ---
11 | output = _bolt_var4
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=31, lineno=3, colno=1)
17 | commands:
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_108__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 1
6 | _bolt_var1 = 1
7 | _bolt_var0 = _bolt_var0 + _bolt_var1
8 | _bolt_var2 = 'hello {}'.format(_bolt_var0)
9 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
10 | ---
11 | output = _bolt_var4
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=17, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_109__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 1
6 | _bolt_var1 = 1
7 | _bolt_var0 = _bolt_var0 + _bolt_var1
8 | _bolt_var2 = 'hello {:03}'.format(_bolt_var0)
9 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
10 | ---
11 | output = _bolt_var4
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=20, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_10__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 2
6 | _bolt_var1 = 54
7 | _bolt_var1 = - _bolt_var1
8 | _bolt_var2 = 10
9 | _bolt_var1 = _bolt_var1 * _bolt_var2
10 | _bolt_var0 = _bolt_var0 + _bolt_var1
11 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
12 | ---
13 | output = _bolt_var4
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=13, lineno=2, colno=1)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_110__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 1
6 | _bolt_var1 = '{{}}nope{}'.format(_bolt_var0)
7 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
8 | ---
9 | output = _bolt_var3
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=15, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_111__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var4:
5 | _bolt_var0 = 7
6 | _bolt_var1 = '{{{:08}}}'.format(_bolt_var0)
7 | _bolt_var2 = '{{{}}}'.format(_bolt_var1)
8 | _bolt_var3 = '{{{}}}'.format(_bolt_var2)
9 | yo = _bolt_var3
10 | _bolt_var5 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var4))
11 | ---
12 | output = _bolt_var5
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=37, lineno=2, colno=1)
18 | commands:
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_112__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = ''.format()
6 | yo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_113__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = '"'.format()
6 | yo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=11, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_114__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = '\\'.format()
6 | yo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=11, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_115__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected quote but got brace '}'.
2 | # line 1, column 8
3 | # 1 | yo = f"}"
4 | # : ^
5 | yo = f"}"
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_116__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Invalid escape sequence \e.
2 | # line 1, column 14
3 | # 1 | yo = f'thing \e'
4 | # : ^^
5 | yo = f'thing \e'
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_119__0.txt:
--------------------------------------------------------------------------------
1 | if True:
2 | #>ERROR Statement "yield" is not allowed in this context.
3 | # line 2, column 5
4 | # 1 | if True:
5 | # 2 | yield
6 | # : ^^^^^
7 | yield
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_11__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 2
6 | _bolt_var1 = 54
7 | _bolt_var1 = - _bolt_var1
8 | _bolt_var0 = _bolt_var0 + _bolt_var1
9 | _bolt_var2 = 10
10 | _bolt_var0 = _bolt_var0 * _bolt_var2
11 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
12 | ---
13 | output = _bolt_var4
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=15, lineno=2, colno=1)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_120__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f():
6 | yield
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=18, lineno=2, colno=10)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_121__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Can't import "demo:foo" without alias.
2 | # line 1, column 8
3 | # 1 | import demo:foo
4 | # : ^^^^^^^^
5 | import demo:foo
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_122__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Can't import "demo:thing" without alias.
2 | # line 1, column 8
3 | # 1 | import ./thing
4 | # : ^^^^^^^
5 | import ./thing
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_123__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Invalid module location "wat/is/that".
2 | # line 1, column 8
3 | # 1 | import wat/is/that
4 | # : ^^^^^^^^^^^
5 | import wat/is/that
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_124__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Invalid module location "wat/is/that".
2 | # line 1, column 6
3 | # 1 | from wat/is/that import foo
4 | # : ^^^^^^^^^^^
5 | from wat/is/that import foo
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_125__0.txt:
--------------------------------------------------------------------------------
1 | import math
2 | #>ERROR Identifier "mah" is not defined. Did you mean "math"?
3 | # line 2, column 1
4 | # 1 | import math
5 | # 2 | mah.sin(1)
6 | # : ^^^
7 | # Notes:
8 | # - Expected assignment but got literal '.sin(1)'.
9 | mah.sin(1)
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_12__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 64
6 | _bolt_var0 = - _bolt_var0
7 | _bolt_var0 = - _bolt_var0
8 | _bolt_var0 = - _bolt_var0
9 | _bolt_var1 = 64
10 | _bolt_var1 = + _bolt_var1
11 | _bolt_var1 = + _bolt_var1
12 | _bolt_var0 = _bolt_var0 + _bolt_var1
13 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
14 | ---
15 | output = _bolt_var3
16 | ---
17 | _bolt_refs[0]
18 |
19 | location: SourceLocation(pos=0, lineno=1, colno=1)
20 | end_location: SourceLocation(pos=11, lineno=2, colno=1)
21 | commands:
22 |
23 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_131__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 0
6 | setblock = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=13, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_136__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_137__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_13__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var4:
5 | _bolt_var0 = 1
6 | _bolt_var1 = 2
7 | _bolt_var0 = _bolt_var0 * _bolt_var1
8 | _bolt_var2 = 3
9 | _bolt_var0 = _bolt_var0 / _bolt_var2
10 | _bolt_var3 = 4
11 | _bolt_var0 = _bolt_var0 * _bolt_var3
12 | _bolt_var5 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var4))
13 | ---
14 | output = _bolt_var5
15 | ---
16 | _bolt_refs[0]
17 |
18 | location: SourceLocation(pos=0, lineno=1, colno=1)
19 | end_location: SourceLocation(pos=14, lineno=2, colno=1)
20 | commands:
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_145__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = []
6 | _bolt_var0 = _bolt_var0[:]
7 | a = _bolt_var0
8 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
9 | ---
10 | output = _bolt_var2
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_146__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | pass
3 | #>ERROR Positional argument not allowed after keyword arguments.
4 | # line 3, column 18
5 | # 2 | pass
6 | # 3 | f(1, 2, thing=3, 4)
7 | # : ^
8 | f(1, 2, thing=3, 4)
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_147__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | pass
3 | #>ERROR Positional argument not allowed after keyword arguments.
4 | # line 3, column 25
5 | # 2 | pass
6 | # 3 | f(1, 2, **{"thing": 3}, 4)
7 | # : ^
8 | f(1, 2, **{"thing": 3}, 4)
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_148__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | pass
3 | #>ERROR List unpacking not allowed after keyword arguments.
4 | # line 3, column 18
5 | # 2 | pass
6 | # 3 | f(1, 2, thing=3, *[4])
7 | # : ^^^^
8 | f(1, 2, thing=3, *[4])
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_149__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | pass
3 | #>ERROR List unpacking not allowed after keyword arguments.
4 | # line 3, column 25
5 | # 2 | pass
6 | # 3 | f(1, 2, **{"thing": 3}, *[4])
7 | # : ^^^^
8 | f(1, 2, **{"thing": 3}, *[4])
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_14__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var4:
5 | _bolt_var0 = 1
6 | _bolt_var1 = 2
7 | _bolt_var0 = _bolt_var0 * _bolt_var1
8 | _bolt_var2 = 3
9 | _bolt_var3 = 4
10 | _bolt_var2 = _bolt_var2 * _bolt_var3
11 | _bolt_var0 = _bolt_var0 / _bolt_var2
12 | _bolt_var5 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var4))
13 | ---
14 | output = _bolt_var5
15 | ---
16 | _bolt_refs[0]
17 |
18 | location: SourceLocation(pos=0, lineno=1, colno=1)
19 | end_location: SourceLocation(pos=16, lineno=2, colno=1)
20 | commands:
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_150__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var4:
5 | def f():
6 | pass
7 | _bolt_var0 = f
8 | _bolt_var1 = 1
9 | _bolt_var2 = 2
10 | _bolt_var3 = 3
11 | _bolt_var0 = _bolt_var0(_bolt_var1, _bolt_var2, thing=_bolt_var3)
12 | _bolt_var5 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var4))
13 | ---
14 | output = _bolt_var5
15 | ---
16 | _bolt_refs[0]
17 |
18 | location: SourceLocation(pos=0, lineno=1, colno=1)
19 | end_location: SourceLocation(pos=35, lineno=4, colno=1)
20 | commands:
21 |
22 |
23 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_154__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 'abc'
6 | _bolt_var1 = [*_bolt_var0]
7 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
8 | ---
9 | output = _bolt_var3
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_155__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Dict unpacking not allowed.
2 | # line 1, column 2
3 | # 1 | [**"abc"]
4 | # : ^^^^^^^
5 | [**"abc"]
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_156__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var4:
5 | _bolt_var0 = 1
6 | _bolt_var1 = 1
7 | _bolt_var2 = {_bolt_var0: _bolt_var1}
8 | _bolt_var3 = {**_bolt_var2}
9 | _bolt_var5 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var4))
10 | ---
11 | output = _bolt_var5
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=11, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_157__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR List unpacking not allowed.
2 | # line 1, column 2
3 | # 1 | {*{1: 1}}
4 | # : ^^^^^^^
5 | {*{1: 1}}
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_158__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 1
3 | # 1 | foo.bar = 1
4 | # : ^^^
5 | # Notes:
6 | # - Expected assignment but got literal '.bar'.
7 | foo.bar = 1
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_159__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 1
3 | # 1 | foo().bar = 1
4 | # : ^^^
5 | # Notes:
6 | # - Expected assignment but got literal '().bar'.
7 | foo().bar = 1
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_15__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 16
6 | _bolt_var1 = 5
7 | _bolt_var0 = _bolt_var0 // _bolt_var1
8 | _bolt_var2 = 7
9 | _bolt_var0 = _bolt_var0 % _bolt_var2
10 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
11 | ---
12 | output = _bolt_var4
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
18 | commands:
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_160__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 2]
2 | _bolt_helper_get_attribute_handler = _bolt_runtime.helpers['get_attribute_handler']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def f():
7 | _bolt_var0 = {}
8 | _bolt_var1 = f
9 | _bolt_helper_get_attribute_handler(_bolt_var1)["data"] = _bolt_var0
10 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
11 | ---
12 | output = _bolt_var1
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=24, lineno=2, colno=16)
18 | commands:
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_163__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_166__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_172__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Can only delete variables, attributes, or subscripted items.
2 | # line 1, column 5
3 | # 1 | del 1 + 1
4 | # : ^^^^^
5 | del 1 + 1
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_173__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected non-empty block.
2 | # line 1, column 26
3 | # 1 | execute function demo:foo:
4 | # : ^
5 | execute function demo:foo:
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_177__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected colon but got newline '\n'.
2 | # line 1, column 25
3 | # 1 | append function demo:foo
4 | append function demo:foo
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_178__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected assignment, identifier, nested_location or resource_location but got newline '\n'.
2 | # line 1, column 13
3 | # 1 | function_tag
4 | function_tag
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_179__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected identifier, nested_location or resource_location but got newline '\n'.
2 | # line 1, column 19
3 | # 1 | merge function_tag
4 | merge function_tag
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_180__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected bracket '[', curly '{', false, identifier, null, number, string or true but reached end of file.
2 | # line 1, column 34
3 | # 1 | merge function_tag minecraft:tick
4 | merge function_tag minecraft:tick
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_181__0.txt:
--------------------------------------------------------------------------------
1 | demo:foo
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=8, lineno=1, colno=9)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=8, lineno=1, colno=9)
15 | value: 'demo:foo'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_181__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | 'demo:foo'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_182__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 'demo:foo/bar'
6 | a = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=17, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_183__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected identifier but got literal 'class'.
2 | # line 1, column 5
3 | # 1 | for class in "abc":
4 | # : ^^^^^
5 | # 2 | scoreboard objectives add class dummy
6 | for class in "abc":
7 | scoreboard objectives add class dummy
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_185__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 'ab'
6 | _bolt_unpack0, _bolt_unpack1 = _bolt_var0
7 | a = _bolt_unpack0
8 | b = _bolt_unpack1
9 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
10 | ---
11 | output = _bolt_var2
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_187__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "x" is not defined.
2 | # line 1, column 8
3 | # 1 | global x
4 | # : ^
5 | global x
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_188__0.txt:
--------------------------------------------------------------------------------
1 | x = 1
2 | #>ERROR Can't make local identifier "x" global.
3 | # line 2, column 8
4 | # 1 | x = 1
5 | # 2 | global x
6 | # : ^
7 | global x
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_189__0.txt:
--------------------------------------------------------------------------------
1 | x = 1
2 | def f():
3 | #>ERROR Identifier "xx" is not defined. Did you mean "x"?
4 | # line 3, column 12
5 | # 2 | def f():
6 | # 3 | global xx
7 | # : ^^
8 | global xx
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_18__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Trailing input following final expression.
2 | # line 1, column 4
3 | # 1 | 64 §§§
4 | # : ^^^
5 | 64 §§§
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_190__0.txt:
--------------------------------------------------------------------------------
1 | def f(x):
2 | #>ERROR Can't make local identifier "x" global.
3 | # line 2, column 12
4 | # 1 | def f(x):
5 | # 2 | global x
6 | # : ^
7 | global x
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_191__0.txt:
--------------------------------------------------------------------------------
1 | x = 1
2 | def f():
3 | global x
4 | #>ERROR Can't make global identifier "x" nonlocal.
5 | # line 4, column 14
6 | # 3 | global x
7 | # 4 | nonlocal x
8 | # : ^
9 | nonlocal x
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_195__0.txt:
--------------------------------------------------------------------------------
1 | for i in range(3):
2 | #>ERROR Identifier "parent" is not defined. Did you mean "print"?
3 | # line 2, column 5
4 | # 1 | for i in range(3):
5 | # 2 | parent[i] = f"param{i}"
6 | # : ^^^^^^
7 | # Notes:
8 | # - Expected assignment but got literal '[i]'.
9 | parent[i] = f"param{i}"
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_19__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected bracket '[', curly '{', docstring, ellipsis, false, identifier or 5 other tokens but got literal '%3'.
2 | # line 1, column 6
3 | # 1 | 17 % %3
4 | # : ^^
5 | 17 % %3
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_1__0.txt:
--------------------------------------------------------------------------------
1 | 123
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=4, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=3, lineno=1, colno=4)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=3, lineno=1, colno=4)
15 | value: 123
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_1__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 123
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=4, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_200__0.txt:
--------------------------------------------------------------------------------
1 | a = 1
2 | def f():
3 | #>ERROR Identifier "a" is not defined.
4 | # line 3, column 5
5 | # 2 | def f():
6 | # 3 | a += 1
7 | # : ^
8 | # Notes:
9 | # - Use "global a" or "nonlocal a" to mutate the variable defined in outer scope.
10 | # - Expected assignment but got literal '+='.
11 | a += 1
12 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_204__0.txt:
--------------------------------------------------------------------------------
1 | "hey"
2 | #>ERROR Invalid indent following final expression.
3 | # line 2, column 5
4 | # 1 | "hey"
5 | # 2 | "hey"
6 | # : ^^^^^
7 | "hey"
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_208__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_import_module = _bolt_runtime.helpers['import_module']
3 | _bolt_helper_get_attribute_handler = _bolt_runtime.helpers['get_attribute_handler']
4 | _bolt_helper_children = _bolt_runtime.helpers['children']
5 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
6 | with _bolt_runtime.scope() as _bolt_var0:
7 | _bolt_from_import = _bolt_helper_import_module('PIL')
8 | Image = _bolt_helper_get_attribute_handler(_bolt_from_import)["Image"]
9 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
10 | ---
11 | output = _bolt_var1
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=22, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_212__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected bracket '[', curly '{', docstring, ellipsis, false, identifier or 8 other tokens but got invalid ':'.
2 | # line 1, column 5
3 | # 1 | with:
4 | # : ^
5 | # 2 | pass
6 | with:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_213__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected non-empty block.
2 | # line 1, column 10
3 | # 1 | with None:
4 | # : ^
5 | with None:
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_214__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected identifier but got invalid ':'.
2 | # line 1, column 13
3 | # 1 | with None as:
4 | # : ^
5 | with None as:
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_217__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def _bolt_macro0():
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=19, lineno=2, colno=9)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_21__0.txt:
--------------------------------------------------------------------------------
1 | "this"
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=7, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=6, lineno=1, colno=7)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=6, lineno=1, colno=7)
15 | value: 'this'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_21__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | 'this'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=7, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_222__0.txt:
--------------------------------------------------------------------------------
1 | def thing():
2 | macro bar:
3 | pass
4 | bar
5 | #>ERROR Identifier "bar" is not defined.
6 | # line 5, column 1
7 | # 3 | pass
8 | # 4 | bar
9 | # 5 | bar
10 | # : ^^^
11 | # Notes:
12 | # - Expected assignment but got newline '\n'.
13 | bar
14 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_223__0.txt:
--------------------------------------------------------------------------------
1 | macro foo:
2 | macro bar:
3 | foo
4 | bar
5 | def thing():
6 | #>ERROR Identifier "bar" is not defined.
7 | # line 6, column 5
8 | # 5 | def thing():
9 | # 6 | bar
10 | # : ^^^
11 | # Notes:
12 | # - Expected assignment but got newline '\n'.
13 | bar
14 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_224__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Specifying a tag is not allowed '#brigadier:integer'.
2 | # line 1, column 15
3 | # 1 | macro foo bar=#brigadier:integer:
4 | # : ^^^^^^^^^^^^^^^^^^
5 | # 2 | pass
6 | macro foo bar=#brigadier:integer:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_225__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Unrecognized argument parser "brigadier:does_not_exist".
2 | # line 1, column 15
3 | # 1 | macro foo bar=brigadier:does_not_exist:
4 | # : ^^^^^^^^^^^^^^^^^^^^^^^^
5 | # 2 | pass
6 | macro foo bar=brigadier:does_not_exist:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_22__0.txt:
--------------------------------------------------------------------------------
1 | "this\nthat"
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=13, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=12, lineno=1, colno=13)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=12, lineno=1, colno=13)
15 | value: 'this\nthat'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_22__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | 'this\nthat'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=13, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_230__0.txt:
--------------------------------------------------------------------------------
1 | macro foo:
2 | pass
3 | #>ERROR Expected colon, literal 'advancement', literal 'align', literal 'anchored', literal 'append', literal 'as' or 158 other tokens but got literal 'foo'.
4 | # line 3, column 7
5 | # 2 | pass
6 | # 3 | as @p foo
7 | # : ^^^
8 | as @p foo
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_232__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Forbidden literal "macro".
2 | # line 1, column 7
3 | # 1 | macro macro:
4 | # : ^^^^^
5 | # 2 | pass
6 | macro macro:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_233__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_proc_macros = {}
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def _bolt_macro0(stream):
7 | pass
8 | _bolt_proc_macros['foo:proc_macro_overload0'] = _bolt_macro0
9 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
10 | ---
11 | output = _bolt_var1
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=27, lineno=2, colno=9)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_234__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_proc_macros = {}
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def _bolt_macro0(stream):
7 | pass
8 | _bolt_proc_macros['foo:bar:proc_macro_overload0'] = _bolt_macro0
9 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
10 | ---
11 | output = _bolt_var1
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=31, lineno=2, colno=9)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_236__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Proc macro "foo" contains non-literal match.
2 | # line 1, column 11
3 | # 1 | macro foo message=minecraft:message(stream):
4 | # : ^^^^^^^^^^^^^^^^^^^^^^^^^
5 | # 2 | pass
6 | macro foo message=minecraft:message(stream):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_237__0.txt:
--------------------------------------------------------------------------------
1 | raise
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=5, lineno=1, colno=6)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=5, lineno=1, colno=6)
10 | identifier: 'raise'
11 | arguments:
12 |
13 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_237__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | raise
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=5, lineno=1, colno=6)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_238__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = ValueError
6 | _bolt_var0 = _bolt_var0()
7 | raise _bolt_var0
8 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
9 | ---
10 | output = _bolt_var2
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=19, lineno=2, colno=1)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_239__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = ValueError
6 | _bolt_var0 = _bolt_var0()
7 | _bolt_var1 = None
8 | raise _bolt_var0 from _bolt_var1
9 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
10 | ---
11 | output = _bolt_var3
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=29, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_23__0.txt:
--------------------------------------------------------------------------------
1 | "\"\u2588this\nthat"
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=21, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=20, lineno=1, colno=21)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=20, lineno=1, colno=21)
15 | value: '"█this\nthat'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_23__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | '"█this\nthat'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=21, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_240__0.txt:
--------------------------------------------------------------------------------
1 | foo = {
2 | a: 1,
3 | #>ERROR Forbidden dynamic key in dict without quotes.
4 | # line 3, column 5
5 | # 2 | a: 1,
6 | # 3 | "b" + "c": 2
7 | # : ^^^^^^^^^
8 | # 4 | }
9 | "b" + "c": 2
10 | }
11 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_241__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = ''
6 | foo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=10, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_242__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "r" is not defined.
2 | # line 1, column 7
3 | # 1 | foo = r"\"
4 | # : ^
5 | foo = r"\"
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_243__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = '\\\\'
6 | foo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_244__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = '\\"'
6 | foo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_246__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class Foo:
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=20, lineno=3, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_247__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = object
6 | class Foo(_bolt_var0):
7 | pass
8 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
9 | ---
10 | output = _bolt_var2
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=28, lineno=3, colno=1)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_248__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7, 9], [1, 3, 5]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | class A:
6 | pass
7 | class B:
8 | pass
9 | _bolt_var0 = A
10 | _bolt_var1 = B
11 | class Foo(_bolt_var0, _bolt_var1):
12 | pass
13 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
14 | ---
15 | output = _bolt_var3
16 | ---
17 | _bolt_refs[0]
18 |
19 | location: SourceLocation(pos=0, lineno=1, colno=1)
20 | end_location: SourceLocation(pos=62, lineno=7, colno=1)
21 | commands:
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_249__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class Foo:
6 | def bar(self):
7 | pass
8 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
9 | ---
10 | output = _bolt_var1
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=42, lineno=3, colno=13)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_24__0.txt:
--------------------------------------------------------------------------------
1 | ''
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=3, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=2, lineno=1, colno=3)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=2, lineno=1, colno=3)
15 | value: ''
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_24__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | ''
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=3, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_250__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | class Foo:
6 | pass
7 | _bolt_var0 = Foo
8 | _bolt_var0 = _bolt_var0()
9 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
10 | ---
11 | output = _bolt_var2
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=26, lineno=4, colno=1)
17 | commands:
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_252__0.txt:
--------------------------------------------------------------------------------
1 | class Foo:
2 | #>ERROR Identifier "Foo" is not defined.
3 | # line 2, column 5
4 | # 1 | class Foo:
5 | # 2 | Foo()
6 | # : ^^^
7 | # Notes:
8 | # - Expected assignment but got literal '()'.
9 | Foo()
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_253__0.txt:
--------------------------------------------------------------------------------
1 | class Foo:
2 | bar = 2
3 | #>ERROR Identifier "bar" is not defined.
4 | # line 3, column 7
5 | # 2 | bar = 2
6 | # 3 | print(bar)
7 | # : ^^^
8 | # Notes:
9 | # - Expected equal but got brace ')'.
10 | print(bar)
11 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_254__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 6, 8], [1, 2, 1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = print
6 | class Foo:
7 | pass
8 | Foo = _bolt_var0(Foo)
9 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
10 | ---
11 | output = _bolt_var2
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=27, lineno=4, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_256__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Decorators can only be applied to functions or classes.
2 | # line 1, column 1
3 | # 1 | @print
4 | # : ^^^^^^
5 | # 2 | foo = "bar"
6 | @print
7 | foo = "bar"
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_257__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Can't apply decorator to nothing.
2 | # line 1, column 1
3 | # 1 | @print
4 | # : ^^^^^^
5 | @print
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_258__0.txt:
--------------------------------------------------------------------------------
1 | if True:
2 | #>ERROR Can't apply decorator to nothing.
3 | # line 2, column 5
4 | # 1 | if True:
5 | # 2 | @print
6 | # : ^^^^^^
7 | # 3 | class A:
8 | # 4 | pass
9 | @print
10 | class A:
11 | pass
12 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_25__0.txt:
--------------------------------------------------------------------------------
1 | '"\'"'
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=7, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=6, lineno=1, colno=7)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=6, lineno=1, colno=7)
15 | value: '"\'"'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_25__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | '"\'"'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=7, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_260__0.txt:
--------------------------------------------------------------------------------
1 | class Foo:
2 | #>ERROR Statement "return" is not allowed in this context.
3 | # line 2, column 5
4 | # 1 | class Foo:
5 | # 2 | return
6 | # : ^^^^^^
7 | return
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_261__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | class Foo:
3 | #>ERROR Statement "return" is not allowed in this context.
4 | # line 3, column 9
5 | # 2 | class Foo:
6 | # 3 | return
7 | # : ^^^^^^
8 | return
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_262__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 8], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class Foo:
6 | _bolt_var0 = 1
7 | _bolt_var1 = 2
8 | _bolt_var0 = _bolt_var0 + _bolt_var1
9 | bar = _bolt_var0
10 | del _bolt_var0
11 | del _bolt_var1
12 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
13 | ---
14 | output = _bolt_var1
15 | ---
16 | _bolt_refs[0]
17 |
18 | location: SourceLocation(pos=0, lineno=1, colno=1)
19 | end_location: SourceLocation(pos=27, lineno=3, colno=1)
20 | commands:
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_266__0.txt:
--------------------------------------------------------------------------------
1 | if 0:
2 | #>ERROR Import statement can only appear directly at scope level.
3 | # line 2, column 5
4 | # 1 | if 0:
5 | # 2 | import math
6 | # : ^^^^^^^^^^^
7 | import math
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_267__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | if 0:
3 | #>ERROR Import statement can only appear directly at scope level.
4 | # line 3, column 9
5 | # 2 | if 0:
6 | # 3 | import this
7 | # : ^^^^^^^^^^^
8 | import this
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_268__0.txt:
--------------------------------------------------------------------------------
1 | for i in range(10):
2 | if i % 2 == 0:
3 | #>ERROR Import statement can only appear directly at scope level.
4 | # line 3, column 9
5 | # 2 | if i % 2 == 0:
6 | # 3 | from math import sin
7 | # : ^^^^^^^^^^^^^^^^^^^^
8 | from math import sin
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_269__0.txt:
--------------------------------------------------------------------------------
1 | if "beans":
2 | #>ERROR Macro definition can only appear directly at scope level.
3 | # line 2, column 5
4 | # 1 | if "beans":
5 | # 2 | macro beans:
6 | # : ^^^^^^^^^^^
7 | # 3 | pass
8 | macro beans:
9 | pass
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_26__0.txt:
--------------------------------------------------------------------------------
1 | 'something \t\f\n\\\'here'
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=27, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=26, lineno=1, colno=27)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=26, lineno=1, colno=27)
15 | value: "something \t\x0c\n\\'here"
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_26__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | "something \t\x0c\n\\'here"
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=27, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_270__0.txt:
--------------------------------------------------------------------------------
1 | for bean in "beans":
2 | if bean:
3 | #>ERROR Macro definition can only appear directly at scope level.
4 | # line 3, column 9
5 | # 2 | if bean:
6 | # 3 | macro jelly bean(stream):
7 | # : ^^^^^^^^^^^
8 | # 4 | pass
9 | macro jelly bean(stream):
10 | pass
11 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_271__0.txt:
--------------------------------------------------------------------------------
1 | class A:
2 | #>ERROR Macro definition can only appear directly at scope level.
3 | # line 2, column 5
4 | # 1 | class A:
5 | # 2 | macro foo:
6 | # : ^^^^^^^^^
7 | # 3 | pass
8 | macro foo:
9 | pass
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_272__0.txt:
--------------------------------------------------------------------------------
1 | class B:
2 | #>ERROR Import statement can only appear directly at scope level.
3 | # line 2, column 5
4 | # 1 | class B:
5 | # 2 | import math
6 | # : ^^^^^^^^^^^
7 | import math
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_274__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_277__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected call expression on builtin "hex".
2 | # line 1, column 10
3 | # 1 | time set hex.time
4 | # : ^^^^^^^^
5 | time set hex.time
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_27__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Invalid escape sequence \".
2 | # line 1, column 5
3 | # 1 | 'abc\"'
4 | # : ^^
5 | 'abc\"'
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_280__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_283__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f():
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=17, lineno=2, colno=9)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_284__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f(a):
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=18, lineno=2, colno=9)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_285__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_missing = _bolt_runtime.helpers['missing']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def f(a=_bolt_helper_missing):
7 | if a is _bolt_helper_missing:
8 | _bolt_var0 = 1
9 | a = _bolt_var0
10 | pass
11 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
12 | ---
13 | output = _bolt_var1
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=20, lineno=2, colno=9)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_286__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_missing = _bolt_runtime.helpers['missing']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def f(a=_bolt_helper_missing):
7 | if a is _bolt_helper_missing:
8 | _bolt_var0 = 1
9 | a = _bolt_var0
10 | pass
11 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
12 | ---
13 | output = _bolt_var1
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=21, lineno=2, colno=9)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_287__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_missing = _bolt_runtime.helpers['missing']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var0:
6 | def f(a=_bolt_helper_missing, /):
7 | if a is _bolt_helper_missing:
8 | _bolt_var0 = 1
9 | a = _bolt_var0
10 | pass
11 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
12 | ---
13 | output = _bolt_var1
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=23, lineno=2, colno=9)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_288__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f(a, /, b):
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=24, lineno=2, colno=9)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_28__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Trailing input following final expression.
2 | # line 1, column 7
3 | # 1 | "hey" "hey"
4 | # : ^^^^^
5 | "hey" "hey"
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_291__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f(a, /, b, *, c):
6 | pass
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=30, lineno=2, colno=9)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_295__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Positional marker can not appear directly at the beginning of the argument list.
2 | # line 1, column 7
3 | # 1 | def g(/):
4 | # : ^
5 | # 2 | pass
6 | def g(/):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_296__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected at least one named argument after bare variadic marker.
2 | # line 1, column 7
3 | # 1 | def g(*):
4 | # : ^
5 | # 2 | pass
6 | def g(*):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_297__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Positional marker can not appear directly at the beginning of the argument list.
2 | # line 1, column 7
3 | # 1 | def g(/, *):
4 | # : ^
5 | # 2 | pass
6 | def g(/, *):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_298__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Positional marker can not appear after variadic arguments.
2 | # line 1, column 10
3 | # 1 | def g(*, /):
4 | # : ^
5 | # 2 | pass
6 | def g(*, /):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_299__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Positional marker can not appear directly at the beginning of the argument list.
2 | # line 1, column 7
3 | # 1 | def g(/, foo):
4 | # : ^
5 | # 2 | pass
6 | def g(/, foo):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_29__0.txt:
--------------------------------------------------------------------------------
1 | None
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=5, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=4, lineno=1, colno=5)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=4, lineno=1, colno=5)
15 | value: None
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_29__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = None
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=5, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_2__0.txt:
--------------------------------------------------------------------------------
1 | 123.456
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=8, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=7, lineno=1, colno=8)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=7, lineno=1, colno=8)
15 | value: 123.456
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_2__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 123.456
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=8, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_300__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected at least one named argument after bare variadic marker.
2 | # line 1, column 12
3 | # 1 | def g(foo, *):
4 | # : ^
5 | # 2 | pass
6 | def g(foo, *):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_301__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Variadic keyword arguments should not be followed by anything.
2 | # line 1, column 17
3 | # 1 | def g(**kwargs, foo):
4 | # : ^^^
5 | # 2 | pass
6 | def g(**kwargs, foo):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_302__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Positional marker already present in function signature.
2 | # line 1, column 20
3 | # 1 | def g(foo, /, bar, /):
4 | # : ^
5 | # 2 | pass
6 | def g(foo, /, bar, /):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_303__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Variadic arguments already specified.
2 | # line 1, column 24
3 | # 1 | def g(foo, *args, bar, *args):
4 | # : ^
5 | # 2 | pass
6 | def g(foo, *args, bar, *args):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_304__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Argument without default can not appear after arguments with default values.
2 | # line 1, column 12
3 | # 1 | def g(a=1, b):
4 | # : ^
5 | # 2 | pass
6 | def g(a=1, b):
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_305__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected literal 'advancement', literal 'align', literal 'anchored', literal 'append', literal 'as', literal 'at' or 175 other tokens but got literal 'foo'.
2 | # line 1, column 11
3 | # 1 | as @a run foo = "bar"
4 | # : ^^^
5 | # 2 | say foo
6 | as @a run foo = "bar"
7 | say foo
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_306__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected assignment, colon or identifier but got newline '\n'.
2 | # line 1, column 5
3 | # 1 | memo
4 | memo
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_307__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected non-empty block.
2 | # line 1, column 5
3 | # 1 | memo:
4 | # : ^
5 | memo:
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_308__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected assignment, colon or identifier but got literal '123'.
2 | # line 1, column 6
3 | # 1 | memo 123:
4 | # : ^^^
5 | # 2 | pass
6 | memo 123:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_309__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 6
3 | # 1 | memo foo:
4 | # : ^^^
5 | # 2 | pass
6 | # Notes:
7 | # - Expected bracket '[', curly '{', docstring, ellipsis, false, identifier or 5 other tokens but got newline '\n'.
8 | memo foo:
9 | pass
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_30__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 1
3 | # 1 | foo
4 | # : ^^^
5 | # Notes:
6 | # - Expected assignment but got newline '\n'.
7 | foo
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_310__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 10
3 | # 1 | memo foo=foo:
4 | # : ^^^
5 | # 2 | pass
6 | memo foo=foo:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_311__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected assignment, colon or identifier but got literal '{}'.
2 | # line 1, column 6
3 | # 1 | memo {}:
4 | # : ^^
5 | # 2 | pass
6 | memo {}:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_312__0.txt:
--------------------------------------------------------------------------------
1 | memo something=123:
2 | #>ERROR Identifier "somethig" is not defined. Did you mean "something"?
3 | # line 2, column 11
4 | # 1 | memo something=123:
5 | # 2 | print(somethig)
6 | # : ^^^^^^^^
7 | # Notes:
8 | # - Expected equal but got brace ')'.
9 | print(somethig)
10 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_31__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "foo" is not defined.
2 | # line 1, column 11
3 | # 1 | "hello" + foo
4 | # : ^^^
5 | "hello" + foo
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_320__0.txt:
--------------------------------------------------------------------------------
1 | """hello"""
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=11, lineno=1, colno=12)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=11, lineno=1, colno=12)
15 | value: 'hello'
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_320__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | 'hello'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=12, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_321__0.txt:
--------------------------------------------------------------------------------
1 | """hello
2 | world"""
3 | ---
4 |
5 | location: SourceLocation(pos=0, lineno=1, colno=1)
6 | end_location: SourceLocation(pos=18, lineno=3, colno=1)
7 | commands:
8 |
9 | location: SourceLocation(pos=0, lineno=1, colno=1)
10 | end_location: SourceLocation(pos=17, lineno=2, colno=9)
11 | identifier: 'mecha:sentinel'
12 | arguments:
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=17, lineno=2, colno=9)
16 | value: 'hello\nworld'
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_321__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | 'hello\nworld'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=18, lineno=3, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_322__0.txt:
--------------------------------------------------------------------------------
1 | """
2 | This is a docstring.
3 |
4 | Hello world
5 | """
6 | ---
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=42, lineno=6, colno=1)
10 | commands:
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=41, lineno=5, colno=4)
14 | identifier: 'mecha:sentinel'
15 | arguments:
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=41, lineno=5, colno=4)
19 | value: '\nThis is a docstring.\n\nHello world\n'
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_322__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | '\nThis is a docstring.\n\nHello world\n'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=42, lineno=6, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_323__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = print
6 | _bolt_var1 = '\n This is a docstring.\n\n Hello world\n '
7 | _bolt_var0 = _bolt_var0(_bolt_var1)
8 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
9 | ---
10 | output = _bolt_var3
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=67, lineno=8, colno=1)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_324__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = '\n This is a docstring.\n\n Hello world\n'
6 | foo = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=56, lineno=6, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_325__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Trailing input following final expression.
2 | # line 1, column 3
3 | # 1 | """
4 | # : ^
5 | """
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_326__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Trailing input following final expression.
2 | # line 1, column 9
3 | # 1 | foo = """
4 | # : ^
5 | # 2 | This is a docstring.
6 | foo = """
7 | This is a docstring.
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_327__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | def f():
6 | 'My function'
7 | _bolt_var0 = 42
8 | return _bolt_var0
9 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
10 | ---
11 | output = _bolt_var1
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=44, lineno=3, colno=14)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_329__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class A:
6 | "This is a class.\n\n It doesn't do anything.\n "
7 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
8 | ---
9 | output = _bolt_var1
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=70, lineno=6, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_32__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 1
6 | foo = _bolt_var0
7 | _bolt_var1 = foo
8 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
9 | ---
10 | output = _bolt_var3
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=12, lineno=3, colno=1)
16 | commands:
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_330__0.txt:
--------------------------------------------------------------------------------
1 | """
2 | foo\n\nbar
3 | """
4 | ---
5 |
6 | location: SourceLocation(pos=0, lineno=1, colno=1)
7 | end_location: SourceLocation(pos=19, lineno=4, colno=1)
8 | commands:
9 |
10 | location: SourceLocation(pos=0, lineno=1, colno=1)
11 | end_location: SourceLocation(pos=18, lineno=3, colno=4)
12 | identifier: 'mecha:sentinel'
13 | arguments:
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=18, lineno=3, colno=4)
17 | value: '\nfoo\n\nbar\n'
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_330__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | '\nfoo\n\nbar\n'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=19, lineno=4, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_331__0.txt:
--------------------------------------------------------------------------------
1 | r"""
2 | foo\n\nbar
3 | """
4 | ---
5 |
6 | location: SourceLocation(pos=0, lineno=1, colno=1)
7 | end_location: SourceLocation(pos=20, lineno=4, colno=1)
8 | commands:
9 |
10 | location: SourceLocation(pos=0, lineno=1, colno=1)
11 | end_location: SourceLocation(pos=19, lineno=3, colno=4)
12 | identifier: 'mecha:sentinel'
13 | arguments:
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=19, lineno=3, colno=4)
17 | value: '\nfoo\\n\\nbar\n'
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_331__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | '\nfoo\\n\\nbar\n'
6 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
7 | ---
8 | output = _bolt_var1
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=20, lineno=4, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_332__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = ...
6 | a = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=8, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_333__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = int
6 | def f() -> _bolt_var0:
7 | pass
8 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
9 | ---
10 | output = _bolt_var2
11 | ---
12 | _bolt_refs[0]
13 |
14 | location: SourceLocation(pos=0, lineno=1, colno=1)
15 | end_location: SourceLocation(pos=24, lineno=2, colno=9)
16 | commands:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_335__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "f" is not defined.
2 | # line 1, column 38
3 | # 1 | def f(a: int, b: int = f(a - 1), *c: f) -> int:
4 | # : ^
5 | # 2 | return a + b
6 | def f(a: int, b: int = f(a - 1), *c: f) -> int:
7 | return a + b
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_336__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = int
6 | foo: _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=9, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_337__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 123
6 | foo = _bolt_var0
7 | _bolt_var1 = int
8 | foo: _bolt_var1
9 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
10 | ---
11 | output = _bolt_var3
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=15, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_338__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 8], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = int
6 | foo: _bolt_var0
7 | _bolt_var1 = 123
8 | foo = _bolt_var1
9 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
10 | ---
11 | output = _bolt_var3
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=19, lineno=3, colno=1)
17 | commands:
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_339__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Identifier "doesnotexist" is not defined.
2 | # line 1, column 6
3 | # 1 | foo: doesnotexist = 123
4 | # : ^^^^^^^^^^^^
5 | foo: doesnotexist = 123
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_33__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 8], [1, 2]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = 1
6 | foo = _bolt_var0
7 | _bolt_var1 = 'hello'
8 | _bolt_var2 = foo
9 | _bolt_var1 = _bolt_var1 + _bolt_var2
10 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
11 | ---
12 | output = _bolt_var4
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=22, lineno=3, colno=1)
18 | commands:
19 |
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_340__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 6, 9], [1, 2, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class A:
6 | _bolt_var0 = int
7 | foo: _bolt_var0
8 | _bolt_var1 = 'hello'
9 | bar = _bolt_var1
10 | _bolt_var2 = str
11 | bar: _bolt_var2
12 | del _bolt_var0
13 | del _bolt_var1
14 | del _bolt_var2
15 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
16 | ---
17 | output = _bolt_var1
18 | ---
19 | _bolt_refs[0]
20 |
21 | location: SourceLocation(pos=0, lineno=1, colno=1)
22 | end_location: SourceLocation(pos=45, lineno=4, colno=1)
23 | commands:
24 |
25 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_342__0.txt:
--------------------------------------------------------------------------------
1 | uwu = 0
2 | def f():
3 | global uwu
4 | memo:
5 | #>ERROR Binding to global variable "uwu" is not allowed in this context.
6 | # line 5, column 9
7 | # 4 | memo:
8 | # 5 | uwu = 9
9 | # : ^^^
10 | uwu = 9
11 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_347__0.txt:
--------------------------------------------------------------------------------
1 | for i in range(10):
2 | def f():
3 | #>ERROR Can only use "break" in loops.
4 | # line 3, column 9
5 | # 2 | def f():
6 | # 3 | break
7 | # : ^^^^^
8 | break
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_348__0.txt:
--------------------------------------------------------------------------------
1 | for i in range(10):
2 | memo:
3 | #>ERROR Can only use "break" in loops.
4 | # line 3, column 9
5 | # 2 | memo:
6 | # 3 | break
7 | # : ^^^^^
8 | break
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_349__0.txt:
--------------------------------------------------------------------------------
1 | def f():
2 | memo:
3 | #>ERROR Statement "return" is not allowed in this context.
4 | # line 3, column 9
5 | # 2 | memo:
6 | # 3 | return 9999
7 | # : ^^^^^^^^^^^
8 | return 9999
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_350__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Unexpected macro argument after subcommand.
2 | # line 1, column 30
3 | # 1 | macro hello thing=subcommand after:
4 | # : ^^^^^
5 | # 2 | pass
6 | macro hello thing=subcommand after:
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_351__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Interpolation disabled.
2 | # line 1, column 42
3 | # 1 | macro hello thing=subcommand{"redirect": ]
4 | # : ^
5 | # 2 | pass
6 | macro hello thing=subcommand{"redirect": ]
7 | pass
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_352__0.txt:
--------------------------------------------------------------------------------
1 | macro hello thing=subcommand:
2 | pass
3 | #>ERROR Expected assignment, literal 'advancement', literal 'align', literal 'anchored', literal 'append', literal 'as' or 177 other tokens but got literal 'print(123)'.
4 | # line 3, column 7
5 | # 2 | pass
6 | # 3 | hello print(123)
7 | # : ^^^^^^^^^^
8 | hello print(123)
9 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_353__0.txt:
--------------------------------------------------------------------------------
1 | macro hello thing=subcommand:
2 | pass
3 | #>ERROR Can't use if as a subcommand.
4 | # line 3, column 7
5 | # 2 | pass
6 | # 3 | hello if True:
7 | # : ^^^^^^^^
8 | # 4 | pass
9 | # : ^^^^
10 | hello if True:
11 | pass
12 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_357__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 9], [1, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 1
6 | x = _bolt_var0
7 | del x
8 | _bolt_var1 = 2
9 | x = _bolt_var1
10 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
11 | ---
12 | output = _bolt_var3
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=18, lineno=4, colno=1)
18 | commands:
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_358__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected literal 'advancement', literal 'align', literal 'anchored', literal 'append', literal 'as', literal 'at' or 175 other tokens but got literal '"not'.
2 | # line 1, column 13
3 | # 1 | execute run "not docstring"
4 | # : ^^^^
5 | execute run "not docstring"
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_359__0.txt:
--------------------------------------------------------------------------------
1 | ~/
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=3, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=2, lineno=1, colno=3)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=2, lineno=1, colno=3)
15 | fmt: ''
16 | values:
17 |
18 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_359__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_resolve_formatted_location = _bolt_runtime.helpers['resolve_formatted_location']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var1:
6 | _bolt_var0 = _bolt_helper_resolve_formatted_location(_bolt_runtime, '')
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=3, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_360__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_resolve_formatted_location = _bolt_runtime.helpers['resolve_formatted_location']
3 | _bolt_helper_children = _bolt_runtime.helpers['children']
4 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
5 | with _bolt_runtime.scope() as _bolt_var2:
6 | _bolt_var0 = print
7 | _bolt_var1 = _bolt_helper_resolve_formatted_location(_bolt_runtime, 'foo')
8 | _bolt_var0 = _bolt_var0(_bolt_var1)
9 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
10 | ---
11 | output = _bolt_var3
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=13, lineno=2, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_361__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Trailing input following final expression.
2 | # line 1, column 4
3 | # 1 | ~/ ~/
4 | # : ^^
5 | ~/ ~/
6 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_362__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_364__0.txt:
--------------------------------------------------------------------------------
1 | x = ./foo
2 | #>ERROR Expected bracket '[', curly '{', false, identifier, null, number, string or true but reached end of file.
3 | # line 2, column 14
4 | # 1 | x = ./foo
5 | # 2 | predicate x[]
6 | predicate x[]
7 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_366__1.txt:
--------------------------------------------------------------------------------
1 | # Nothing
2 | ---
3 | output = None
4 | ---
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_367__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = True
6 | _bolt_var1 = 1
7 | _bolt_var2 = 2
8 | _bolt_var1 = _bolt_var1 + _bolt_var2
9 | class A(foo=_bolt_var0, bar=_bolt_var1):
10 | pass
11 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
12 | ---
13 | output = _bolt_var4
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=39, lineno=3, colno=1)
19 | commands:
20 |
21 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_368__0.txt:
--------------------------------------------------------------------------------
1 | class A:
2 | pass
3 | #>ERROR Base class not allowed after keyword argument "foo".
4 | # line 3, column 19
5 | # 2 | pass
6 | # 3 | class B(foo=True, A):
7 | # : ^
8 | # 4 | pass
9 | class B(foo=True, A):
10 | pass
11 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_369__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7], [1, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | class A:
6 | pass
7 | _bolt_var0 = A
8 | _bolt_var1 = True
9 | class B(_bolt_var0, foo=_bolt_var1):
10 | pass
11 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
12 | ---
13 | output = _bolt_var3
14 | ---
15 | _bolt_refs[0]
16 |
17 | location: SourceLocation(pos=0, lineno=1, colno=1)
18 | end_location: SourceLocation(pos=49, lineno=5, colno=1)
19 | commands:
20 |
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_36__0.txt:
--------------------------------------------------------------------------------
1 | if True:
2 | say hello
3 | elif True or False:
4 | say hello
5 | #>ERROR Expected colon but got literal '"blah"'.
6 | # line 5, column 6
7 | # 4 | say hello
8 | # 5 | else "blah":
9 | # : ^^^^^^
10 | # 6 | say hello
11 | else "blah":
12 | say hello
13 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_371__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 'demo:foo'
6 | text = _bolt_var0
7 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
8 | ---
9 | output = _bolt_var2
10 | ---
11 | _bolt_refs[0]
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=18, lineno=2, colno=1)
15 | commands:
16 |
17 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_372__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 6, 8], [1, 2, 3]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var0:
5 | class A:
6 | _bolt_var0 = str
7 | text: _bolt_var0
8 | _bolt_var1 = str
9 | data: _bolt_var1
10 | del _bolt_var0
11 | del _bolt_var1
12 | _bolt_var1 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var0))
13 | ---
14 | output = _bolt_var1
15 | ---
16 | _bolt_refs[0]
17 |
18 | location: SourceLocation(pos=0, lineno=1, colno=1)
19 | end_location: SourceLocation(pos=37, lineno=4, colno=1)
20 | commands:
21 |
22 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_37__0.txt:
--------------------------------------------------------------------------------
1 | if True:
2 | say hello
3 | a = 1
4 | #>ERROR Conditional branch must be part of an if statement.
5 | # line 4, column 1
6 | # 2 | say hello
7 | # 3 | a = 1
8 | # 4 | else:
9 | # : ^^^^^
10 | # 5 | say hello
11 | else:
12 | say hello
13 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_38__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected bracket '[', curly '{', docstring, ellipsis, false, identifier or 16 other tokens but reached end of file.
2 | # line 1, column 3
3 | # 1 | if
4 | if
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_39__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected bracket '[', curly '{', docstring, ellipsis, false, identifier or 5 other tokens but got newline '\n'.
2 | # line 1, column 12
3 | # 1 | if True and
4 | if True and
5 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_3__0.txt:
--------------------------------------------------------------------------------
1 | 22220099.6667e-3
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=17, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=16, lineno=1, colno=17)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |
13 | location: SourceLocation(pos=0, lineno=1, colno=1)
14 | end_location: SourceLocation(pos=16, lineno=1, colno=17)
15 | value: 22220.0996667
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_3__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var1:
5 | _bolt_var0 = 22220.0996667
6 | _bolt_var2 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var1))
7 | ---
8 | output = _bolt_var2
9 | ---
10 | _bolt_refs[0]
11 |
12 | location: SourceLocation(pos=0, lineno=1, colno=1)
13 | end_location: SourceLocation(pos=17, lineno=2, colno=1)
14 | commands:
15 |
16 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_40__0.txt:
--------------------------------------------------------------------------------
1 | #>ERROR Expected non-empty block.
2 | # line 1, column 8
3 | # 1 | if True:
4 | # : ^
5 | # 2 | say hello
6 | if True:
7 | say hello
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_47__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1, 7, 8], [1, 2, 1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var2:
5 | _bolt_var0 = 'abc'
6 | _bolt_var1 = 'def'
7 | _bolt_var0 = _bolt_var0 + _bolt_var1
8 | foo = _bolt_var0
9 | _bolt_var3 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var2))
10 | ---
11 | output = _bolt_var3
12 | ---
13 | _bolt_refs[0]
14 |
15 | location: SourceLocation(pos=0, lineno=1, colno=1)
16 | end_location: SourceLocation(pos=32, lineno=5, colno=1)
17 | commands:
18 |
19 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_48__0.txt:
--------------------------------------------------------------------------------
1 | 1 * 2
2 | #>ERROR Expected bracket '[', curly '{', decorator, docstring, ellipsis, false or 188 other tokens but got literal '*'.
3 | # line 2, column 1
4 | # 1 | 1 * 2
5 | # 2 | * 3
6 | # : ^
7 | * 3
8 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_49__1.txt:
--------------------------------------------------------------------------------
1 | _bolt_lineno = [1], [1]
2 | _bolt_helper_children = _bolt_runtime.helpers['children']
3 | _bolt_helper_replace = _bolt_runtime.helpers['replace']
4 | with _bolt_runtime.scope() as _bolt_var3:
5 | _bolt_var0 = True
6 | _bolt_var1 = False
7 | _bolt_var0 = _bolt_var0 | _bolt_var1
8 | _bolt_var2 = None
9 | _bolt_var0 = _bolt_var0 | _bolt_var2
10 | _bolt_var4 = _bolt_helper_replace(_bolt_refs[0], commands=_bolt_helper_children(_bolt_var3))
11 | ---
12 | output = _bolt_var4
13 | ---
14 | _bolt_refs[0]
15 |
16 | location: SourceLocation(pos=0, lineno=1, colno=1)
17 | end_location: SourceLocation(pos=20, lineno=2, colno=1)
18 | commands:
19 |
20 |
--------------------------------------------------------------------------------
/tests/snapshots/bolt__parse_4__0.txt:
--------------------------------------------------------------------------------
1 | 0.67e6
2 | ---
3 |
4 | location: SourceLocation(pos=0, lineno=1, colno=1)
5 | end_location: SourceLocation(pos=7, lineno=2, colno=1)
6 | commands:
7 |
8 | location: SourceLocation(pos=0, lineno=1, colno=1)
9 | end_location: SourceLocation(pos=6, lineno=1, colno=7)
10 | identifier: 'mecha:sentinel'
11 | arguments:
12 |