about summary refs log tree commit diff stats
path: root/config.mk
Commit message (Expand)AuthorAgeFilesLines
...
* introduced Layout structAnselm R. Garbe2007-02-191-2/+2
* added ban() which takes care than a banned window is not banned again... (thi...Anselm R. Garbe2007-02-141-1/+1
* next version is 3.5Anselm R. Garbe2007-02-081-1/+1
* removed debug flags 3.4Anselm R. Garbe2007-02-071-2/+2
* replaced getproto with a saner function, now old-school artifacts of WM times...Anselm R. Garbe2007-02-071-2/+2
* made some changes more concistentAnselm R. Garbe2007-02-051-1/+1
* got rid of LD (inspired by JGs patch to wmii)Anselm R. Garbe2007-02-051-1/+0
* renamed CAVEATS into BUGSAnselm R. Garbe2007-01-261-1/+1
* prepared yet another hotfix release 3.2.2Anselm R. Garbe2007-01-251-1/+1
* hotfix release 3.2.1 3.2.1Anselm R. Garbe2007-01-241-1/+1
* moved BORDERPX to config.*.hAnselm R. Garbe2007-01-171-1/+1
* changed incnmaster shortcuts in config.arg.hAnselm R. Garbe2007-01-121-1/+1
* implemented nmaster appearance in mode label (using %u)Anselm R. Garbe2007-01-081-1/+1
* prevent pop() if first sel == nexttiled(clients)Anselm R. Garbe2007-01-051-2/+2
* fixing some minor issuesAnselm R. Garbe2007-01-051-2/+2
* I prefer two master windows by defaultAnselm R. Garbe2007-01-051-2/+2
* experimental version which allows master clients being increased/decreasedAnselm R. Garbe2007-01-051-2/+2
* next version will contain updated copyright noticearg@mig292007-01-021-1/+1
* added Solaris hintsarg@mig292006-12-181-1/+6
* removed the hardcoded fixed fallback, it is useless in non-Latin1 environmentsarg@mig292006-12-081-1/+1
* enforcing using fontsets even if they are incomplete for some encodingsarg@mig292006-12-051-1/+1
* hotfix of a serious crashing bug 2.5.1arg@mig292006-12-041-1/+1
* next version will be 2.5arg@mig292006-11-301-1/+1
* next version will be 2.4arg@mig292006-11-251-1/+1
* applied Gottox patchesarg@mig292006-11-211-1/+1
* next release will be 2.2arg@mig292006-11-031-1/+1
* applied Gottox patch to simplify the resizing of col, instead of resizing the...arg@mig292006-10-311-1/+1
* now being at v2.0Anselm R. Garbe2006-10-141-1/+1
* changing MASTER value from percent into per millAnselm R. Garbe2006-10-051-1/+1
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-1/+1
* fixing the settags issue, preparing 1.7.1 1.7.1Anselm R. Garbe2006-09-271-1/+1
* improved intro comment in dwm.h, updated config.mkarg@mmvi2006-09-201-1/+1
* small fixAnselm R. Garbe2006-09-111-1/+1
* maybe this might workAnselm R. Garbe2006-09-061-1/+1
* prepared dwm-1.4 update 1.4Anselm R. Garbe2006-09-061-1/+1
* seems to preserve floating client z-layer order (even with reorder() calls)Anselm R. Garbe2006-09-061-1/+1
* after 1.3Anselm R. Garbe2006-09-041-1/+1
* retagged 1.3Anselm R. Garbe2006-09-041-1/+1
* removed html crapAnselm R. Garbe2006-09-041-1/+1
* applied sanders patch to remove unnecessary commit()Anselm R. Garbe2006-08-311-1/+1
* changed config.arg.h - I really need the 4th tagAnselm R. Garbe2006-08-281-1/+1
* 3->4 colorsAnselm R. Garbe2006-08-241-1/+1
* applied another config.mk patch made by sanderAnselm R.Garbe2006-08-161-1/+1
* fixing small bug in config.mkAnselm R.Garbe2006-08-151-2/+2
* applied Sanders LD and resize patchesAnselm R.Garbe2006-08-141-1/+2
* upgraded version infoAnselm R.Garbe2006-08-111-1/+1
* next version is 0.8arg@10ksloc.org2006-08-071-1/+1
* using -Os again, zoom is ignored in floating mode or on floating clientsarg@10ksloc.org2006-08-051-1/+1
* no need for -g anymore, regexp matching works nowarg@10ksloc.org2006-08-041-4/+4
* switched to regexp matching for Rulesarg@10ksloc.org2006-08-041-4/+4
s='alt'>
                                







                                                                                                     




                                                    

                                  
                                  
import ast, idents, lineinfos, modulegraphs, magicsys

proc genEnumToStrProc*(t: PType; info: TLineInfo; g: ModuleGraph): PSym =
  result = newSym(skProc, getIdent(g.cache, "$"), t.owner, info)

  let dest = newSym(skParam, getIdent(g.cache, "e"), result, info)
  dest.typ = t

  let res = newSym(skResult, getIdent(g.cache, "result"), result, info)
  res.typ = getSysType(g, info, tyString)

  result.typ = newType(tyProc, t.owner)
  result.typ.n = newNodeI(nkFormalParams, info)
  rawAddSon(result.typ, res.typ)
  result.typ.n.add newNodeI(nkEffectList, info)

  result.typ.addParam dest

  var body = newNodeI(nkStmtList, info)
  var caseStmt = newNodeI(nkCaseStmt, info)
  caseStmt.add(newSymNode dest)

  # copy the branches over, but replace the fields with the for loop body:
  for i in 0..<t.n.len:
    assert(t.n[i].kind == nkSym)
    var field = t.n[i].sym
    let val = if field.ast == nil: field.name.s else: field.ast.strVal
    caseStmt.add newTree(nkOfBranch, newSymNode(field),
      newTree(nkStmtList, newTree(nkFastAsgn, newSymNode(res), newStrNode(val, info))))
    #newIntTypeNode(nkIntLit, field.position, t)

  body.add(caseStmt)

  var n = newNodeI(nkProcDef, info, bodyPos+2)
  for i in 0..<n.len: n[i] = newNodeI(nkEmpty, info)
  n[namePos] = newSymNode(result)
  n[paramsPos] = result.typ.n
  n[bodyPos] = body
  n[resultPos] = newSymNode(res)
  result.ast = n
  incl result.flags, sfFromGeneric
  incl result.flags, sfNeverRaises

proc searchObjCaseImpl(obj: PNode; field: PSym): PNode =
  case obj.kind
  of nkSym:
    result = nil
  of nkElse, nkOfBranch:
    result = searchObjCaseImpl(obj.lastSon, field)
  else:
    if obj.kind == nkRecCase and obj[0].kind == nkSym and obj[0].sym == field:
      result = obj
    else:
      for x in obj:
        result = searchObjCaseImpl(x, field)
        if result != nil: break

proc searchObjCase(t: PType; field: PSym): PNode =
  result = searchObjCaseImpl(t.n, field)
  if result == nil and t.len > 0:
    result = searchObjCase(t[0].skipTypes({tyAlias, tyGenericInst, tyRef, tyPtr}), field)
  doAssert result != nil

proc genCaseObjDiscMapping*(t: PType; field: PSym; info: TLineInfo; g: ModuleGraph): PSym =
  result = newSym(skProc, getIdent(g.cache, "objDiscMapping"), t.owner, info)

  let dest = newSym(skParam, getIdent(g.cache, "e"), result, info)
  dest.typ = field.typ

  let res = newSym(skResult, getIdent(g.cache, "result"), result, info)
  res.typ = getSysType(g, info, tyUInt8)

  result.typ = newType(tyProc, t.owner)
  result.typ.n = newNodeI(nkFormalParams, info)
  rawAddSon(result.typ, res.typ)
  result.typ.n.add newNodeI(nkEffectList, info)

  result.typ.addParam dest

  var body = newNodeI(nkStmtList, info)
  var caseStmt = newNodeI(nkCaseStmt, info)
  caseStmt.add(newSymNode dest)

  let subObj = searchObjCase(t, field)
  for i in 1..<subObj.len:
    let ofBranch = subObj[i]
    var newBranch = newNodeI(ofBranch.kind, ofBranch.info)
    for j in 0..<ofBranch.len-1:
      newBranch.add ofBranch[j]

    newBranch.add newTree(nkStmtList, newTree(nkFastAsgn, newSymNode(res), newIntNode(nkInt8Lit, i)))
    caseStmt.add newBranch

  body.add(caseStmt)

  var n = newNodeI(nkProcDef, info, bodyPos+2)
  for i in 0..<n.len: n[i] = newNodeI(nkEmpty, info)
  n[namePos] = newSymNode(result)
  n[paramsPos] = result.typ.n
  n[bodyPos] = body
  n[resultPos] = newSymNode(res)
  result.ast = n
  incl result.flags, sfFromGeneric
  incl result.flags, sfNeverRaises