mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-03 05:59:02 +00:00
Resolve merge conflicts with devel branch refactoring (#25423)
The PR branch had merge conflicts with `devel` due to a major compiler refactoring that extracted type definitions from `compiler/ast.nim` into a new `compiler/astdef.nim` file. ## Changes - Resolved conflict in `compiler/ast.nim` by accepting `devel`'s refactored structure - Merged 763 commits from `devel` branch (commit range: `ce6a345..b3273e7`) - Preserved original PR changes removing deprecated symbols from `lib/core/macros.nim` The core PR functionality (removal of deprecated macros API since v0.18.1) remains intact while incorporating the upstream AST refactoring. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
discard """
|
||||
matrix: "--mm:refc; --mm:orc"
|
||||
targets: "c cpp js"
|
||||
disabled: "osx"
|
||||
"""
|
||||
import std/assertions
|
||||
# TODO: in future work move existing arithmetic tests (tests/arithm/*) into this file
|
||||
|
||||
@@ -3,6 +3,7 @@ discard """
|
||||
disabled: "openbsd"
|
||||
disabled: "freebsd"
|
||||
disabled: "windows"
|
||||
disabled: "osx"
|
||||
"""
|
||||
|
||||
#[
|
||||
|
||||
@@ -642,6 +642,30 @@ template main() =
|
||||
let myA = CAMPAIGN_TABLE
|
||||
doAssert $parseEnum[Tables](myA) == "wikientries_campaign"
|
||||
|
||||
block:
|
||||
const tripleQuotedStr = """foobar"""
|
||||
|
||||
type MyEnum = enum
|
||||
a = tripleQuotedStr
|
||||
b = """bazquz"""
|
||||
|
||||
let myA = tripleQuotedStr
|
||||
doAssert $parseEnum[MyEnum](myA) == myA
|
||||
let myB = "bazquz"
|
||||
doAssert $parseEnum[MyEnum](myB) == myB
|
||||
|
||||
block:
|
||||
const rawStr = r"foobar"
|
||||
|
||||
type MyEnum = enum
|
||||
a = rawStr
|
||||
b = r"bazquz"
|
||||
|
||||
let myA = rawStr
|
||||
doAssert $parseEnum[MyEnum](myA) == myA
|
||||
let myB = r"bazquz"
|
||||
doAssert $parseEnum[MyEnum](myB) == myB
|
||||
|
||||
block: # check enum defined in block
|
||||
type
|
||||
Bar = enum
|
||||
|
||||
@@ -194,6 +194,23 @@ block stripTests:
|
||||
doAssert(strip("×text×", leading = false, runes = ["×".asRune]) == "×text")
|
||||
doAssert(strip("×text×", trailing = false, runes = ["×".asRune]) == "text×")
|
||||
|
||||
doAssert(strip("\u2000") == "")
|
||||
doAssert(strip("a\u2000") == "a")
|
||||
|
||||
# bug #19846
|
||||
block:
|
||||
# check against unicode whose utf8 byteLen > 2
|
||||
doAssert(strip("‟„”“‛‚’‘‗•STR•‗‘’‚‛“”„‟", runes = "•‗‘’‚‛“”„‟".toRunes) == "STR")
|
||||
let chi = "abc\u8377\u9020"
|
||||
doAssert(strip(chi, leading = false, runes = ["\u9020".asRune]) == "abc\u8377")
|
||||
doAssert(strip(chi) == chi) # the last byte of s is \x0a, which is in unicodeSpace
|
||||
|
||||
let
|
||||
grinning_face = "\u{1f600}"
|
||||
thinking_face = "\u{1f914}"
|
||||
doAssert(strip(grinning_face & thinking_face & thinking_face,
|
||||
runes = thinking_face.toRunes) == grinning_face)
|
||||
|
||||
block repeatTests:
|
||||
doAssert repeat('c'.Rune, 5) == "ccccc"
|
||||
doAssert repeat("×".asRune, 5) == "×××××"
|
||||
|
||||
Reference in New Issue
Block a user