Recent Posts

Pages: [1] 2 3 ... 10
1
SlickEdit® / Re: Color Coding Embedded
« Last post by hs2 on May 20, 2018, 03:11:40 pm »
@Clark: It‘s a shame that they didn’t play nice. There is just too much arrogance and ignorance :(
HS2
2
SlickEdit® / Re: Color Coding Embedded
« Last post by Clark on May 20, 2018, 03:03:59 pm »
Here are some of the languages that support interpolated strings the way they are typically done:

Scala, Groovy, JavaScript, Kotlin, Puppet, Ruby, Swift

Parsing for a typical interpolated string is done like this:

* parse until start interpolation token (often '${')
* Now tokenize what's inside until the end interpolation token (often '}').
* After that, continue to parse the rest of the string.

This has to be done recursively because you can have an interpolated string inside of an interpolated string.
3
SlickEdit® / Re: Color Coding Embedded
« Last post by Clark on May 20, 2018, 02:07:59 pm »
I've written parsers for many languages. Overall, Python is a very well designed language. However, Python should have done a better job coming up with the syntax for string literals. You noted the problem with a trailing backslash in a string (like a Windows path). Yep that's a stupid problem. When I mentioned this to the developers of Python in a nice way on one of their forums, they attacked me (wasn't pretty). I guess supporting Windows paths isn't important to them.
4
SlickEdit® / Re: Color Coding Embedded
« Last post by Clark on May 20, 2018, 01:50:32 pm »
My point is that the parsing of interpolated strings isn't the typical way this is done. Which means, that the way SlickEdit typically parses interpolated strings when color coding isn't quite right for Python.

Python takes a more simple approach. First, you parse the entire string as if there is no interpolation. Then you look for interpolations inside the string and parse them. Scala and many others do not parse interpolated strings this way. We can add support for interpolated strings to Python similarly to the way it's done for say Scala but only because Python won't compile problem cases (where SlickEdit will have no idea there's a syntax error).

SlickEdit also has a tagging parser for Python but no change is needed there since interpolation can be ignored.
5
SlickEdit® / Re: Color Coding Embedded
« Last post by jporkkahtc on May 20, 2018, 05:35:38 am »
WRT python strings: I'm not sure what you are getting at.
Why use the { }, but then also have the double quotes? "Hello {" expr "} World"
For instance, this works - by keeping the value inside the string
Code: [Select]
print(f"string expression={1}\n")
What you showed looks to me like SlickC style - implicit concat, I didn't know other languages that do it that way:
Code: [Select]
print(f"string expression={"1"}\n")
In java you might do
Code: [Select]
String a = "Hello" + str(5) + "World";
While the same in SlickC is
Code: [Select]
_str a = "Hello" 5 "World";
And it my latest language I've been working in, "R" (really powerful, yet oh, so ugly)
Code: [Select]
a = paste("Hello", 5, "World", sep = "")

Certainly python strings are screwy in other ways, so I'm willing to believe that they are messed up in this way to.
The one that irritates me the most is that backslash (\) kind-of escapes a quote inside of a raw string.
Code: [Select]
a=R"abc\def"     # A is 7 characters - as expected
a=R"abc\"def"    # A is 8 characters - as expected
a=R"abc\"def\"   # Syntax error - that last quote is escaped! (WTF?)
6
SlickEdit® / Re: Color Coding Embedded
« Last post by Clark on May 20, 2018, 02:19:02 am »
Added a hot fix for the config modify issue which will be available in the next hot fix build.
7
SlickEdit® / Re: Color Coding Embedded
« Last post by Clark on May 19, 2018, 03:21:12 pm »
Interesting. Python doesn't seem to handle interpolated strings like other languages.

Here's some Scala code:
Code: [Select]
    var x=1;
    println(f"x=${x+1}");
    println(f"string expresssion=${"some string"}");

Similar python code:
Code: [Select]
    x = 1
    print(f"x={x+1}\n")
    # This python string won't compile
    print(f"string expression={"1"}\n")

We can change the Python string color coding to color interpolated strings for Python too. If we do, it will correctly color code example print string 1 but not the second one (which won't compile anyway so maybe it doesn't matter). I think this is why we didn't bother. Python really parses the entire string first and then processes replacements which is not what most languages with interpolated strings do.

We will look into the config modify issue.
8
SlickEdit® / Re: Cannot adjust erratic Window Left Margin
« Last post by Graeme on May 19, 2018, 07:47:58 am »
The light bulb certainly makes the margin stick in "wide mode" and there's no obvious way to get back to narrow mode.  Personally I don't think the light bulb has any value - I had to use Alt-dot to even get it to appear.  Luckily it can be turned off.  I have auto completion turned off so I never see this.  I don't see how automatically switching the margin back to narrow when there's no more icons there could be a problem, except in the case of the light bulb.
9
SlickEdit® / Re: Cannot adjust erratic Window Left Margin
« Last post by Graeme on May 18, 2018, 11:53:15 pm »
Quote
Once an icon is created in the left margin, we leave it in the wider state.

This is not true - at least in 22.0.2.  If I clear a bookmark or selective display, the margin goes back to narrow.  It's more likely to be a bug than anything else or he would be able to get the margin back to narrow.
10
SlickEdit® / Cleaning up MRU in Project list (v22.0.2.1)
« Last post by JimmieC on May 18, 2018, 08:53:53 pm »
I had folders already created in my Project list for various categories of projects. After some time, I had built up some MRU history. I went into Project->Organize All Workspaces and moved most of the MRU list to folders and deleted the rest. However, I still had the MRU history listed when I went back to the Project menu. I expected it to be empty because I had cleaned it up. So, I went to Options->File Options->History->Project Menu and set the History Size to zero. Still, I had the MRU listed in the Project menu. I exited SE and re-opened SE. Now the Project MRU was empty. Then I went back into Options->File Options->History->Project Menu and set it to eight so that I can still have some MRU again.

I think that the Organize All Workspaces should have cleaned up the Project MRU. That was my expectation, but it is not a big deal if this is by design. It's just a little clunky.
Pages: [1] 2 3 ... 10