summary refs log tree commit diff stats
path: root/compiler/semgnrc.nim
Commit message (Expand)AuthorAgeFilesLines
* make `genericsOpenSym` work at instantiation time, new behavior in `openSym` ...metagn2024-09-181-6/+6
* fix undeclared identifier in templates in generics (#24069)metagn2024-09-061-1/+2
* opensym for templates + move behavior of opensymchoice to itself (#24007)metagn2024-08-281-10/+10
* generate symchoice for ambiguous types in templates & generics + handle types...metagn2024-08-251-15/+26
* sem all call nodes in generic type bodies + many required fixes (#23983)metagn2024-08-201-0/+24
* opensym as node kind + fixed experimental switch (#23892)metagn2024-08-121-8/+23
* don't treat template/macro/module as overloaded for opensym (#23939)metagn2024-08-111-1/+1
* implement genericsOpenSym for symchoices (#23873)metagn2024-07-251-2/+2
* fixes addr/hiddenAddr in strictdefs (#23477)ringabout2024-04-101-1/+1
* add switch, warning, and `bind` support for new generic injection behavior (#...metagn2023-12-221-4/+7
* allow replacing captured syms in macro calls in generics (#23091)metagn2023-12-181-0/+13
* fixes yet another strictdefs bug (#23069)ringabout2023-12-151-6/+8
* case macro now can be used inside generic. Fixes #20435 (#22752)Juan M Gómez2023-09-301-1/+15
* implement semgnrc for tuple and object type nodes (#22709)metagn2023-09-161-2/+41
* block ambiguous type conversion dotcalls in generics (#22375)metagn2023-08-091-0/+11
* use strictdefs for compiler (#22365)ringabout2023-08-061-1/+2
* retain forced open undeclared ident information (#22019)metagn2023-06-071-1/+1
* when T is both a type symbol and a routine symbol in scope of a generic proc ...metagn2023-05-241-4/+6
* fix #14254 (#21837)metagn2023-05-201-2/+6
* make deprecated statement a no-op (#21836)metagn2023-05-121-2/+2
* consistent use of scForceOpen for generic dot field symbols (#21738)metagn2023-05-051-11/+11
* refactoring in preparation for better, simpler name mangling that wor… (#21...Andreas Rumpf2023-04-241-1/+1
* alias syntax fixes, improvements and tests (#21671)metagn2023-04-221-33/+14
* fixes #3770; templates with untyped parameters resolve private fields wrongly...ringabout2023-03-211-0/+22
* fixes #20572 (#20585)Andreas Rumpf2022-10-171-1/+1
* overloadable enums no longer experimental (#20298)metagn2022-09-051-5/+1
* Change `styleCheck` to ignore foreign packages (#19822)quantimnot2022-07-141-1/+1
* fixes #18769 (#18790)Andreas Rumpf2021-09-031-1/+7
* Fixed const tuples in inferred generics (#18598)Jason Beetham2021-07-271-17/+16
* refactoring: removed empty withBracketExpr template (#18152)Andreas Rumpf2021-06-021-4/+2
* fix #17941: UnusedImport works for var/let/const/type invoked inside a generi...Timothee Cour2021-05-081-0/+3
* potential fix for semgeneric formal params (#17494)Saem Ghani2021-03-241-2/+4
* IC: next steps (#16550)Andreas Rumpf2021-01-071-1/+1
* big steps torwards an efficient, simple IC implementation (#16543)Andreas Rumpf2021-01-021-1/+1
* refactorings to prepare the compiler for IC (#15935)Andreas Rumpf2020-12-171-5/+7
* explicit ID generation for easier IC (#15559)Andreas Rumpf2020-10-251-5/+5
* Fix #5691 (#15158)Clyybber2020-08-271-1/+1
* fix bug in semgnrc: runnableExamples should not semcheck, even with > 1 arg (...Timothee Cour2020-06-231-1/+1
* implement the 'bind' statement for generics, it was an oversight that this wa...Andreas Rumpf2020-06-071-4/+11
* fix #13524 astToStr now works inside generics (#13681)Timothee Cour2020-03-181-1/+1
* make case-object transitions explicit, make unknownLineInfo a const, replace ...Jasper Jenkins2020-01-171-1/+1
* Cosmetic compiler cleanup (#12718)Clyybber2019-11-281-117/+111
* Small ast.nim cleanup (#12156)Clyybber2019-09-091-21/+21
* refs #11947; FieldError fixed (#11950)Timothee Cour2019-08-151-1/+1
* styleCheck: make the compiler and large parts of the stdlib compatible with -...Araq2019-07-101-2/+2
* fixes #11188 (#11319)Andreas Rumpf2019-05-241-2/+2
* Replace countup(x, y) with x .. yClyybber2019-05-071-6/+6
* Replace countup(x, y-1) with x ..< yClyybber2019-05-071-15/+15
* more destructor based changes (#10885)Andreas Rumpf2019-03-231-1/+1
* Fixes #10727. (#10728)deech2019-02-251-1/+6
color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* 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 */
#!/bin/sh
# returns 0 on successful build or nothing to build
# non-zero exit status only on error during building
set -e  # stop immediately on error

# [0-9]*.cc -> subx.cc -> subx_bin
# (layers)   |          |
#          tangle      $CXX

# can also be called with a layer to only build until
#   $ ./build --until 050
UNTIL_LAYER=${2:-zzz}

# we use two mechanisms to speed up rebuilds:
# - older_than: run a command if the output is older than any of the inputs
# - update: if a command is quick to run, always run it but update the result only on any change
#
# avoid combining both mechanisms to generate a single file
# otherwise you'll see spurious messages about files being updated
# risk: a file may unnecessarily update without changes, causing unnecessary work downstream

test "$CXX" || export CXX=c++
test "$CC" || export CC=cc
test "$CFLAGS" || export CFLAGS="-g -O3 -std=c++98"  # CI has an ancient version; don't expect recent dialects
export CFLAGS="$CFLAGS -Wall -Wextra -fno-strict-aliasing"

# return 1 if $1 is older than _any_ of the remaining args
older_than() {
  local target=$1
  shift
  if [ ! -e $target ]
  then
#?     echo "$target doesn't exist"
    echo "updating $target" >&2
    return 0  # success
  fi
  local f
  for f in $*
  do
    if [ $f -nt $target ]
    then
      echo "updating $target" >&2
      return 0  # success
    fi
  done
  return 1  # failure
}

# redirect to $1, unless it's already identical
update() {
  if [ ! -e $1 ]
  then
    cat > $1
  else
    cat > $1.tmp
    diff -q $1 $1.tmp >/dev/null  &&  rm $1.tmp  ||  mv $1.tmp $1
  fi
}

update_cp() {
  if [ ! -e $2/$1 ]
  then
    cp $1 $2
  elif [ $1 -nt $2/$1 ]
  then
    cp $1 $2
  fi
}

noisy_cd() {
  cd $1
  echo "-- `pwd`" >&2
}

older_than tools/enumerate tools/enumerate.cc && {
  $CXX $CFLAGS tools/enumerate.cc -o tools/enumerate
}

older_than tools/tangle tools/tangle.cc && {
  noisy_cd tools
    grep -h "^[^ #].*) {" tangle.cc  |sed 's/ {.*/;/'  |update tangle.function_list
    grep -h "^[[:space:]]*void test_" tangle.cc  |sed 's/^\s*void \(.*\)() {$/\1,/'  |update tangle.test_list
    grep -h "^\s*void test_" tangle.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update tangle.test_name_list
    $CXX $CFLAGS tangle.cc -o tangle
    ./tangle test
  noisy_cd ..  # no effect; just to show us returning to the parent directory
}

LAYERS=$(tools/enumerate --until $UNTIL_LAYER  |grep '.cc$')
older_than subx.cc $LAYERS tools/enumerate tools/tangle && {
  # no update here; rely on 'update' calls downstream
  tools/tangle $LAYERS  > subx.cc
}

grep -h "^[^[:space:]#].*) {$" subx.cc  |grep -v ":.*("  |sed 's/ {.*/;/'  |update function_list
grep -h "^\s*void test_" subx.cc  |sed 's/^\s*void \(.*\)() {.*/\1,/'  |update test_list
grep -h "^\s*void test_" subx.cc  |sed 's/^\s*void \(.*\)() {.*/"\1",/'  |update test_name_list

older_than subx_bin subx.cc *_list && {
  $CXX $CFLAGS subx.cc -o subx_bin
}

exit 0