Skip to content

Add Grain language support#712

Merged
aduros merged 4 commits into
aduros:mainfrom
tjpalmer:grain
Jun 2, 2024
Merged

Add Grain language support#712
aduros merged 4 commits into
aduros:mainfrom
tjpalmer:grain

Conversation

@tjpalmer
Copy link
Copy Markdown
Contributor

@tjpalmer tjpalmer commented Apr 24, 2024

from "uint8" include Uint8
use Uint8.{ (+), (-), (&), (>), (==) }

let smiley = b"\xc3\x81\x24\x24\x00\x24\x99\xc3"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested a variation of this example using png2src output instead of the manual things here, and it worked for me.

The original example here also worked for me. I used a manually built Grain 0.6.3.

Comment thread cli/cli.js
} else if (opts.go) {
return "go";
} else if (opts.grain) {
return "grain";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I testing making a new project as well as png2src.

Comment thread cli/lib/watch.js
} else {
// Only trigger on source file changes
return /\.(c|cpp|d|go|h|nelua|nim|odin|pn|porth|rol|rs|ts|wat|zig)$/.test(file);
return /\.(c|cpp|d|go|gr|h|nelua|nim|odin|pn|porth|rol|rs|ts|wat|zig)$/.test(file);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had trouble getting watch working in general, but this is the right suffix for grain.

Comment thread cli/package.json
"go",
"golang",
"grain",
"grainlang",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some other languages are missing from this tag list, but I didn't add others in this PR.

"language-c3": "c3",
"language-cpp": "c",
"language-d": "d",
"language-grain": "grain",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even know what this file is, but I added grain alongside the other languages.

@aduros
Copy link
Copy Markdown
Owner

aduros commented Jun 2, 2024

Thanks Tom! I haven't tried out the latest version of Grain yet, but this looks really useful.

@aduros aduros merged commit 5c1f280 into aduros:main Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants