Jump to content

Mason Wheeler

Members
  • Content Count

    39
  • Joined

  • Last visited

  1. Mason Wheeler

    Off by one error in bounds checking

    In various $DIdx functions, the following line appears: if (i>a.length) throw Exception.Create($New(Exception),"Upper bound exceeded! Index "+i.toString()+z); The check needs to be "if (i >= a.length)", since JS arrays are zero-based.
  2. Mason Wheeler

    Incorrect codegen for Pred()

    var x := 25; var y := 1; var z := x - pred(y); Expected: z = 25 Observed: z = 23, because the codegen for this is "z = x - y - 1" rather than "z = x - (y - 1)"
  3. Mason Wheeler

    Assertion failure in the compiler

    Found another one. This looks similar, and may or may not be the same bug. Start a new project. Paste the following into any method: var zer: array of real; Zer[0] := ASin(AA); Change ASin to ArcSin. Hit ALT-F4 and don't save. Crash occurs in compiler while shutting down.
  4. Mason Wheeler

    Assertion failure in the compiler

    Start a new project. In any method, paste the following two lines of code. (It doesn't matter that this doesn't compile.) var U: array of Real; U[0] := C.X().D().A(O,Ae); On the second line, between the U and the open bracket, insert a dot. Compiler explodes.
  5. Mason Wheeler

    Crash on shutdown

    Following a period of intense CPU activity for no good reason that was lagging things horribly, (10-20 seconds from keypress to response,) I tried to shut down and got the following error. I've seen this before, poking around in DWS, and it means something somewhere else went very wrong, so I'm not sure how much this will help, but here's the error report: http://pastebin.com/6YrFndxP If it would help at all, I'd be willing to work under NDA with the sources, to help track down and fix up stability issues like this. If I could have attached the debugger at the point where things were burning 100% CPU and lagging everything to high heaven, I might have a more useful bug report for you guys...
  6. Mason Wheeler

    Another CTRL-SHIFT-C problem

    Thanks. I just updated to the latest beta version and found it fixed. Unfortunately, I discovered another CTRL-SHIFT-C bug: It will complete classes, but not class helpers.
  7. Mason Wheeler

    Another CTRL-SHIFT-C problem

    The DWS compiler supports expression properties, like so: property item[index: integer]: TMyObject read (FItems[index]); But if I use a property like this and then hit CTRL-SHIFT-C, it makes a mess of the class, adding invalid declarations and method stubs to the class.
  8. Mason Wheeler

    IDE annoyances

    My setting is 3 spaces per tab, and all of the options at the top of the Editor pane are checked, which now that you call attention to it, appears to be the problem. There's a setting called Smart Tabs which I had never noticed, which is apparently on by default because I don't remember ever setting this, and turning it off makes tabs behave correctly. Not sure what's supposed to be smart about them, since they sure don't follow anything resembling accepted block indentation conventions. This is essentially the same problem as internal units. Behavior that violates the heck out of the Principle of Least Astonishment is on by default, and the only way to turn it off is a completely undocumented setting somewhere in the configuration that does nothing to call attention to itself. IMO this should be intuitively obvious and tautological, but the entire point of building an IDE that looks and feels like other IDEs that the user has used before is that it looks and feels like other IDEs that the user has used before. Messing with that well-understood user experience is a recipe for frustration.
  9. Mason Wheeler

    IDE annoyances

    Hmm. On there, it says Smart Tabs "Tabs to the first non-whitespace character in the preceding line." That actually makes sense, but it behaves badly if the cursor is already on or beyond the column corresponding to the first non-whitespace characer in the preceding line. For example, start a new function, with a header, a begin line, an end line, and a blank line between them. Place the cursor on the blank line and hit [Tab] once, and it will insert 5 spaces, taking you to the same column as the end of the begin above. Continue hitting [Tab] after that and it inserts additional spaces seemingly at random, with no rhyme or reason to the number each number inserts.
  10. Mason Wheeler

    ReferenceError: event is not defined

    Try making a trivial console project in the latest beta and load it in Firefox. Wave the mouse around over the page, and have Firebug open to the Console view, and watch this error spring up like weeds...
  11. Mason Wheeler

    Beta forgot what a "real" is

    I just got the beta, and I'm working on porting forward the project I've been working on. The namespace changes aren't too bad, but for some reason the new version seems to have forgotten what a "real" is. Now I have to rename it to "float" everywhere. Could that be rectified please?
  12. Mason Wheeler

    IDE annoyances

    New unit is always created as dictated by IDE Preferences, Project Management, Store new forms and units in external files. OK, thanks. I didn't know that was there. Even so, it seems a bit odd. When I see options saying "Make project internal" and "Make project external" I interpret that as "set project's state to internal/external." To have this managed as a global setting when the words used in the UI clearly say that it's a project-level thing is just... strange. We definitely don’t want to maintain two or even three parsers as Embarcadero developers do. You shouldn't have to. Getting the method signature right is trivial as long as it parses: grab the position of the declaration from DWS. See what comes first after that position, an open paren or a semicolon. If it's an open paren, then search for the position of the next close paren (as far as I know, there's no case in which parentheses are allowed inside of the parens in a signature declaration, so this is trivial) and then find the next semicolon. Copy that as a literal string, inserting the class name in the appropriate place, and there you have it. To keep from inserting in the middle of a subroutine, check to see if the unit parses with errors. If it doesn't, you're fine. If it does, look for "end." at the end of the file and insert before it if you find it. If not, tokenize the file and iterate through it, looking for an "end." statement anywhere in the document, and insert before it. (This has to be done with the tokenizer to avoid the edge case of inserting inside a string literal or comment.) If that's not found, insert at the end of the file. No alternate parser needed; just a few simple heuristics.
  13. Mason Wheeler

    IDE annoyances

    Also, [CTRL]-[sHIFT]-C relies far too heavily on the parser. If I declare a method signature like function foo(value: integer = MAXINT): array of integer; and then press [CTRL]-[sHIFT]-C, the signature of the stub that it inserts down below really should look like that... but it doesn't. And if there are errors in the code down below, the stub could get inserted at the top of the unit, or even in the middle of another method! BDS doesn't do that...
  14. Mason Wheeler

    IDE annoyances

    [CTRL]-Click in whitespace causes an assertion failure rather than simply doing nothing. Unable to rearrange tabs by dragging them around. If I right-click on a different tab than the one I have open and select Close Page, it closes the current tab rather than the one I said to close. [CTRL]-[backspace] correctly deletes back to the start of a word, but [CTRL]-[Delete] only deletes one character. [TAB] should always insert exactly as many spaces as is defined in Tools->Preferences. Instead, it sometimes does the right thing and sometimes adds some other value based on positioning of text in the line above. In the Messages pane, [CTRL]-[Home] and [CTRL]-[End] correctly scroll the list box, but neglect to move the cursor. There is nothing that reports the number of errors, warnings and hints generated in a compile. If I say "Make Project External", and then "File->New->New Unit", the new unit is added as an internal unit. Come to think of it, the concept of "internal units" in and of itself is an annoyance. Why would anyone ever possibly want to do that, especially if they use version control? There's no way to rearrange the list of units in the Units list on the left, nor to group them into folders, nor to search for a particular unit by name. This makes large projects very unwieldy. The editor is missing what's perhaps the single most useful feature in the Delphi IDE's code editor: SyncEdit. Can has plz? There are no accelerators defined in the Find/Replace dialog box. (Hitting [Alt]-A should run the Replace All command, for example.) All in all, SMS is a fine system, but it needs some attention to detail...
  15. Mason Wheeler

    Class methods on abstract classes

    Yes, please. The code I'm working on porting right now is very complex CAD-related stuff, so there's a lot of arrays of real numbers involved. Anything that would speed that up would be very welcome!
×