Commit 9c5dfd1d

9c5dfd1d89ffMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 4 files · +2 added · ~2 modified

Description

Merge pull request #268 from ryanseys/rs-node-source-encoding

feat(parse,codegen): support SourceEncodingNode (ENCODING)

Details

Commit
9c5dfd1d89ff
Parent
0b8eff64d95f
Merge parent
946de69fcef7

spinel_codegen.rbmodifiedView file

@@ -1713,6 +1713,9 @@
17131713 if t == "SourceFileNode"
17141714 return "string"
17151715 end
1716+ if t == "SourceEncodingNode"
1717+ return "string"
1718+ end
17161719 if t == "SymbolNode"
17171720 return "symbol"
17181721 end
@@ -17442,6 +17445,11 @@
1744217445 # path; documented limitation in test/source_file.rb.)
1744317446 return c_string_literal(@nd_content[nid])
1744417447 end
17448+ if t == "SourceEncodingNode"
17449+ # __ENCODING__ — Spinel has no Encoding runtime; we return
17450+ # the canonical "UTF-8" string. Documented in test/source_encoding.rb.
17451+ return c_string_literal("UTF-8")
17452+ end
1744517453 if t == "ArgumentsNode"
1744617454 arg_ids = parse_id_list(@nd_args[nid])
1744717455 if arg_ids.length > 0