View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001500SphereServerexecutable - genericpublic22-08-08 03:3523-04-14 02:18
ReporterAnkron 
Assigned ToBen 
PrioritynormalSeverityfeatureReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version0.56c Nightly 
Summary0001500: Qoutation mark's cause huge problems in the scripting language
DescriptionWhen you type in things like .TEST "a", a, "a" the function will only see the first argument, and ignore that there are Qoutation marks the rest. So say I want to use a function like this...
.TEST His name is "PK", and he likes to kill players
it will only see the first argument

His name is PK
Additional Informationhere's a test script <args> works fine <argvx> does not.

[FUNCTION TEST]
say <args>
say <argv0>, <argv1>, <argv2>
TagsNo tags attached.
Nightly Version08-02-2008
Experimental FlagsNone
Option FlagsNone
Internal Build Number
Attached Files

- Relationships

-  Notes
(0000069)
Coruja (developer)
23-08-08 02:38

Thats the sphere scripting language I guess, but you can use '' instead of "" without problems :D
(0000070)
Ankron (reporter)
23-08-08 22:06

I suppose you could, but users hardly if ever think like that. Say I wanted to create a script that requires user input right? Well the moment a user starts using qoutation makers the whole script goes Kaboom. IE user puts in say

.chat Hello, GM this guys just said "I'm gonna crash your server", "screw the GM's", and ect.

Only half that message would show up. Or maybe some other scripting clutz out there used qoutations in the name of an item and I want to store the information about that item in a data base. It might not store so well.

There there's the issue of NPC's speech, what if I need to use Qotation marks and apostrophies in the same sentence? Can't do it with out issues.

Also what about parsing what a player says for command line/filtering pourposes
Enter a qoutation mark and a comma (quite common I might add) your script is sunk.

Personnaly I'd like to see strings parsed the same way they would be in most modern programing languages IE...

"My dog's name is \"".<local0.varhere>."\". He likes to eat %1, %2, and %3.", "ribs", "chicken", "anything off the table."

Notce how it's parsed?
if there is a qoutation mark with no forward-slash then it signifies the start or end of a string in an argument. But if a forward-slsh preceeds the qoutation mark it means that the qoutation mark is part of the string to be used. Also notice the commas outside the qouted string? those signify that after this comma is a new argument. Much cleaner.

IE if I used the string above with say this function...

[function DogsName]
local.varhere="Spike"
say <argv0>
(0000072)
nazghul (developer)
26-08-08 00:59
edited on: 26-08-08 01:00

No one stops you from using Sphere's Regex function.

Escaping would help you absolutely nothing with your "user writes in a chat" example, because if the user is unable to remember to not use quotation marks, he's also unable to use escaping; so your script has to do the escaping for him - and then you can insert your own escaping/deescaping.

Anyway, I really doubt that any dev is willing to rewrite the whole, in some parts "distributed" parser just to enable you to use single quotes and apostroph's in the same string

NOT to mention that this is no "major bug", as you declarated it, but, if at all, a feature request

(0000075)
Ankron (reporter)
27-08-08 20:52
edited on: 27-08-08 21:39

More to the bug... in scrips it drops everything after the first qoutation mark in the argument variables even in <args>, I really would like it if that didn't happen.

(0000181)
Ankron (reporter)
15-03-09 18:20
edited on: 15-03-09 18:24

Ok, more info on this bug... you cannot escape qoutation marks no matter how much you want to... you type asc(") and gives the result in 00 which will never convert back to any charactor other than a space. And even if you get the 00 it still drops everything after the second qoutation mark.

asc("asd", AAA)) will result in a set of 3 bytes when it should be 9 bytes, 1 byte per char.

So telling some one to escape a qoutation mark when it's not possible, just does not work.

(0002080)
Ben (manager)
23-04-14 02:18

This is how is will work now in a simple function called TEST...
-.TEST "a", b, "c,d" Output: ARGS = a ARGV[0] = a ARGV[1] = b ARGV[2] = c,d
-.TEST "a"e, b, "c,d" Output: ARGS = a ARGV[0] = a ARGV[1] = b ARGV[2] = c,d
-.TEST e"a", b, "c,d"f Output: ARGS = e"a", b, "c,d"f ARGV[0] = e"a" ARGV[1] = b ARGV[2] = c,d
-.TEST f"a"g"h,i",b,e"c,d" Output: ARGS = f"a"g"h,i",b,e"c,d" ARGV[0] = f"a"g"h,i" ARGV[1] = b ARGV[2] = e"c,d"
*All ARGV will now show even if quotes are found in first argument.
*if quotes are found as the first character of an argument, what is found in the quote is the argument
*if a quote is found but not at the beginning, or no quote is found, whole string is used as argument.

- Issue History
Date Modified Username Field Change
22-08-08 03:35 Ankron New Issue
22-08-08 03:35 Ankron Nightly Version => 08-02-2008
22-08-08 03:35 Ankron Experimental Flags => None
22-08-08 03:35 Ankron Option Flags => None
23-08-08 02:38 Coruja Note Added: 0000069
23-08-08 22:06 Ankron Note Added: 0000070
26-08-08 00:59 nazghul Note Added: 0000072
26-08-08 01:00 nazghul Note Edited: 0000072
26-08-08 01:02 nazghul Severity major => feature
26-08-08 01:02 nazghul Status new => feedback
27-08-08 20:52 Ankron Note Added: 0000075
27-08-08 20:54 Ankron Note Edited: 0000075
27-08-08 20:55 Ankron Note Edited: 0000075
27-08-08 21:00 Ankron Note Edited: 0000075
27-08-08 21:39 Ankron Note Edited: 0000075
15-03-09 18:20 Ankron Note Added: 0000181
15-03-09 18:22 Ankron Note Edited: 0000181
15-03-09 18:23 Ankron Note Edited: 0000181
15-03-09 18:24 Ankron Note Edited: 0000181
15-03-09 20:09 MrSugarCube Relationship added has duplicate 0001583
23-04-14 02:18 Ben Note Added: 0002080
23-04-14 02:18 Ben Status feedback => resolved
23-04-14 02:18 Ben Fixed in Version => 0.56c Nightly
23-04-14 02:18 Ben Resolution open => fixed
23-04-14 02:18 Ben Assigned To => Ben


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker