michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

RegEx Flag “s” is not supported #103

Closed Jaid closed 9 months ago

Jaid commented 2 years ago

Describe the issue When an inline RegEx is defined, using an s in the flags section breaks all the following code until the end of the file.

Screenshot of Current Behavior Without flag: Without flag With flag: With flag Sample Code to Reproduce

import adbkit from "@devicefarmer/adbkit"
import {matches} from "super-regex"

export default class Device extends adbkit.DeviceClient {

  async getGpsAll() {
    const regex = /(?<provider>[a-z]+) provider.+?last location=Location.+?(?<lat>[\d.]+).+?(?<lon>[\d.]+).+?alt=(?<alt>[\d.]+)/gs
    const execution = await this.shell("dumpsys location")
    const responseBuffer = await adbkit.default.util.readAll(execution)
    const response = responseBuffer.toString("utf8")
    return matches(regex, response).map(match => match.namedGroups)
  }

  async getGps() {
    const gps = await this.getGpsAll()
    return gps[0]
  }

}
Jaid commented 2 years ago

TypeScript parser for comparison TypeScript parser for comparison

presentday-presenttime commented 9 months ago

The 'd' flag has the same issue..

michaelgmcd commented 9 months ago

This should be fixed in 0.0.40