Bug 335076 - Tcl 8.5 and 8.6 syntax not support
Summary: Tcl 8.5 and 8.6 syntax not support
Status: NEW
Alias: None
Product: DLTK
Classification: Technology
Component: Tcl (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal with 5 votes (vote)
Target Milestone: ---   Edit
Assignee: dltk.tcl-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-22 01:30 EST by Gerald W. Lester CLA
Modified: 2019-04-02 13:32 EDT (History)
7 users (show)

See Also:


Attachments
Support for argument expansion in Tcl parser (56.30 KB, patch)
2013-01-18 05:25 EST, Oldrich Jedlicka CLA
no flags Details | Diff
Support for argument expansion in Tcl parser (4.93 KB, patch)
2013-01-18 05:35 EST, Oldrich Jedlicka CLA
alex.panchenko: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald W. Lester CLA 2011-01-22 01:30:30 EST
Build Identifier: 20100917-0705

Argument expansion, i.e. {*}, gets marked as an error -- namely "Extra characters after close-brace".

TclOO syntax also does not appear to be supported

Reproducible: Always
Comment 1 Martin Heinrich CLA 2011-11-23 06:46:42 EST
same for:

code:
namespace _ensemble_ create ...
==> Invalid argument:ensemble.
Possible values:children,code,current,delete,eval,exists,export,forget,import,inscope,origin,parent,qualifiers,tail,which

DLTK:
Dynamic Languages Toolkit - TCL Development Tools 3.0.0.v20101109-0623-7g--EC3wSgpTPwM02543

Eclipse Galileo:
Version: 3.5.2
Build id: M20100211-1343

Expect:
5.44.1.15

Tcl:
8.5.8

OS:
Debian Squeeze
Comment 2 Doug Hockin CLA 2012-12-27 14:12:40 EST
I'm also getting similar errors:

Code:

1)
  uplevel 1 [list namespace upvar $ns {*}$vs]
  set admin_cost [rstpPortGetAdminPathCost $dutNo $portNo {*}$args]
  set admin_cost [rstpPortGetOperPathCost $dutNo $portNo {*}$args]
  return [$specific_proc_name {*}$args]

==> Extra characters after close-brace

Notice that there are many, many uses of {*} argument expansion in the code that do not give this error. These 4 lines are the only places with the error.

