weixin_39974557
weixin_39974557
2021-01-11 07:04

Implement ECMA262 RegExp builtin object and RegExp engine

Related ECMA2626 section: http://www.ecma-international.org/ecma-262/5.1/#sec-15.10.3 - [x] Regexp Builtin components - [x] Register the RegExp built-in object. - [x] RegExp(..) - [x] RegExp(pattern) - [x] RegExp(pattern, flag) - [x] RegExp(RegExp) - [x] new RegExp(..) - [x] RegExp(pattern) - [x] RegExp(pattern, flag) - [x] RegExp(RegExp) - [x] RegExp.prototype - [x] RegExp.prototype.constructor - [x] RegExp.prototype.exec(..) - [x] RegExp.prototype.test(..) - [x] RegExp.prototype.toString(..) - [x] RegExp.source - [x] RegExp.global - [x] RegExp.ignoreCase - [x] RegExp.multiline - [x] RegExp.lastIndex - [x] Implement RegExp bytecode storage - Requirements - [x] Resize automatically when it is needed - [x] Append and insert uint32 and uint8 - [x] Read uint32 and uint8 - [x] Advance in bytecode while reading - [x] Dump container (for debug) - [x] Compile RegExp bytecode - Compile RegExp pattern to an internal bytecode to be able to run it efficiently. - [x] Disjunction - [x] Alternative - [x] Assertion - [x] Atom - [x] PatternCharacter - [x] . - [x] \ AtomEscape (depends on #49) - [x] CharacterClass - [x] Quantifier - [x] Execute RegExp - Read the compiled bytecode and try to match. - [x] Disjunction - [x] Alternative - [x] Assertion - [x] Atom - [x] PatternCharacter - [x] . - [x] \ AtomEscape - [x] CharacterClass - [x] Quantifier - [x] Handle flags (depends on #49) - [x] Global - [x] IgnoreCase - [x] Multiline - [x] Set lastIndex property - [x] Set properties of the returned array object - [x] Parse RegularExpressionLiterals and create a RegExp object.

该提问来源于开源项目:jerryscript-project/jerryscript

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

8条回答

  • weixin_39974557 weixin_39974557 4月前

    CC:

    点赞 评论 复制链接分享
  • weixin_39974557 weixin_39974557 4月前

    Hi , -ayrapetyan, ,

    if you have some time, please take a look at the current stage of the RegExp engine implementation. It is currently working on simple character matching, but it is still in a really early stage. We want to sure that it will fit into your concept before we do too much new code. It is easier to refactor the code now, if it is needed.

    https://github.com/Samsung/jerryscript/tree/regexp_dev

    点赞 评论 复制链接分享
  • weixin_39723899 weixin_39723899 4月前

    let's review the branch

    点赞 评论 复制链接分享
  • weixin_39723899 weixin_39723899 4月前

    I just checked the code briefly, it seems to be OK. Do you need any support from parser?

    double-check me, please.

    点赞 评论 复制链接分享
  • weixin_39974557 weixin_39974557 4月前

    Not sure yet. We couldn't deal with the RegExpLiterals. We can catch it in the lexer, but don't know how to create an operand like in StringLiteral parsing. The dumpers of parser are a bit unclear for us. Thanks for the review.

    点赞 评论 复制链接分享
  • weixin_39974557 weixin_39974557 4月前

    Pull request with core features: https://github.com/Samsung/jerryscript/pull/169

    点赞 评论 复制链接分享
  • weixin_39974557 weixin_39974557 4月前

    , , the progress is blocked by the unicode support (#49) from now. Please review the pull request, because we need RegExp for String builtins.

    点赞 评论 复制链接分享
  • weixin_39739404 weixin_39739404 4月前

    Everything is implemented, so we can close this bug.

    点赞 评论 复制链接分享

相关推荐