lad: case-insensitivity
Build and populate cache / tests (sydpkgs, nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/heads/nixpkgs-unstable.tar.gz, sydpkgs) (push) Has been cancelled

This commit is contained in:
2026-06-21 19:06:11 -06:00
parent a787aeb2a9
commit 6450642be3
2 changed files with 28 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
diff --git a/5.1/assembler.lua b/5.1/assembler.lua
index fb89b18df2..e5f0b2753b 100644
--- a/5.1/assembler.lua
+++ b/5.1/assembler.lua
@@ -100,7 +100,7 @@
label <- <name> ":"
string <- '"' ('\\' / '\"' / !'"' .)* '"'
instruction <- ( <s> ( {<label>} / <number>)? <s> <ln>? <s> {<op>} ( <s> {<param>} )+ <s> ( %nl )+ ) -> {}
- op <- [A-Z]+
+ op <- [A-Za-z]+
param <- <register> / <number> / <name> / <string>
register <- ( "R[" <number> "]" )
s <- ( !%nl %s )*
@@ -310,10 +310,10 @@
local b = 3
local c = 4
if check_label(table[1]) == nil then
- op = table[1]
+ op = string.upper (table[1])
else
set_label(table[1], parsed, n)
- op = table[2]
+ op = string.upper (table[2])
a = 3
b = 4
c = 5
+2
View File
@@ -6,6 +6,7 @@
, lib
, wantLad5_1 ? true
, wantLad5_2 ? true
, wantCaseInsensitivity ? false
}:
let
@@ -29,6 +30,7 @@ in stdenv.mkDerivation {
};
LUA51 = lib.getExe our-lua51;
LUA52 = lib.getExe our-lua52;
patches = lib.optional wantCaseInsensitivity ./case-insensitivity.patch;
installPhase = ''
mkdir -p $out/bin $out/opt/{5.1,5.2}
cp 5.1/*.lua $out/opt/5.1/