ZyX_I avatar ZyX_I committed 12ed559

@frawor/fwc/constructor: Removed s:F.getexpr()

Comments (0)

Files changed (1)

plugin/frawor/fwc/constructor.vim

                 \"\n",     '''."\\n".''',   'g'),
                 \"\r",     '''."\\r".''',   'g')
 endfunction
-"▶1 getexpr
-function s:F.getexpr(expr, l)
-    if !empty(a:l)
-        return call('printf', [a:expr]+map(copy(a:l), 's:F.string(v:val)'))
-    endif
-    return ''.a:expr
-endfunction
-"▶1 getstr
-function s:F.getstr(s)
-    return a:s
-endfunction
 "▶1 _add       :: item, ... + self → self + self
 function s:constructor._add(...)
     let self.l+=a:000
     call add(a:toextend, [a:indent, 'endif'])
 endfunction
 "▶2 if         :: &self(expr)
-function s:constructor.if(expr, ...)
-    return self._out()._deeper('if', s:F.getexpr(a:expr, a:000))._deeper()
+function s:constructor.if(expr)
+    return self._out()._deeper('if', a:expr)._deeper()
 endfunction
 "▶2 elseif     :: &self(expr)
-function s:constructor.elseif(expr, ...)
-    return self._toblock('if')._add('elseif', s:F.getexpr(a:expr, a:000))._deeper()
+function s:constructor.elseif(expr)
+    return self._toblock('if')._add('elseif', a:expr)._deeper()
 endfunction
 "▶2 else       :: &self
 function s:constructor.else()
     call add(a:toextend, [a:indent, 'endwhile'])
 endfunction
 "▶2 while      :: &self(expr)
-function s:constructor.while(expr, ...)
-    return self._out()._deeper('while', s:F.getexpr(a:expr, a:000))._deeper()
+function s:constructor.while(expr)
+    return self._out()._deeper('while', a:expr)._deeper()
 endfunction
 "▶2 comp.for
 function s:comp.for(r, toextend, indent, item)
     call add(a:toextend, [a:indent, 'endfor'])
 endfunction
 "▶2 for        :: &self(vars, expr)
-function s:constructor.for(vars, expr, ...)
-    return self._out()._deeper('for', a:vars, s:F.getexpr(a:expr, a:000))._deeper()
+function s:constructor.for(vars, expr)
+    return self._out()._deeper('for', a:vars, a:expr)._deeper()
 endfunction
 "▶1 execute: call, throw, return
 "▶2 comp.execute
 endfunction
 "▶2 return, call, execute, echo, echomsg, echon
 for s:type in ['return', 'call', 'execute', 'echo', 'echomsg', 'echon']
-    execute      "function s:constructor.".s:type."(expr, ...)\n".
+    execute      "function s:constructor.".s:type."(expr)\n".
                 \"    return self._out()".
-                \                "._deeper('execute', ".
-                \                        "'".s:type."', ".
-                \                        "s:F.getexpr(a:expr, a:000))".
+                \                "._deeper('execute', '".s:type."', a:expr)".
                 \                "._up()\n".
                 \"endfunction"
 endfor
 unlet s:type
 "▶2 throw      :: &self(expr)
-function s:constructor.throw(expr, ...)
-    return self._out()._deeper('execute', 'throw', s:F.getexpr(a:expr, a:000))
+function s:constructor.throw(expr)
+    return self._out()._deeper('execute', 'throw', a:expr)
                 \._up()._up()
 endfunction
 "▶1 let: let, strappend, increment, decrement
 endfunction
 "▶2 let, strappend
 for [s:type, s:s] in [['let', ''], ['strappend', '.']]
-    execute      "function s:constructor.".s:type."(var, expr, ...)\n".
+    execute      "function s:constructor.".s:type."(var, expr)\n".
                 \"    return self._out()".
-                \                "._deeper('let', a:var, '".s:s."', ".
-                \                        "s:F.getexpr(a:expr, a:000))".
+                \                "._deeper('let', a:var, '".s:s."', a:expr)".
                 \                "._up()\n".
                 \"endfunction"
 endfor
     let incval=get(a:000, 0, 1)
     call self._out()
     if type(incval)==type(0) && incval<0
-        call self._deeper('let', a:var, '-', ''.(-incval))
+        call self._deeper('let', a:var, '-', -incval)
     else
-        call self._deeper('let', a:var, '+',  s:F.getexpr(incval, a:000[1:]))
+        call self._deeper('let', a:var, '+',  incval)
     endif
     return self._up()
 endfunction
     let incval=get(a:000, 0, 1)
     call self._out()
     if type(incval)==type(0) && incval<0
-        call self._deeper('let', a:var, '+', ''.(-incval))
+        call self._deeper('let', a:var, '+', -incval)
     else
-        call self._deeper('let', a:var, '-',  s:F.getexpr(incval, a:000[1:]))
+        call self._deeper('let', a:var, '-',  incval)
     endif
     return self._up()
 endfunction
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.