Jump to content

Recommended Posts

Hi Martien,

 

I faced with issue with project name in Cyrillic. Project fetching works as expected, however when I press Return it fails. Just in case, there is no such issue with project name with Latin symbols only.

 

Here is output from debugger:

[2019-03-14 00:55:50][ERROR: input.scriptfilter] Code 1: /Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:24645
            throw new Error(this.formatError(fallbackToken, "invalid syntax"))
            ^
Error: invalid syntax at line 1 col 7:
  Test #Проект
        ^
    at Lexer.next (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:24645:19)
    at Parser.feed (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:25344:30)
    at parser (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:25469:12)
    at init$1 (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46714:18)
    at Object.create (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46852:20)
    at Object.<anonymous> (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46928:10)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)

How could I fix it?

Share this post


Link to post
19 hours ago, Pavel A said:

there is no such issue with project name with Latin symbols only

 

Just for clarification, do you mean ASCII or also non-ASCII Latin symbols (ü, ø, é, £ etc.)?

Share this post


Link to post
Posted (edited)
22 hours ago, Pavel A said:

Hi Martien,

 

I faced with issue with project name in Cyrillic. Project fetching works as expected, however when I press Return it fails. Just in case, there is no such issue with project name with Latin symbols only.

 

Here is output from debugger:


[2019-03-14 00:55:50][ERROR: input.scriptfilter] Code 1: /Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:24645
            throw new Error(this.formatError(fallbackToken, "invalid syntax"))
            ^
Error: invalid syntax at line 1 col 7:
  Test #Проект
        ^
    at Lexer.next (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:24645:19)
    at Parser.feed (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:25344:30)
    at parser (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:25469:12)
    at init$1 (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46714:18)
    at Object.create (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46852:20)
    at Object.<anonymous> (/Users/user/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.6B267314-FEF6-41BC-A780-F5C65CBB31AB/alfred-workflow-todoist.js:46928:10)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)

How could I fix it?

 

Right now the parser only supports latin characters. I hadn't considered other scripts. Is there a non-capital and capital range that includes all characters (like `a-z` and `A-Z`)?

 

Edit: that would seem to be `а-я` and `А-Я` am I right?

Edit 2: or perhaps [Ѐ-Ӿ] (as recommended here)

Edited by Martien Oranje

Share this post


Link to post
2 hours ago, deanishe said:

 

Just for clarification, do you mean ASCII or also non-ASCII Latin symbols (ü, ø, é, £ etc.)?

 

Those aren't matched by the parser either!

Share this post


Link to post
Posted (edited)
1 hour ago, Martien Oranje said:

Edit: that would seem to be `а-я` and `А-Я` am I right?

 

If I've understood the problem, it's the project parser. Can you not extract projects and labels with, say, #(\S+) (i.e. every non-space character) or #\[[^\]]+\] (i.e. every character that isn't ])? Then you don't need to worry about alphabets.

 

FWIW, if you did want to use a regex to explicitly match the characters in the project, I think the "Letters" classes on the page you linked to are what you would want.

Edited by deanishe

Share this post


Link to post
21 hours ago, deanishe said:

 

If I've understood the problem, it's the project parser. Can you not extract projects and labels with, say, #(\S+) (i.e. every non-space character) or #\[[^\]]+\] (i.e. every character that isn't ])? Then you don't need to worry about alphabets.

 

FWIW, if you did want to use a regex to explicitly match the characters in the project, I think the "Letters" classes on the page you linked to are what you would want.

 

Yes I could do that, but I fear that some control characters like `,` and `:` and `;` might be problematic. I've opted for the long way. I've spun up a beta version  for @Pavel A to test. My Cyrillic literacy is not very good but seems to work. If you can confirm it works I'll merge the changes to master.

 

https://drive.google.com/file/d/1nmdTrYqpt7Ef1Dzt1k9PAA1oVPSMiwAh/view?usp=sharing

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...