24 lines
674 B
Lua
24 lines
674 B
Lua
local editor = NewFile()
|
|
|
|
for _, tst in ipairs({
|
|
"_ = .1 + 1. + 1.1 + 0xa",
|
|
"_ = 1e1 + 0xa.ap1",
|
|
"_ = 0xabcULL + 0x1LL + 1LL + 1ULL",
|
|
"_ = .1e1i + 0x1.1p1i + 0xa.ap1i",
|
|
}) do
|
|
ok(AnalyzeString(tst) ~= nil,
|
|
("Numeric expression '%s' can be checked with static analysis."):format(tst))
|
|
|
|
editor:SetText(tst)
|
|
editor:ResetTokenList()
|
|
while IndicateAll(editor) do end
|
|
local defonly = true
|
|
for _, token in ipairs(GetEditor():GetTokenList()) do
|
|
if token.name ~= '_' then defonly = false end
|
|
end
|
|
ok(defonly == true, ("Numeric expression '%s' can be checked with inline parser."):format(tst))
|
|
end
|
|
|
|
ide:GetDocument(editor).isModified = false
|
|
ClosePage()
|