Sha256: e8e2a76e06d90c689852f4c1201a056fba72b8848912bb7c02fc1aa4b8bd040c

Contents?: true

Size: 497 Bytes

Versions: 3

Compression:

Stored size: 497 Bytes

Contents

use :node;

var Node = module.require('../Node').Node;

fn RegularExpressionLiteral(pattern, flags)
  extends Node {
  
  this.type = 'Literal';
  this.pattern = pattern;
  this.flags = flags;
}

RegularExpressionLiteral.prototype.codegen = () -> { 
  if !super.codegen() {
    return;
  }
  
  this.value = new ::RegExp(this.pattern, this.flags);
  return this; 
};

RegularExpressionLiteral.prototype.hasCallExpression = () -> false;

exports.RegularExpressionLiteral = RegularExpressionLiteral;

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spider-src-0.1.7 lib/spider-src/support/spider/src/ast/literals/RegularExpressionLiteral.spider
spider-src-0.1.6 lib/spider-src/support/spider/src/ast/literals/RegularExpressionLiteral.spider
spider-src-0.1.5 lib/spider-src/support/spider/src/ast/literals/RegularExpressionLiteral.spider