summary refs log tree commit diff stats
path: root/lib/impure/nre
Commit message (Expand)AuthorAgeFilesLines
* complete std prefixes for stdlib (#22887)ringabout2023-10-301-1/+1
* fixes #13654Andreas Rumpf2020-03-161-1/+1
* Rework nil/option for nre in light of ""==nilFlaviu Tamas2018-12-111-16/+4
* Revert 7f49364fd0 for nreFlaviu Tamas2018-12-111-1/+5
* make more tests greenAndreas Rumpf2018-08-131-5/+1
* Remove expr/stmt (#5857)Arne Döring2017-07-251-1/+1
* Use stdlib's PCRE in nreFlaviu Tamas2015-06-071-442/+0
* Ensure no one uses internal moduleFlaviu Tamas2015-06-071-0/+1
* Disable static building of PCREFlaviu Tamas2015-05-2627-44880/+10
* Rearrange nre filesFlaviu Tamas2015-05-2646-1234/+1
* Merge remote 'nre' into add-nreFlaviu Tamas2015-05-2647-0/+46616
Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  cmd: "nim check --hints:off $file"
"""

# issue #17848

block:
  # generate with:
  # var a = ""
  # for i in 0..<80: a.add "k" & $i & ", "
  # echo a
  type
    TMsgKind = enum
      k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k70, k71, k72, k73, k74, k75, k76, k77, k78, k79
  type
    TNoteKind = range[k10..k79]
    Conf = ref object
      notes: set[TNoteKind]
  proc bad(conf: Conf, noteSet: set[TMsgKind]) =
    conf.notes = noteSet #[tt.Error
                 ^ type mismatch: got <set[TMsgKind]> but expected 'set[TNoteKind]']#
  var conf = Conf()
  bad(conf, {k10..k60})

block:
  type
    TMsgKind = enum k0, k1, k2, k3
    TNoteKind = range[k1..k2]
    TNoteKinds = set[TNoteKind]
  type Conf = ref object
    notes: TNoteKinds
  proc fn(conf: Conf, b: set[TMsgKind]) =
    conf.notes = b #[tt.Error
                 ^ type mismatch: got <set[TMsgKind]> but expected 'TNoteKinds = set[TNoteKind]']#
  var conf = Conf()
  conf.fn({k0..k3}) # BUG: this should give error
  echo conf.notes # {k1, k2}

block:
  #[
  compiler/bitsets.nim(43, 9) `elem >= 0`  [AssertionDefect]
  ]#
  type
    TMsgKind = enum k0, k1, k2, k3
    TNoteKind = range[k1..k2]
  var notes: set[TNoteKind]
  notes = {k0} #[tt.Error
          ^ type mismatch: got <set[TMsgKind]> but expected 'set[TNoteKind]']#
  notes = {k0..k3} #[tt.Error
          ^ type mismatch: got <set[TMsgKind]> but expected 'set[TNoteKind]']#