2)
    set my [info object namespace $cls]::my
    if { [catch { set ns [info object namespace [uplevel 1 {self class}]] } result] } {
    set ns [info object namespace [uplevel 1 {info object class [self object]}]]

==> Invalid argument:object.
Possible values:args,body,cmdcount,commands,complete,default,exists,frame,functions,globals,hostname,level,library,loaded,locals,nameofexecutable,patchlevel,procs,script,sharedlibextension,tclversion,vars

Every usage of "info object namespace" gets this error.

3)
   foreach var [info variable] {
   set vsSearch [catch {info variable $memberVar -value} vsReturnVal]
   if {[catch {info variable $memberVar -name}]} {

==> Invalid argument:variable.
Possible values:args,body,cmdcount,commands,complete,default,exists,frame,functions,globals,hostname,level,library,loaded,locals,nameofexecutable,patchlevel,procs,script,sharedlibextension,tclversion,vars	vplsFrame.tcl	/Common	line 636	DLTK Problem

Most but not all instances of "info variable" get this error.


DLTK:
Dynamic Languages Toolkit - TCL Development Tools 4.0.0.201206120848

Eclipse:
Juno Service Release 1
Build id: 20121004-1855

Tcl:
ActiveTcl8.5.12.0.296033-win32-x86_64-threaded.exe

OS:
Windows 7 64-bit
Comment 3 Doug Hockin CLA 2012-12-27 14:26:20 EST
See also Bug 328236.
Comment 4 Oldrich Jedlicka CLA 2013-01-18 05:25:03 EST
Created attachment 225806 [details]
Support for argument expansion in Tcl parser

This patch allows the parser to recognise the argument expansion, so that it is no more marked as an error.
Comment 5 Alex Panchenko CLA 2013-01-18 05:32:23 EST
Hi Oldrich,

Thank you for the patch!

Could you update it, so it contains only the real changes?
e.g. TclLaunchingTests was moved to the separate plugin ~2 months ago, but somehow that change is repeated in the patch.

Regards,
Alex
Comment 6 Oldrich Jedlicka CLA 2013-01-18 05:35:58 EST
Created attachment 225807 [details]
Support for argument expansion in Tcl parser

This patch allows the parser to recognise the argument expansion, so that it is no more marked as an error.

There was some garbage added by Eclipse, so I exported it directly from Git.
Comment 7 Oldrich Jedlicka CLA 2013-01-18 05:39:09 EST
I don't know the DLTK styling rules, so the isArgumentExpansion attribute and enum ArgumentExpansionState in BracesSubstitution might be marked as private and moved at the beginning/end of the class.
Comment 8 michael scheerer CLA 2013-10-07 05:02:45 EDT
(In reply to Oldrich Jedlicka from comment #6)
> Created attachment 225807 [details]
> Support for argument expansion in Tcl parser
> 
> This patch allows the parser to recognise the argument expansion, so that it
> is no more marked as an error.
> 
> There was some garbage added by Eclipse, so I exported it directly from Git.

I have tried to install the patch. I manually replaced the org.eclipse.dltk.tcl.parser_4.0.0.201206120848.jar in the plugin folder with a jar file containing your modified and from my IDE (JCreator) compiled 2 classes (SimpleTclParser.class BracesSubstitution.class). I also used a second way according this manual:


    Download the plug-in JAR to somewhere.
    In Eclipse, File->Import->Plug-ins and Fragments
    Select the directory you saved it in, select 'Projects with source     
folders', Next
    Add the plugin, Finish

You now have an Eclipse project representing the plugin. Make your changes, and then:

    File->Export->Deployable plug-ins and fragments
    Select the plug-in, select a place to save it

In both cases there were no improvement. It works, but following else condition is not triggered:

if (!((BracesSubstitution)first).isArgumentExpansion()) { ... } 
else { ... }

If change it to a "forced always usage":

if (((BracesSubstitution)first).isArgumentExpansion()) { ... } 
else { ... }

the whole plugin crashed with a ClassNotDefExeception.

Version: Juno Service Release 1
Build id: 20120920-0800

Ubuntu Linux

Oracle Java 1.7
Comment 9 Oldrich Jedlicka CLA 2013-10-07 09:53:26 EDT
(In reply to michael scheerer from comment #8)
> (In reply to Oldrich Jedlicka from comment #6)
> > Created attachment 225807 [details]
> > Support for argument expansion in Tcl parser
>
> ...
> the whole plugin crashed with a ClassNotDefExeception.

I used latest Git version (at the time of generating the patch) and exported the dltk.core, dltk.mylyn and dltk.tcl features. I then used the exported plugins directory as a remote update site (url "file:/home/...") and installed the update from there.
Comment 10 michael scheerer CLA 2013-10-23 12:10:39 EDT
(In reply to Oldrich Jedlicka from comment #9)
> (In reply to michael scheerer from comment #8)
> > (In reply to Oldrich Jedlicka from comment #6)
> > > Created attachment 225807 [details]
> > > Support for argument expansion in Tcl parser
> >
> > ...
> > the whole plugin crashed with a ClassNotDefExeception.
> 
> I used latest Git version (at the time of generating the patch) and exported
> the dltk.core, dltk.mylyn and dltk.tcl features. I then used the exported
> plugins directory as a remote update site (url "file:/home/...") and
> installed the update from there.

It works now. But there's another problem:
Editing the builtin.xmi and then exporting or even manually copy the modified .xmi
has no result. I want to elimiate the wrong warnings "extra arguments" in case of e.g.: dict create {*}[ list .... 

So changing even the create section to e.g.

       <groups constant="create">
          <arguments xsi:type="tclparse:Group" lowerBound="0" upperBound="-1">
            <arguments xsi:type="tclparse:TypedArgument" name="blabla"/>
          </arguments>
        </groups>

has no effect
Comment 11 michael scheerer CLA 2013-11-27 08:35:36 EST
Hi Alex,
> 
> Thank you for the patch!

The patch doesn't work correct, because it produced new false positive warnings and Errors. But I developed the Plugin further to solve the Problem and to introduce TCL version dependend behaviour and fix the former broken checking:
It checkes against both, 8.0 AND 8.5 Syntax and this is then broken.
With a new check box you can then Switch the Versions.

What I Need:

1. Access to the git-repository
2. Urgend: How can I emulate a setDirty-Save Action on loading the Editor to sync the new tcl version with the error behaviour (does currently work during editing and saving). Please don't tell me about manual stuff (firerProperty(PROP_DIRTY) - if it would be so easy, I wouldn't ask) - he would need the right listeners to do so.

So then with exception of 1. and 2. it is fixed.
Comment 12 Andrei Pozolotin CLA 2018-05-12 12:50:13 EDT
Kaloyan Raev, Alexander Kurtakov, 
looking at your work for 5.9:
https://github.com/eclipse/dltk.tcl/commits/master
can you please include correction for Tcl v8.5 syntax changes?