mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 13:55:41 +01:00
Fix #826. Add samples for new languages
This commit is contained in:
parent
49ca1a835b
commit
14e82b33a4
7 changed files with 69 additions and 0 deletions
1
website/index/samples/sample.csp.txt
Normal file
1
website/index/samples/sample.csp.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Content-Security-Policy: default-src 'self'; img-src *; media-src media1.com media2.com; script-src userscripts.example.com
|
||||||
8
website/index/samples/sample.mysql.txt
Normal file
8
website/index/samples/sample.mysql.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
CREATE TABLE shop (
|
||||||
|
article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
|
||||||
|
dealer CHAR(20) DEFAULT '' NOT NULL,
|
||||||
|
price DOUBLE(16,2) DEFAULT '0.00' NOT NULL,
|
||||||
|
PRIMARY KEY(article, dealer));
|
||||||
|
INSERT INTO shop VALUES
|
||||||
|
(1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45),
|
||||||
|
(3,'C',1.69),(3,'D',1.25),(4,'D',19.95);
|
||||||
8
website/index/samples/sample.pgsql.txt
Normal file
8
website/index/samples/sample.pgsql.txt
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
BEGIN
|
||||||
|
SELECT * INTO STRICT myrec FROM emp WHERE empname = myname;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN NO_DATA_FOUND THEN
|
||||||
|
RAISE EXCEPTION 'employee % not found', myname;
|
||||||
|
WHEN TOO_MANY_ROWS THEN
|
||||||
|
RAISE EXCEPTION 'employee % not unique', myname;
|
||||||
|
END;
|
||||||
4
website/index/samples/sample.redis.txt
Normal file
4
website/index/samples/sample.redis.txt
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
EXISTS mykey
|
||||||
|
APPEND mykey "Hello"
|
||||||
|
APPEND mykey " World"
|
||||||
|
GET mykey
|
||||||
9
website/index/samples/sample.redshift.txt
Normal file
9
website/index/samples/sample.redshift.txt
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
create view tables_vw as
|
||||||
|
select distinct(id) table_id
|
||||||
|
,trim(datname) db_name
|
||||||
|
,trim(nspname) schema_name
|
||||||
|
,trim(relname) table_name
|
||||||
|
from stv_tbl_perm
|
||||||
|
join pg_class on pg_class.oid = stv_tbl_perm.id
|
||||||
|
join pg_namespace on pg_namespace.oid = relnamespace
|
||||||
|
join pg_database on pg_database.oid = stv_tbl_perm.db_id;
|
||||||
29
website/index/samples/sample.rust.txt
Normal file
29
website/index/samples/sample.rust.txt
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
fn main() {
|
||||||
|
let greetings = ["Hello", "Hola", "Bonjour",
|
||||||
|
"Ciao", "こんにちは", "안녕하세요",
|
||||||
|
"Cześć", "Olá", "Здравствуйте",
|
||||||
|
"Chào bạn", "您好", "Hallo",
|
||||||
|
"Hej", "Ahoj", "سلام"];
|
||||||
|
|
||||||
|
for (num, greeting) in greetings.iter().enumerate() {
|
||||||
|
print!("{} : ", greeting);
|
||||||
|
match num {
|
||||||
|
0 => println!("This code is editable and runnable!"),
|
||||||
|
1 => println!("¡Este código es editable y ejecutable!"),
|
||||||
|
2 => println!("Ce code est modifiable et exécutable !"),
|
||||||
|
3 => println!("Questo codice è modificabile ed eseguibile!"),
|
||||||
|
4 => println!("このコードは編集して実行出来ます!"),
|
||||||
|
5 => println!("여기에서 코드를 수정하고 실행할 수 있습니다!"),
|
||||||
|
6 => println!("Ten kod można edytować oraz uruchomić!"),
|
||||||
|
7 => println!("Este código é editável e executável!"),
|
||||||
|
8 => println!("Этот код можно отредактировать и запустить!"),
|
||||||
|
9 => println!("Bạn có thể edit và run code trực tiếp!"),
|
||||||
|
10 => println!("这段代码是可以编辑并且能够运行的!"),
|
||||||
|
11 => println!("Dieser Code kann bearbeitet und ausgeführt werden!"),
|
||||||
|
12 => println!("Den här koden kan redigeras och köras!"),
|
||||||
|
13 => println!("Tento kód můžete upravit a spustit"),
|
||||||
|
14 => println!("این کد قابلیت ویرایش و اجرا دارد!"),
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
website/index/samples/sample.sb.txt
Normal file
10
website/index/samples/sample.sb.txt
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
begin:
|
||||||
|
TextWindow.Write("Enter a number: ")
|
||||||
|
num = TextWindow.ReadNumber()
|
||||||
|
remainder = Math.Remainder(num, 2)
|
||||||
|
If (remainder = 0) Then
|
||||||
|
TextWindow.WriteLine("The number is Even")
|
||||||
|
Else
|
||||||
|
TextWindow.WriteLine("The number is Odd")
|
||||||
|
EndIf
|
||||||
|
Goto begin
|
||||||
Loading…
Add table
Add a link
Reference in a new issue