📄 verbatim.lua
字号:
-- tolua: verbatim class-- Written by Waldemar Celes-- TeCGraf/PUC-Rio-- Jul 1998-- $Id: verbatim.lua,v 1.3 2000/01/24 20:41:16 celes Exp $-- This code is free software; you can redistribute it and/or modify it.-- The software provided hereunder is on an "as is" basis, and-- the author has no obligation to provide maintenance, support, updates,-- enhancements, or modifications. -- Verbatim class-- Represents a line translated directed to the binding file.-- The following filds are stored:-- line = line textclassVerbatim = { line = '', cond = nil, -- condition: where to generate the code (s=suport, r=register)}classVerbatim.__index = classVerbatimsetmetatable(classVerbatim,classFeature)-- preamble verbatimfunction classVerbatim:preamble () if self.cond == '' then write(self.line) endend-- support codefunction classVerbatim:supcode () if strfind(self.cond,'s') then write(self.line) write('\n') endend-- register codefunction classVerbatim:register () if strfind(self.cond,'r') then write(self.line) endend -- Print methodfunction classVerbatim:print (ident,close) print(ident.."Verbatim{") print(ident.." line = '"..self.line.."',") print(ident.."}"..close)end-- Internal constructorfunction _Verbatim (t) setmetatable(t,classVerbatim) append(t) return tend-- Constructor-- Expects a string representing the text linefunction Verbatim (l,cond) if strsub(l,1,1) == '$' then cond = 'sr' -- generates in both suport and register fragments l = strsub(l,2) end return _Verbatim { line = l, cond = cond or '', }end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -