Another shot at getting the smoketest to run

This commit is contained in:
ajeffrey@roblox.com 2022-02-08 10:41:52 -06:00
parent dbf35b4176
commit ffd7b55fef
3 changed files with 4 additions and 6 deletions

View file

@ -42,7 +42,7 @@ jobs:
run: cmake --build . --target Luau.Ast.CLI
- name: run smoketest
working-directory: prototyping
run: ./lua-ast Examples/SmokeTest.lua | ./PrettyPrinter > Examples/SmokeTestOutput.lua
run: ../luau-ast Examples/SmokeTest.lua | ./PrettyPrinter > Examples/SmokeTestOutput.lua
- name: diff smoketest
working-directory: prototyping
run: diff Examples/SmokeTest.lua SmokeTestOutput.lua

View file

@ -3,12 +3,10 @@ local function id(x)
end
local function comp(f)
return function(g)
return function (x)
return function(x)
return f(g(x))
end
end
end
local id2 = id(id)
local nil2 = id2(nil)

View file

@ -15,12 +15,12 @@ exprToString lb (var x) =
exprToString lb (M $ N) =
(exprToString lb M) ++ "(" ++ (exprToString lb N) ++ ")"
exprToString lb (function⟨ x B end) =
"function (" ++ x ++ ")" ++ lb ++
"function(" ++ x ++ ")" ++ lb ++
" " ++ (blockToString (lb ++ " ") B) ++ lb ++
"end"
statToString lb (function f x B end) =
"function " ++ f ++ "(" ++ x ++ ")" ++ lb ++
"local function " ++ f ++ "(" ++ x ++ ")" ++ lb ++
" " ++ (blockToString (lb ++ " ") B) ++ lb ++
"end"
statToString lb (local x M) =