Commit 456458c
authored
* 1
* wip
* Update README.RU.md
* update v version
* update version command
* Update README.RU.md
* Update CHANGELOG.md
* Fix None literal in object variable | update v version
* Update V setup action to v1.4 in workflows
Changed the V setup GitHub Action from vlang/setup-v@v1 to vlang/setup-v@v1.4 in both CI and manual release workflows for improved compatibility and stability.
* add sexlab sources
* small rename file iequip_test -> proj_iequip_test
* add test project sexlab
* Move iEquip scripts to iEquipSources directory
Renamed all iEquip related script and README files from modules/tests/iEquip to modules/tests/iEquipSources for improved organization and clarity.
* Add MantellaSpellSources scripts and assets
Introduces the MantellaSpellSources module with Papyrus scripts for conversation, actions, constants, equipment description, dialogue handling, and related functionality. Includes MIT license and README for documentation.
* Add OStim Papyrus source scripts and license
Added OStimSources directory containing Papyrus scripts and supporting files for OStim, including OAiScript.psc, OBarsScript.psc, and others. Also included the GNU GPL v3 license and a README for documentation.
* Add PapyrusUtil source scripts for testing
Added PapyrusUtil, JsonUtil, MiscUtil, ObjectUtil, StorageUtil, and ActorUtil Papyrus scripts, along with a README referencing the source. These files provide utility functions for Skyrim mod development and are intended for use in the test modules.
* Add ModEvent and NetImmerse script dependencies
Introduces ModEvent.psc and NetImmerse.psc to the psc_deps test module. These scripts provide extended mod event handling and node manipulation functions for testing and integration purposes.
* Rename and update iEquip test file
Renamed proj_iequip_test.v to project_iequip_test.v and updated the test function and input directory to reflect new naming and source location.
* Rename and update SexLab test function
Renamed test file and function from 'proj_sexlab_test' to 'project_sexlab_test' for improved clarity and consistency.
* Add Mantella spell project test
Introduces a test for compiling the Mantella spell project, verifying input and header directories, and ensuring output directory creation. Uses builder.compile with specific preferences for compilation.
* Add test for OStim project compilation
Introduces a new test in project_ostim_test.v to verify compilation of OStim sources with required dependencies and output directory setup.
* Add UIExtensionsSources scripts for testing
Added multiple Papyrus script files and a README to modules/tests/UIExtensionsSources, sourced from https://www.nexusmods.com/skyrim/mods/57046. These scripts provide various UI extension menu implementations for Skyrim mod testing.
* Add RaceMenu Papyrus source scripts for testing
Added RaceMenu Papyrus scripts and README to modules/tests/RaceMenuSources for testing purposes. These files are sourced from https://www.nexusmods.com/skyrim/mods/29624.
* Add Papyrus script stubs for SKSE dependencies
Added new Papyrus script files for Potion, SKSE, Scene, SoundDescriptor, TopicInfo, Weather, and WorldSpace to support SKSE-dependent features in tests. Also added GetEquippedArmorInSlot to Actor.psc for armor slot queries.
* Add NiOverride and ArmorAddon Papyrus scripts
Introduces NiOverride.psc and ArmorAddon.psc to the NiOverrideSources test module. These scripts provide native Papyrus interfaces for manipulating armor, weapon, skin, and node overrides, as well as body morphs and dye functions for Skyrim modding.
* Add MCM Helper source scripts for testing
Introduces MCM Helper Papyrus scripts and related files under modules/tests/MCMHelperSources for test purposes. Includes LICENSE, README, and all core scripts from the MCM Helper project.
* Add MasterOfDisguise source scripts and docs
Added LICENSE, README, and Papyrus source scripts for MasterOfDisguise from https://github.com/fireundubh/MasterOfDisguiseSSE to modules/tests/MasterOfDisguiseSources for testing and reference.
* Add LibTurtleClub source files and license
Added LICENSE, LibTurtleClub.psc script, and README.md to modules/tests/LibTurtleClubSources. These files provide the LibTurtleClub Papyrus script and documentation, licensed under MIT.
* Add LibFireSources test module
Introduces the LibFireSources test module with LICENSE, Papyrus script (LibFire.psc), and README. These files provide utility functions and documentation for testing, sourced from https://github.com/fireundubh/LibFire.
* Add LibMathf.psc with math utility functions
Introduces LibMathf.psc script containing various global native math functions such as Abs, Clamp, Lerp, Pow, and trigonometric operations. These utilities provide common mathematical operations for use in other scripts.
* Add JContainers Papyrus API source files
Added initial Papyrus script sources for JContainers API, including JArray, JAtomic, JContainers, JDB, JFormDB, JFormMap, JIntMap, JLua, JMap, JString, and JValue. These files provide native function definitions and documentation for container, atomic, database, map, string, and value management in Skyrim mod scripting.
* Remove iEquipSources test scripts
Deleted LibTurtleClub.psc, SKI_ConfigBase.psc, SKI_ConfigManager.psc, and SKI_QuestBase.psc from modules/tests/iEquipSources. These files are no longer needed for the test suite.
* Add ConsoleUtil sources for testing
Added ConsoleUtil.psc script, license, and README to modules/tests/ConsoleUtilSources. These files are sourced from https://github.com/darkconsole/ConsoleUtilSSE and will be used for testing purposes.
* Consolidate project test files into projects_test.v
Removed individual test files for iEquip, MantellaSpell, OStim, and SexLab, and merged their test logic into a single projects_test.v file. This centralizes all project test cases for easier maintenance and extensibility.
* Add debug print for compile command execution
Prints the command being executed in compile_original for easier debugging and visibility into the build process.
* wip
* wip
* wip
* Add OSA Papyrus source scripts for testing
Added multiple Papyrus script files and a README under modules/tests/OSASources, sourced from the OSA Skyrim SE project. These scripts provide utility functions and core framework logic for OSA, including actor utilities, console interaction, codepage conversion, and scene management.
* Remove unused SexLab and iEquip test sources
Deleted SexLabSources and iEquipSources Papyrus script files from the test modules, as well as their references. Added a new test for the OSA project and updated the OStim test to include the OSA sources. This streamlines the test suite and removes dependencies on unused scripts.
* Add OStimNG Papyrus source scripts for testing
Introduces the OStimNGSources directory containing Papyrus source scripts and a GPLv3 license for testing purposes. These scripts provide utility functions and APIs for actor management, animation selection, and scene handling in the OStimNG framework.
* Refactor SkyUI SDK sources by version and add v5.2
Removed old SkyuiSDKSources directories and README files, and reorganized source scripts into versioned folders: SkyuiSDKSources_v5.1 and SkyuiSDKSources_v5.2. Added new scripts and README for v5.2, including SKI_ConfigBase.psc, SKI_QuestBase.psc, SKI_WidgetBase.psc, and SKI_WidgetManager.psc. This improves clarity and maintainability by separating SDK sources by version.
* Add Camera.psc and update Game.psc for camera functions
Introduces a new Camera.psc script providing camera state and FOV functions. Updates Game.psc to use Camera.psc for camera-related functions, adds light mod and plugin functions, and comments out the deprecated GetNthModDependency.
* Update test projects for multiple SkyUI SDK versions
Split SkyUI SDK tests into v5.1 and v5.2, updating test_project_skyui_sdk and related test cases to use version-specific source directories. Added new dependencies (LibMathfSources, LibFireSources, NiOverrideSources, UIExtensionsSources) to relevant tests and adjusted header_dirs accordingly. Refactored OStim test to use OStimNGSources and updated dependency checks and comments for clarity.
* Remove debug output from ast_test.v
Deleted unnecessary eprintln(errs) statements from test_error_state_fn_with_default_arg and test_error_msg functions to clean up test output.
* Print header dirs only outside test builds
Wrapped the println statement for header directories with a compile-time check to prevent output during test builds.
* Update V compiler version and improve temp var handling
Bump V compiler version to weekly.2025.48 in CI, release workflow, and documentation. Refactor gen_call in gen_expr.v to defer freeing temporary variables until after use, improving memory management.
* Refactor test project setup with helper functions
Introduces get_source_dir and get_output_dir helper functions to reduce code duplication and improve readability in test project setup. All test functions now use these helpers for directory and file validation, making the code more maintainable.
* Improve test output handling and directory management
Replaced os.real_path with os.abs_path and switched to os.mkdir_all for more robust directory creation in test helpers. Set output_mode to .silent in all test project configurations to suppress unnecessary output. Updated builder to use b.print for header dir logging and improved timer output formatting.
* Set output_mode to silent in test preferences
Updated test preference configurations in multiple test files to set output_mode to .silent, ensuring test output is suppressed for cleaner test runs.
* Refactor test project setup with get_prefs helper
Introduced a get_prefs helper function to reduce duplication in test project setup. All test functions now use get_prefs to construct pref.Preferences, improving readability and maintainability.
* Refactor test project source path usage
Introduced constants for source file paths to reduce repetition and improve readability in test functions. All test functions now use these constants instead of repeated get_source_dir calls.
* Replace println with b.print and improve error output
Updated modules/builder/original.v to use b.print instead of println for consistent logging. Enhanced error reporting in modules/builder/pex.v by printing errors and backtrace in test mode. Minor error message formatting changes in compiler.v for clarity.
* Update output directory names in test functions
Changed output directory arguments in test_project_skyrim_deps_sources, test_project_skyui_sdk_51, and test_project_skyui_sdk_52 to use more specific names, improving clarity and consistency in test output locations.
* Improve type validation and error handling in checker
Added checks for undefined types in function return types and return statements. Updated compile-time casting for literals in properties and default parameters. Enhanced error messages in tests and added missing script dependency for tests. Commented out placeholder asserts in autocast logic for better stability.
* Add README for Original Compiler directory
Introduces a README.md file to document the purpose of the 'Original Compiler' directory, clarifying that it contains the original Papyrus compiler files from the Creation Kit.
* Fix indentation in ast_test.v preferences constant
Corrected the indentation of the prefs constant initialization for improved code readability and consistency.
* Prefix output dir with __project_test_ in get_output_dir
Updated get_output_dir to prefix the compiled directory name with '__project_test_' to avoid potential naming conflicts or improve clarity in test output directories.
* Update CHANGELOG
Added details about fixes for default parameter checks, new tests with third-party script compilation, and clarified previous entries.
* Validate script name matches file and uniqueness
Add checks in script_decl to ensure a .psc file's script name matches the file base name (case-insensitive) and to error if a script with the same name is already defined. Uses os.base/all_before_last for filename extraction and reports errors with node.name_pos.
* Add AGENTS.md system prompt
Add AGENTS.md: a comprehensive system prompt and contributor guide for the Papyrus Compiler project. Documents project layout, compilation pipeline, key data structures, V language conventions, build/run/test commands, testing and mandatory rules, module dependency graph, implementation details, and common how-to tasks — intended to guide contributors and AI assistants working on the compiler.
* Improve cast assertion message
Enhance the assertion in modules/papyrus/checker/checker.v to include a descriptive error message when a cast is invalid. The message prints the source and target type names via get_type_name to make debugging invalid cast attempts easier.
* add RequiemSources
* add CampfireSources
* Add try_cast_to_type and use safe casts
Introduce Checker.try_cast_to_type to validate casts (using can_cast/can_autocast) and report a clear error instead of unconditionally performing casts. Replace direct cast_to_type calls in infix expression checking with try_cast_to_type so casts are only applied on success. Also translate a couple of comments to English and add a test (none + 1) that expects a cast error from None to Int.
* Update CHANGELOG with new features and fixes
Document new features and fixes: add `version` command; allow string literals as default values for typed properties and parameters (auto-cast to declared type). Add compiler validations and error reporting for missing scripts (extends/variable types), duplicate script names across source folders, mismatched Scriptname vs filename, and type-compatibility of default parameters. Fix handling of `None` as default values and crashes when `None` appears in expressions; validate calls with default parameters inside State blocks. Cleanup and reorganize changelog entries.
* Add changelog rules for user-visible changes
Add guideline #8 to AGENTS.md requiring updates to the CHANGELOG.md 'Next Release' section for any user-visible behavior, feature, or bugfix. Entries must be written in English, aimed at compiler users (what they will observe), and must not mention internal implementation details, module/function names, or CI/build-only changes. Includes examples of good and bad changelog entries.
* Prevent placeholder type crashes; support comments
Add guards in the type checker to treat placeholder/undefined types as non-castable and emit undefined-type errors instead of crashing. Update try_cast_to_type to report undefined types for both source and target. Add Parser.skip_comments and call it in expr, fn arg parsing and call argument handling so comments inside parenthesized expressions and argument lists are accepted. Update tests and CHANGELOG to reflect the fixes and parser behavior improvements.
* move papyrus sources to separate repo
Add .gitmodules to configure repository submodules and remove a large number of files under modules/tests (CampfireSources, ConsoleUtilSources, FNISSources, JContainersSources, etc.). These deletions move bulky test/source modules out of the main repo and into submodules (or external management) to reduce repository size and centralize versioning of those component modules.
* Update checkout action to v4; enable submodules
Bump actions/checkout to v4 and add `with: submodules: recursive` in CI and manual-release workflows to ensure repository submodules are checked out. Changes applied to .github/workflows/ci.yml and .github/workflows/manual-release.yml.
* Update header_dir path and translate comments
Point header_dir to the relocated psc_deps under modules/tests/sources and clean up the inline comments in the test. The Russian comments were translated to English and simplified (clarifying that some types may be placeholders but aren't required), ensuring the test uses the new directory layout and has clearer documentation.
* Update test source path for selective headers
Adjust test_selective_headers_loading to use the relocated PSC source file under modules/tests/sources/psc/TestSelectiveLoading.psc (was modules/tests/psc/TestSelectiveLoading.psc). This aligns the test with the repository restructure of PSC sources so the test loads the correct file path.
* Fix path to PSC test file in selective headers test
Update test src_file to point to modules/tests/psc/TestSelectiveLoading.psc instead of the incorrect modules/tests/sources/psc/... path. This corrects the file location used by the test so the PSC source is found during test runs.
* Remove Campfire project and update Requiem deps
Delete the unused Campfire source reference and remove the commented-out Campfire test. Update the Requiem test prefs to include the USSEP and SkyUI SDK 5.1 dependencies so Requiem builds with those integrations.
* Handle alternate test source/header paths
Make tests resilient to differing repo layouts by adding fallback path checks. In projects_test.v, get_source_dir now checks the new modules/tests/sources/<dir> layout, special-cases psc_deps, and falls back to modules/tests/<dir> before failing. In selective_headers_loading_test.v, header_dir resolution tries modules/tests/sources/psc_deps first then modules/tests/psc_deps, validating that Form.psc exists. These changes improve backward compatibility with submodule or layout changes.
* update test sources submodule
* header image to READMEs
Move the Discord invite badge to the top of both README.md and README.RU.md, add a project header image (docs/image.png), and remove the duplicate badge placement. This improves visibility and adds a visual header for the project.
* Enable debug (-g) in V build step
Add the -g flag to the V compiler invocation in .github/workflows/manual-release.yml so the built binary includes debug information. This updates the Build Project step only; output path (bin/papyrus) and other flags remain unchanged.
* Add v0.0.4 changelog and improve errors
Insert a ## V 0.0.4 section into CHANGELOG.md and update release notes. Documented improvements to error handling: clearer and more consistent error messages (e.g., 'undefined identifier') and structured internal compiler error diagnostics that include version info, a stack trace, and reporting instructions. Also cleaned up placeholder ellipses in the file.
* Add -g flag to build command in READMEs
Update README.md and README.RU.md to include the -g flag in the v compiler invocation (v -o "bin\papyrus.exe" -prod -g -gc none compiler.v). This ensures debug information is generated during compilation.
1 parent dcae26e commit 456458c
123 files changed
Lines changed: 2197 additions & 10731 deletions
File tree
- .github/workflows
- bin/Original Compiler
- docs
- modules
- builder
- gen/gen_pex
- papyrus
- ast
- checker
- parser
- scanner
- util
- pex
- pref
- tests
- iEquip
- psc_deps
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
| 49 | + | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | | - | |
| 54 | + | |
53 | 55 | | |
54 | 56 | | |
55 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
4 | 36 | | |
5 | 37 | | |
6 | 38 | | |
| |||
0 commit comments