发表于 2014年11月21日
做Flash很少用正则表达式,所以一直都不会写。。这几天恶补了一下,由于之前研究过ActionScript与TypeScript的区别,作为练习写了个ActionScript转TypeScript的小程序,純html5的。
https://github.nshen.net/as2ts/
https://github.com/nshen/as2ts
Boolean
to boolean
uint
/ int
/ Number
to number
String
to string
:*
to :any
package
to module
import
statements ?public class
to export class
public function class_name(...):void
to constructor(...)
internal
to public
static (public|private|protected)
to (public|private|protected) static
(private|public|protected) var
to (private|public|protected)
(private|public|protected) const
to (private|public|protected)
(override) (private|public|protected) function
to (private|public|protected)
(private|public|protected) static var
to (private|public|protected) static
(private|public|protected) static const
to (private|public|protected) static
(private|public|protected) static function
to (private|public|protected) static
const
to var
A as B
to <B> A
:Array
to :any[]
:Vector.<type> =
to type[] =
:Vector.<type>;
to type[];
: Vector.<type> {
to type[] {
new Vector.<type>(7,true)
to []
new <type>[1,2,3]
to [1,2,3]
Vector.<type>([1, 2, 3])
to [1, 2, 3]
trace
to console.log
as2ts v0.1 : 2014-11-21 最初版本,实现基本功能
本文采用 署名-禁止演绎 4.0 国际许可协议 (CC BY-ND 4.0) 进行许可(保留链接可任意转载,禁止修改)。留言系统需要代理访问