GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tools: fix config serialization w/ long strings · nodejs/node@23dd2b0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • tools
    • js2c.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎tools/js2c.py‎

Copy file name to clipboardExpand all lines: tools/js2c.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,11 @@ def handle_config_gypi(config_filename):
163163
def jsonify(config):
164164
# 1. string comments
165165
config = re.sub(r'#.*?\n', '', config)
166+
# 2. join multiline strings
167+
config = re.sub(r"'$\s+'", '', config, flags=re.M)
166168
# 3. normalize string literals from ' into "
167169
config = re.sub('\'', '"', config)
168-
# 2. turn pseudo-booleans strings into Booleans
170+
# 4. turn pseudo-booleans strings into Booleans
169171
config = re.sub('"true"', 'true', config)
170172
config = re.sub('"false"', 'false', config)
171173
return config

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.