[code] [textadept] applescript syntax request

From: Jay Young <jyng7.att.hotmail.com>
Date: Fri, 22 May 2015 13:32:56 -0500

I have a syntax request. This is just for the AppleScript language. Whenever I type a single quote, Textadept considers that to be for a string, so colors it accordingly. But in AppleScript, strings can only be in double quotes. But single quotes can be used elsewhere like so:
    tell (current date) set m to (it's month) as number end tell
Some people use "of" instead of the apostrophe-s like this:
    tell (current date) set m to (month of it) as number end tell
but I like the apostrophe-s approach better.
I went in my ~/.textadept/lexers/applescript.lua file and changed:
--Strings.local sq_str = l.delimited_range("'", true)local dq_str = l.delimited_range('"', true)local string = token(l.STRING, sq_str + dq_str)
to this:
--Strings.local dq_str = l.delimited_range('"', true)local string = token(l.STRING, dq_str)
I'm a total beginner at lua, so I may have editted that code incorrectly, but it does make the AppleScript syntax look a lot better. Could this applescript.lua file be adjusted in the next Textadept version?
Also, while I'm on the subject of lua, does anyone know how to check the platform you're on with lua? Roughly an example:
    os = <platform>? if (os == 'os x') then -- stuff elseif (os == 'win') then -- stuff end
I'm struggling finding this online, but have found:
    f = io.popen('uname', 'r') v = f:read('*a') f:close() print('Version: ' .. v)
Which gives me "Version: Darwin".
Thank you (and thanks for letting me sneak a lua question in).

You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Fri 22 May 2015 - 14:32:56 EDT

This archive was generated by hypermail 2.2.0 : Sat 23 May 2015 - 06:25:16 EDT