pegs supports utf-8 now

This commit is contained in:
Andreas Rumpf 2009-09-25 17:02:34 +02:00
commit 364db73bb4
3 changed files with 6 additions and 9 deletions

View file

@ -11,7 +11,7 @@
## module depends on the compiler. Most of the routines listed here use ## module depends on the compiler. Most of the routines listed here use
## special compiler magic. ## special compiler magic.
## Each module implicitly imports the System module; it may not be listed ## Each module implicitly imports the System module; it may not be listed
## explicitly. Because of this there can not be a user-defined module named ## explicitly. Because of this there cannot be a user-defined module named
## ``system``. ## ``system``.
{.push hints: off.} {.push hints: off.}
@ -249,8 +249,8 @@ proc dec*[T](x: var ordinal[T], y = 1) {.magic: "Dec", noSideEffect.}
proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.} proc newSeq*[T](s: var seq[T], len: int) {.magic: "NewSeq", noSideEffect.}
## creates a new sequence of type ``seq[T]`` with length ``len``. ## creates a new sequence of type ``seq[T]`` with length ``len``.
## This is equivalent to ``s = []; setlen(s, len)``, but more ## This is equivalent to ``s = @[]; setlen(s, len)``, but more
## efficient since no relocation is needed. ## efficient since no reallocation is needed.
proc len*[T](x: openarray[T]): int {.magic: "LengthOpenArray", noSideEffect.} proc len*[T](x: openarray[T]): int {.magic: "LengthOpenArray", noSideEffect.}
proc len*(x: string): int {.magic: "LengthStr", noSideEffect.} proc len*(x: string): int {.magic: "LengthStr", noSideEffect.}
@ -864,15 +864,14 @@ proc dealloc*(p: Pointer) {.noconv.}
## ``realloc``. This procedure is dangerous! If one forgets to ## ``realloc``. This procedure is dangerous! If one forgets to
## free the memory a leak occurs; if one tries to access freed ## free the memory a leak occurs; if one tries to access freed
## memory (or just freeing it twice!) a core dump may happen ## memory (or just freeing it twice!) a core dump may happen
## or other memory may be corrupted. So this procedure is really ## or other memory may be corrupted.
## *unsafe*.
proc assert*(cond: bool) {.magic: "Assert", noSideEffect.} proc assert*(cond: bool) {.magic: "Assert", noSideEffect.}
## provides a means to implement `programming by contracts` in Nimrod. ## provides a means to implement `programming by contracts`:idx: in Nimrod.
## ``assert`` evaluates expression ``cond`` and if ``cond`` is false, it ## ``assert`` evaluates expression ``cond`` and if ``cond`` is false, it
## raises an ``EAssertionFailure`` exception. However, the compiler may ## raises an ``EAssertionFailure`` exception. However, the compiler may
## not generate any code at all for ``assert`` if it is advised to do so. ## not generate any code at all for ``assert`` if it is advised to do so.
## Thus one should use ``assert`` for debugging purposes only. ## Use ``assert`` for debugging purposes only.
proc swap*[T](a, b: var T) {.magic: "Swap", noSideEffect.} proc swap*[T](a, b: var T) {.magic: "Swap", noSideEffect.}
## swaps the values `a` and `b`. This is often more efficient than ## swaps the values `a` and `b`. This is often more efficient than

View file

@ -358,7 +358,6 @@ begin
end; end;
function GetNumber(var L: TLexer): TToken; function GetNumber(var L: TLexer): TToken;
// extremely hard work above us!
var var
pos, endpos: int; pos, endpos: int;
xi: biggestInt; xi: biggestInt;

View file

@ -82,7 +82,6 @@ begin
result := newSym(skTemp, getIdent(genPrefix), getCurrOwner(c)); result := newSym(skTemp, getIdent(genPrefix), getCurrOwner(c));
result.info := info; result.info := info;
result.typ := skipTypes(typ, {@set}[tyGenericInst]); result.typ := skipTypes(typ, {@set}[tyGenericInst]);
// XXX really correct? maybe we need tyGenericInst for generic instantion?
include(result.flags, sfFromGeneric); include(result.flags, sfFromGeneric);
end; end;